<p>It seems that everybody is jumping on the dynamic, non-compiled bandwagon lately.  I've mostly only worked in compiled, static typed languages (C, Java, .Net).  The experience I have with dynamic languages is stuff like ASP (Vb Script), JavaScript, and PHP.  Using these technologies has left a bad taste in my mouth when thinking about dynamic languages.  Things that usually would have been caught by the compiler such as misspelled variable names and assigning an value of the wrong type to a variable don't occur until runtime.  And even then, you may not notice an error, as it just creates a new variable, and assigns some default value.  I've also never seen intellisense work well in a dynamic language, since, well, variables don't have any explicit type.</p>

<p>What I want to know is, what people find so appealing about dynamic languages?  What are the main advantages in terms of things that dynamic languages allow you to do that can't be done, or are difficult to do in compiled languages.  It seems to me that we decided a long time ago, that things like uncompiled asp pages throwing runtime exceptions was a bad idea. Why is there is a resurgence of this type of code?  And why does it seem to me at least, that Ruby on Rails doesn't really look like anything you couldn't have done with ASP 10 years ago?</p>

[{'answer_id': 42945, 'author': 'Matt Mitchell', 'author_id': 364, 'author_profile': 'https://Stackoverflow.com/users/364', 'pm_score': 2, 'selected': False, 'text': '<p>The argument is more complex than this (read <a href="http://steve.yegge.googlepages.com/is-weak-typing-strong-enough" rel="nofollow noreferrer">Yegge\'s article "Is Weak Typing Strong Enough"</a> for an interesting overview).</p>\n\n<p>Dynamic languages don\'t necessarily lack error checking either - C#\'s type inference is possibly one example.  In the same way, C and C++ have terrible compile checks and they are statically typed.</p>\n\n<p>The main advantages of dynamic languages are a) capability (which doesn\'t necessarily have to be used all the time) and b) <a href="http://www.codinghorror.com/blog/archives/000788.html" rel="nofollow noreferrer">Boyd\'s Law of Iteration</a>.</p>\n\n<p>The latter reason is massive.</p>\n'}, {'answer_id': 42949, 'author': 'Dan Herbert', 'author_id': 392, 'author_profile': 'https://Stackoverflow.com/users/392', 'pm_score': 2, 'selected': False, 'text': '<p>Although I\'m not a big fan of Ruby yet, I find dynamic languages to be really wonderful and powerful tools.</p>\n\n<p>The idea that there is no type checking and variable declaration is not too big an issue really. Admittedly, you can\'t catch these errors until run time, but for experienced developers this is not really an issue, and when you do make mistakes, they\'re usually easily fixed. </p>\n\n<p>It also forces novices to read what they\'re writing more carefully. I know learning PHP taught me to be more attentive to what I was actually typing, which has improved my programming even in compiled languages.</p>\n\n<p>Good IDEs will give enough intellisense for you to know whether a variable has been "declared" and they also try to do some type inference for you so that you can tell what a variable is.</p>\n\n<p>The power of what can be done with dynamic languages is really what makes them so much fun to work with in my opinion. Sure, you could do the same things in a compiled language, but it would take more code. Languages like Python and PHP let you develop in less time and get a functional codebase faster most of the time.</p>\n\n<p>And for the record, I\'m a full-time .NET developer, and I love compiled languages. I only use dynamic languages in my free time to learn more about them and better myself as a developer..</p>\n'}, {'answer_id': 42951, 'author': 'wvdschel', 'author_id': 2018, 'author_profile': 'https://Stackoverflow.com/users/2018', 'pm_score': 4, 'selected': False, 'text': "<p>Your arguments against dynamic languages are perfectly valid. However, consider the following:</p>\n\n<ol>\n<li><strong>Dynamic languages don't need to be compiled</strong>: just run them. You can even reload the files at run time without restarting the application in most cases.</li>\n<li><strong>Dynamic languages are generally less verbose and more readable</strong>: have you ever looked at a given algorithm or program implemented in a static language, then compared it to the Ruby or Python equivalent? In general, you're looking at a reduction in lines of code by a factor of 3. A lot of scaffolding code is unnecessary in dynamic languages, and that means the end result is more readable and more focused on the actual problem at hand.</li>\n<li><strong>Don't worry about typing issues</strong>: the general approach when programming in dynamic languages is not to worry about typing: most of the time, the right kind of argument will be passed to your methods. And once in a while, someone may use a different kind of argument that just happens to work as well. When things go wrong, your program may be stopped, but this rarely happens if you've done a few tests.</li>\n</ol>\n\n<p>I too found it a bit scary to step away from the safe world of static typing at first, but for me the advantages by far outweigh the disadvantages, and I've never looked back.</p>\n"}, {'answer_id': 42955, 'author': 'Apocalisp', 'author_id': 3434, 'author_profile': 'https://Stackoverflow.com/users/3434', 'pm_score': 7, 'selected': False, 'text': '<p>I think the reason is that people are used to statically typed languages that have very limited and inexpressive type systems. These are languages like Java, C++, Pascal, etc. Instead of going in the direction of more expressive type systems and better type inference, (as in Haskell, for example, and even SQL to some extent), some people like to just keep all the "type" information in their head (and in their tests) and do away with static typechecking altogether.</p>\n\n<p>What this buys you in the end is unclear. There are many misconceived notions about typechecking, the ones I most commonly come across are these two.</p>\n\n<p><strong>Fallacy: Dynamic languages are less verbose.</strong> The misconception is that type information equals type annotation. This is totally untrue. We all know that type annotation is annoying. The machine should be able to figure that stuff out. And in fact, it does in modern compilers. Here is a statically typed QuickSort in two lines of Haskell (from <a href="http://haskell.org" rel="nofollow noreferrer">haskell.org</a>):</p>\n\n<pre><code>qsort []     = []\nqsort (x:xs) = qsort (filter (&lt; x) xs) ++ [x] ++ qsort (filter (&gt;= x) xs)\n</code></pre>\n\n<p>And here is a dynamically typed QuickSort in LISP (from <a href="http://swisspig.net/r/post/blog-200603301157" rel="nofollow noreferrer">swisspig.net</a>):</p>\n\n<pre><code>(defun quicksort (lis) (if (null lis) nil\n  (let* ((x (car lis)) (r (cdr lis)) (fn (lambda (a) (&lt; a x))))\n    (append (quicksort (remove-if-not fn r)) (list x)\n      (quicksort (remove-if fn r))))))\n</code></pre>\n\n<p>The Haskell example falsifies the hypothesis <em>statically typed, therefore verbose</em>. The LISP example falsifies the hypothesis <em>verbose, therefore statically typed</em>. There is no implication in either direction between typing and verbosity. You can safely put that out of your mind.</p>\n\n<p><strong>Fallacy: Statically typed languages have to be compiled, not interpreted.</strong> Again, not true. Many statically typed languages have interpreters. There\'s the Scala interpreter, The GHCi and Hugs interpreters for Haskell, and of course SQL has been both statically typed and interpreted for longer than I\'ve been alive.</p>\n\n<p>You know, maybe the dynamic crowd just wants freedom to not have to think as carefully about what they\'re doing. The software might not be correct or robust, but maybe it doesn\'t have to be.</p>\n\n<p>Personally, I think that those who would give up type safety to purchase a little temporary liberty, deserve neither liberty nor type safety.</p>\n'}, {'answer_id': 42961, 'author': 'yukondude', 'author_id': 726, 'author_profile': 'https://Stackoverflow.com/users/726', 'pm_score': 3, 'selected': False, 'text': "<p>My appreciation for dynamic languages is very much tied to how <strong>functional</strong> they are. Python's list comprehensions, Ruby's closures, and JavaScript's prototyped objects are all very appealing facets of those languages. All also feature first-class functions--something I can't see living without ever again.</p>\n\n<p>I wouldn't categorize PHP and VB (script) in the same way. To me, those are mostly imperative languages with all of the dynamic-typing drawbacks that you suggest.</p>\n\n<p>Sure, you don't get the same level of compile-time checks (since there ain't a compile time), but I would expect static syntax-checking tools to evolve over time to at least partially address that issue.</p>\n"}, {'answer_id': 42977, 'author': 'Kibbee', 'author_id': 1862, 'author_profile': 'https://Stackoverflow.com/users/1862', 'pm_score': 3, 'selected': False, 'text': '<p>One of the advantages pointed out for dynamic languages is to just be able to change the code and continue running. No need to recompile. In VS.Net 2008, when debugging, you can actually change the code, and continue running, without a recompile. With advances in compilers and IDEs, is it possible that this and other advantages of using dynamic languages will go away.</p>\n'}, {'answer_id': 42978, 'author': 'Shog9', 'author_id': 811, 'author_profile': 'https://Stackoverflow.com/users/811', 'pm_score': 4, 'selected': False, 'text': '<p>VBScript sucks, unless you\'re comparing it to another flavor of VB.\nPHP is ok, so long as you keep in mind that it\'s an overgrown templating language.\nModern Javascript is great. Really. Tons of fun. Just stay away from any scripts tagged "DHTML". </p>\n\n<p>I\'ve never used a language that didn\'t allow runtime errors. IMHO, that\'s largely a red-herring: compilers don\'t catch all typos, nor do they validate intent. Explicit typing is great when you need explicit types, but most of the time, you don\'t. Search for the questions here on <code>generics</code> or the one about whether or not using unsigned types was a good choice for index variables - much of the time, this stuff just gets in the way, and gives folks knobs to twiddle when they have time on their hands. </p>\n\n<p>But, i haven\'t really answered your question. Why are dynamic languages appealing? Because after a while, writing code gets dull and you just want to implement the algorithm. You\'ve already sat and worked it all out in pen, diagrammed potential problem scenarios and proved them solvable, and the only thing left to do is code up the twenty lines of implementation... and two hundred lines of boilerplate to make it compile. Then you realize that the type system you work with doesn\'t reflect what you\'re actually doing, but someone else\'s ultra-abstract idea of what you <em>might</em> be doing, and you\'ve long ago abandoned programming for a life of knicknack tweaking so obsessive-compulsive that it would shame even fictional detective Adrian Monk. </p>\n\n<p>That\'s when you <strike>go get plastered</strike> start looking seriously at dynamic languages.</p>\n'}, {'answer_id': 43043, 'author': 'Matthew Schinckel', 'author_id': 188, 'author_profile': 'https://Stackoverflow.com/users/188', 'pm_score': 3, 'selected': False, 'text': '<p>Personally, I think it\'s just that most of the "dynamic" languages you have used just happen to be poor examples of languages in general.</p>\n\n<p>I am <em>way</em> more productive in Python than in C or Java, and not just because you have to do the edit-compile-link-run dance.  I\'m getting more productive in Objective-C, but that\'s probably more due to the framework.</p>\n\n<p>Needless to say, I am more productive in any of these languages than PHP.  Hell, I\'d rather code in Scheme or Prolog than PHP.  (But lately I\'ve actually been doing more Prolog than anything else, so take that with a grain of salt!)</p>\n'}, {'answer_id': 43054, 'author': 'Peter Meyer', 'author_id': 1875, 'author_profile': 'https://Stackoverflow.com/users/1875', 'pm_score': 4, 'selected': False, 'text': "<p>I am a full-time .Net programmer fully entrenched in the throes of statically-typed C#.  However, I love modern JavaScript.  </p>\n\n<p>Generally speaking, I think dynamic languages allow you to express your <em>intent</em> more succinctly than statically typed languages as you spend less time and space defining what the building blocks are of what you are trying to express when in many cases they are self evident.  </p>\n\n<p>I think there are multiple classes of dynamic languages, too.  I have no desire to go back to writing classic ASP pages in VBScript.  To be useful, I think a dynamic language needs to support some sort of collection, list or associative construct at its core so that objects (or what pass for objects) can be expressed and allow you to build more complex constructs.  (Maybe we should all just code in LISP ... it's a joke ...)  </p>\n\n<p>I think in .Net circles, dynamic languages get a bad rap because they are associated with VBScript and/or JavaScript.  VBScript is just a recalled as a nightmare for many of the reasons Kibbee stated -- anybody remember enforcing type in VBScript using CLng to make sure you got enough bits for a 32-bit integer.  Also, I think JavaScript is still viewed as the browser language for drop-down menus that is written a different way for all browsers.  In that case, the issue is not language, but the various browser object models.  What's interesting is that the more C# matures, the more dynamic it starts to look.  I love Lambda expressions, anonymous objects and type inference.  It feels more like JavaScript everyday. </p>\n"}, {'answer_id': 43072, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 6, 'selected': False, 'text': "<p>Don't forget that you need to write 10x code coverage in unit tests to replace what your compiler does :D</p>\n\n<p>I've been there, done that with dynamic languages, and I see absolutely no advantage.</p>\n"}, {'answer_id': 43117, 'author': 'htanata', 'author_id': 4353, 'author_profile': 'https://Stackoverflow.com/users/4353', 'pm_score': 4, 'selected': False, 'text': "<p>For me, the advantage of dynamic languages is how much more <strong>readable</strong> the code becomes due to <strong>less code</strong> and functional techniques like Ruby's block and Python's list comprehension.</p>\n\n<p>But then I kind of miss the compile time checking (typo does happen) and IDE auto complete. Overall, the lesser amount of code and readability pays off for me.</p>\n\n<p>Another advantage is the usually <strong>interpreted/non compiled</strong> nature of the language. Change some code and see the result immediately. It's really a time saver during development.</p>\n\n<p>Last but not least, I like the fact that you can fire up a <strong>console</strong> and try out something you're not sure of, like a class or method that you've never used before and see how it behaves. There are many uses for the console and I'll just leave that for you to figure out.</p>\n"}, {'answer_id': 43129, 'author': 'UnkwnTech', 'author_id': 115, 'author_profile': 'https://Stackoverflow.com/users/115', 'pm_score': 3, 'selected': False, 'text': '<p>I think this kind of argument is a bit stupid: "Things that usually would have been caught by the compiler such as misspelled variable names and assigning an value of the wrong type to a variable don\'t occur until runtime" yes thats right as a PHP developer I don\'t see things like mistyped variables until runtime, BUT runtime is step 2 for me, in C++ (Which is the only compiled language I have any experience) it is step 3, after linking, and compiling.<br /><img src="https://imgs.xkcd.com/comics/compiling.png" alt="My Code Is Compiling">\n<br />Not to mention that it takes all of a few seconds after I hit save to when my code is ready to run, unlike in compiled languages where it can take literally hours.  I\'m sorry if this sounds a bit angry, but I\'m kind of tired of people treating me as a second rate programmer because I don\'t have to compile my code.</p>\n'}, {'answer_id': 43209, 'author': 'Chris Upchurch', 'author_id': 2600, 'author_profile': 'https://Stackoverflow.com/users/2600', 'pm_score': 4, 'selected': False, 'text': '<blockquote>\n<p>Here is a statically typed QuickSort in two lines of Haskell (from haskell.org):</p>\n<pre><code>qsort []     = []\nqsort (x:xs) = qsort (filter (&lt; x) xs) ++ [x] ++ qsort (filter (&gt;= x) xs)\n</code></pre>\n<p>And here is a dynamically typed QuickSort in LISP (from swisspig.net):</p>\n<pre><code>(defun quicksort (lis) (if (null lis) nil\n  (let* ((x (car lis)) (r (cdr lis)) (fn (lambda (a) (&lt; a x))))\n    (append (quicksort (remove-if-not fn r)) (list x)\n      (quicksort (remove-if fn r))))))\n</code></pre>\n</blockquote>\n<p>I think you\'re biasing things with your choice of language here.  Lisp is notoriously paren-heavy.  A closer equivelent to Haskell would be Python.</p>\n<pre><code>if len(L) &lt;= 1: return L\nreturn qsort([lt for lt in L[1:] if lt &lt; L[0]]) + [L[0]] + qsort([ge for ge in L[1:] if ge &gt;= L[0]])\n</code></pre>\n<p>Python code from <a href="http://code.activestate.com/recipes/66473/" rel="nofollow noreferrer">here</a></p>\n'}, {'answer_id': 181184, 'author': 'Andy Lester', 'author_id': 8454, 'author_profile': 'https://Stackoverflow.com/users/8454', 'pm_score': 0, 'selected': False, 'text': "<p>Because it's fun fun fun.  It's fun to not worry about memory allocation, for one.  It's fun not waiting for compilation.  etc etc etc</p>\n"}, {'answer_id': 583680, 'author': 'erikkallen', 'author_id': 47161, 'author_profile': 'https://Stackoverflow.com/users/47161', 'pm_score': 5, 'selected': False, 'text': '<p>When reading other people\'s responses, it seems that there are more or less three arguments for dynamic languages:</p>\n\n<p>1) The code is less verbose.\nI don\'t find this valid. Some dynamic languages are less verbose than some static ones. But F# is statically typed, but the static typing there does not add much, if any, code. It is implicitly typed, though, but that is a different thing.</p>\n\n<p>2) "My favorite dynamic language X has my favorite functional feature Y, so therefore dynamic is better". Don\'t mix up functional and dynamic (I can\'t understand why this has to be said).</p>\n\n<p>3) In dynamic languages you can see your results immediately. News: You can do that with C# in Visual Studio (since 2005) too. Just set a breakpoint, run the program in the debugger and modify the program while debbuging. I do this all the time and it works perfectly.</p>\n\n<p>Myself, I\'m a strong advocate for static typing, for one primary reason: maintainability. I have a system with a couple 10k lines of JavaScript in it, and <em>any</em> refactoring I want to do will take like half a day since the (non-existent) compiler will not tell me what that variable renaming messed up. And that\'s code I wrote myself, IMO well structured, too. I wouldn\'t want the task of being put in charge of an equivalent dynamic system that someone else wrote.</p>\n\n<p>I guess I will be massively downvoted for this, but I\'ll take the chance.</p>\n'}, {'answer_id': 751953, 'author': 'majkinetor', 'author_id': 82660, 'author_profile': 'https://Stackoverflow.com/users/82660', 'pm_score': 3, 'selected': False, 'text': '<p>Ah, I didn\'t see this topic when I posted <a href="https://stackoverflow.com/questions/751652/do-you-prefer-compiled-or-scripted-languages-closed">similar question</a></p>\n\n<p>Aside from good features the rest of the folks mentioned here about dynamic languages, I think everybody forget one, the most basic thing: metaprogramming. </p>\n\n<p>Programming the program.</p>\n\n<p>Its pretty hard to do in compiled languages, generally, take for example .Net. To make it work you have to make all kind of mambo jumbo and it usualy ends with code that runs around 100 times slower.</p>\n\n<p>Most dynamic languages have a way to do metaprogramming and that is something that keeps me there - ability to create any kind of code in memory and perfectly integrate it into my applicaiton.</p>\n\n<p>For instance to create calculator in Lua, all I have to do is:</p>\n\n<pre><code>print( loadstring( "return " .. io.read() )() )\n</code></pre>\n\n<p>Now, try to do that in .Net.</p>\n'}, {'answer_id': 751980, 'author': 'Jeff Kotula', 'author_id': 1382162, 'author_profile': 'https://Stackoverflow.com/users/1382162', 'pm_score': 1, 'selected': False, 'text': "<p>I think both styles have their strengths. This either/or thinking is kind of crippling to our community in my opinion. I've worked in architectures that were statically-typed from top to bottom and it was fine. My favorite architecture is for dynamically-typed at the UI level and statically-typed at the functional level. This also encourages a language barrier that enforces the separation of UI and function.</p>\n\n<p>To be a cynic, it may be simply that dynamic languages allow the developer to be lazier and to get things done knowing less about the fundamentals of computing. Whether this is a good or bad thing is up to the reader :)</p>\n"}, {'answer_id': 752117, 'author': 'bdwakefield', 'author_id': 55053, 'author_profile': 'https://Stackoverflow.com/users/55053', 'pm_score': 1, 'selected': False, 'text': "<p>FWIW, Compiling on most applications shouldn't take hours. I have worked with applications that are between 200-500k lines that take minutes to compile. Certainly not hours.</p>\n\n<p>I prefer compiled languages myself. I feel as though the debugging tools (in my experience, which might not be true for everything) are better and the IDE tools are better.</p>\n\n<p>I like being able to attach my Visual Studio to a running process. Can other IDEs do that? Maybe, but I don't know about them. I have been doing some PHP development work lately and to be honest it isn't all that bad. However, I much prefer C# and the VS IDE. I feel like I work faster and debug problems faster.</p>\n\n<p>So maybe it is more a toolset thing for me than the dynamic/static language issue?</p>\n\n<p>One last comment... if you are developing with a local server saving is faster than compiling, but often times I don't have access to everything on my local machine. Databases and fileshares live elsewhere. It is easier to FTP to the web server and then run my PHP code only to find the error and have to fix and re-ftp.</p>\n"}, {'answer_id': 1221906, 'author': 'Stephan Eggermont', 'author_id': 35306, 'author_profile': 'https://Stackoverflow.com/users/35306', 'pm_score': 1, 'selected': False, 'text': '<p>Productivity in a certain context. But that is just one environment I know, compared to some others I know or have seen used.</p>\n\n<p>Smalltalk on Squeak/Pharo with Seaside is a much more effective and efficient web platform than ASP.Net(/MVC), RoR or Wicket, for complex applications. Until you need to interface with something that has libraries in one of those but not smalltalk.</p>\n\n<p>Misspelled variable names are red in the IDE, IntelliSense works but is not as specific. Run-time errors on webpages are not an issue but a feature, one click to bring up the debugger, one click to my IDE, fix the bug in the debugger, save, continue. For simple bugs, the round-trip time for this cycle is less than 20 seconds.</p>\n'}, {'answer_id': 1227903, 'author': 'RHSeeger', 'author_id': 26816, 'author_profile': 'https://Stackoverflow.com/users/26816', 'pm_score': 1, 'selected': False, 'text': '<p>Dynamic Languages Strike Back</p>\n\n<p><a href="http://www.youtube.com/watch?v=tz-Bb-D6teE" rel="nofollow noreferrer">http://www.youtube.com/watch?v=tz-Bb-D6teE</a></p>\n\n<p>A talk discussing Dynamic Languages, what some of the positives are, and how many of the negatives aren\'t really true.</p>\n'}, {'answer_id': 1228267, 'author': 'Paul Nathan', 'author_id': 26227, 'author_profile': 'https://Stackoverflow.com/users/26227', 'pm_score': 0, 'selected': False, 'text': '<p>Weakly typed languages allow flexibility in how you manage your data.</p>\n\n<p>I used VHDL last spring for several classes, and I like their method of representing bits/bytes, and how the compiler catches errors if you try to assign a 6-bit bus to a 9-bit bus. I tried to recreate it in C++, and I\'m having a fair struggle to neatly get the typing to work smoothly with existing types. Steve Yegge does a very nice job of describing the issues involved with strong type systems, I think.</p>\n\n<p>Regarding verbosity: I find Java and C# to be quite verbose in the large(let\'s not cherry-pick small algorithms to "prove" a point). And, yes, I\'ve written in both. C++ struggles in the same area as well; VHDL succumbs here. </p>\n\n<p>Parsimony appears to be a virtue of the dynamic languages in general(I present Perl and F# as examples). </p>\n'}, {'answer_id': 1228619, 'author': 'airportyh', 'author_id': 5304, 'author_profile': 'https://Stackoverflow.com/users/5304', 'pm_score': 3, 'selected': False, 'text': '<p>I believe that the "new found love" for dynamically-typed languages have less to do with whether statically-typed languages are better or worst - in the absolute sense - than the rise in popularity of <em>certain</em> dynamic languages. Ruby on Rails was obviously a big phenomenon that cause the resurgence of dynamic languages. The thing that made rails so popular and created so many converts from the static camp was mainly: <em>very</em> terse and DRY code and configuration. This is especially true when compared to Java web frameworks which required mountains of XML configuration. Many Java programmers - smart ones too - converted over, and some even evangelized ruby and other dynamic languages. For me, three distinct features allow dynamic languages like Ruby or Python to be more terse:</p>\n\n<ol>\n<li>Minimalist syntax - the big one is that type annotations are not required, but also the the language designer designed the language from the start to be terse</li>\n<li>inline function syntax(or the lambda) - the ability to write inline functions and pass them around as variables makes many kinds of code more brief. In particular this is true for list/array operations. The roots of this ideas was obviously - LISP.</li>\n<li>Metaprogramming - metaprogramming is a big part of what makes rails tick. It gave rise to a new way of refactoring code that allowed the client code of your library to be much more succinct. This also originate from LISP.</li>\n</ol>\n\n<p>All three of these features are not exclusive to dynamic languages, but they certainly are not present in the popular static languages of today: Java and C#. You might argue C# has #2 in delegates, but I would argue that it\'s not widely used at all - such as with list operations.</p>\n\n<p>As for more advanced static languages... Haskell is a wonderful language, it has #1 and #2, and although it doesn\'t have #3, it\'s type system is so flexible that you will probably not find the lack of meta to be limiting. I believe you can do metaprogramming in OCaml at compile time with a language extension. Scala is a very recent addition and is very promising. F# for the .NET camp. But, users of these languages are in the minority, and so they didn\'t really contribute to this change in the programming languages landscape. In fact, I very much believe the popularity of Ruby affected the popularity of languages like Haskell, OCaml, Scala, and F# in a positive way, in addition to the other dynamic languages.</p>\n'}, {'answer_id': 1229675, 'author': 'RHSeeger', 'author_id': 26816, 'author_profile': 'https://Stackoverflow.com/users/26816', 'pm_score': 3, 'selected': False, 'text': '<p>My main reason for liking dynamic (typed, since that seems to be the focus of the thread) languages is that the ones I\'ve used (in a work environment) are far superior to the non-dynamic languages I\'ve used. C, C++, Java, etc... they\'re all horrible languages for getting actual work done in. I\'d love to see an implicitly typed language that\'s as natural to program in as many of the dynamically typed ones.</p>\n\n<p>That being said, there\'s certain constructs that are just amazing in dynamically typed languages. For example, in Tcl</p>\n\n<pre><code> lindex $mylist end-2\n</code></pre>\n\n<p>The fact that you pass in "end-2" to indicate the index you want is incredibly concise and obvious to the reader. I have yet to see a statically typed language that accomplishes such.</p>\n'}, {'answer_id': 1628579, 'author': 'RCIX', 'author_id': 117069, 'author_profile': 'https://Stackoverflow.com/users/117069', 'pm_score': 1, 'selected': False, 'text': '<p>Put yourself in the place of a brand new programmer selecting a language to start out with, who doesn\'t care about dynamic versus staic versus lambdas versus this versus that etc.; which language would YOU choose?</p>\n\n<p>C#</p>\n\n<pre><code>using System;\nclass MyProgram\n{\n    public static void Main(string[] args)\n    {\n        foreach (string s in args)\n        {\n            Console.WriteLine(s);\n        }\n    }\n}\n</code></pre>\n\n<p>Lua:</p>\n\n<pre><code>function printStuff(args)\n    for key,value in pairs(args) do\n       print value .. " "\n    end\nend\nstrings = {\n    "hello",\n    "world",\n    "from lua"\n}\nprintStuff(strings)\n</code></pre>\n'}, {'answer_id': 1628890, 'author': 'umar', 'author_id': 58948, 'author_profile': 'https://Stackoverflow.com/users/58948', 'pm_score': 2, 'selected': False, 'text': '<p>I think that we need the different types of languages depending on what we are trying to achieve, or solve with them. If we want an application that creates, retrieves, updates and deletes records from the database over the internet, we are better off doing it with one line of ROR code (using the scaffold) than writing it from scratch in  a statically typed language. Using dynamic languages frees up the minds from wondering about </p>\n\n<ul>\n<li>which variable has which type</li>\n<li>how to grow a string dynamically as needs be</li>\n<li>how to write code so that if i change type of one variable, i dont have to rewrite all the function that interact with it</li>\n</ul>\n\n<p>to problems that are closer to business needs like </p>\n\n<ul>\n<li>data is saving/updating etc in the database, how do i use it to drive traffic to my site</li>\n</ul>\n\n<p>Anyway, one advantage of loosely typed languages is that we dont really care what type it is, if it behaves like what it is supposed to. That is the reason we have duck-typing in dynamically typed languages. it is a great feature and i can use the same variable names to store different types of data as the need arises. also, statically typed languages force you to think like a machine (how does the compiler interact with your code, etc etc) whereas dynamically typed languages, especially ruby/ror, force the machine to think like a human. </p>\n\n<p>These are some of the arguments i use to justify my job and experience in dynamic languages!</p>\n'}, {'answer_id': 1628939, 'author': 'Stefano Borini', 'author_id': 78374, 'author_profile': 'https://Stackoverflow.com/users/78374', 'pm_score': 1, 'selected': False, 'text': "<p>Because I consider stupid having to declare the type of the box. \nThe type stays with the entity, not with the container. Static typing had a sense when the type of the box had a direct consequence on how the bits in memory were interpreted. </p>\n\n<p>If you take a look at the design patterns in the GoF, you will realize that a good part of them are there just to fight with the static nature of the language, and they have no reason whatsoever to exist in a dynamic language.</p>\n\n<p>Also, I'm tired of having to write stuff like MyFancyObjectInterface f = new MyFancyObject(). DRY principle anyone ?</p>\n"}, {'answer_id': 1629064, 'author': 'hasen', 'author_id': 35364, 'author_profile': 'https://Stackoverflow.com/users/35364', 'pm_score': 0, 'selected': False, 'text': '<p>Theoretically it\'s possible for a statically typed languages to have the benefits of dynamic languages, and theoretically it\'s also possible for dynamic languages to suck and cause more headache than pleasure.</p>\n\n<p>However, in practice, dynamic languages allow you to write code quickly, without too much boilerplate, without worrying about low level details.</p>\n\n<p>Yes, in theory a c-style language can provide similar features (D tries, with <code>auto</code> type discovery and <code>dmdr</code> which compiles modules and runs them on the fly as if they were scripts), </p>\n\n<p>So yes, the naysayers are right, in that being dynamic doesn\'t <em>necessarily</em> mean easier/cleaner code.</p>\n\n<p><em>but</em>, in practice, <code>Python &gt; Java</code></p>\n\n<p>Try <code>w = "my string here".split()[1]</code> in C, or even Java.</p>\n'}, {'answer_id': 1629119, 'author': 'Oz.', 'author_id': 321937, 'author_profile': 'https://Stackoverflow.com/users/321937', 'pm_score': 0, 'selected': False, 'text': "<p>To me it is a matter of situation. I spend a lot of time writing Perl code for websites and C++ for graphics engines. Two completely different realms of programming with two very different languages.</p>\n\n<p>Dynamic languages, for me anyways, are faster to work out as I spend less time making sure the framework is in place and more on the actual problem at hand.</p>\n\n<p>However static languages offer more fine-tuned control which can be necessary in some application such as real-time graphics rendering. I can do things in C++ that run far more efficiently and faster than what I would write for Perl, but for the size of most Perl scripts the loss in efficiency is negligible.</p>\n\n<p>In the end it really comes down to the problem statement and what your target goals are. If you have a lot of simple things to do where speed and memory efficiency aren't a big deal, use a dynamic language. If you have a megalithic project that needs to squeeze every last cycle out of your system, go static.</p>\n"}, {'answer_id': 1656970, 'author': 'dlamblin', 'author_id': 459, 'author_profile': 'https://Stackoverflow.com/users/459', 'pm_score': 1, 'selected': False, 'text': "<p>This all comes down to partially what's appropriate for the particular goals and what's a common personal preference.  (E.G. Is this going to be a huge code base maintained by more people than can conduct a reasonable meeting together? You want type checking.)</p>\n\n<p>The personal part is about trading off some checks and other steps for development and testing speed (while likely giving up some cpu performance).  There's some people for which this is liberating and a performance boost, and there's some for which this is quite the opposite, and yes it does sort of depend on the particular flavor of your language too. I mean no one here is saying Java rocks for speedy, terse development, or that PHP is a solid language where you'll rarely make a hard to spot typo.</p>\n"}, {'answer_id': 1658890, 'author': 'Daniel Paull', 'author_id': 43066, 'author_profile': 'https://Stackoverflow.com/users/43066', 'pm_score': 1, 'selected': False, 'text': '<p>I have love for both static and dynamic languages.  Every project that I\'ve been involved in since about 2002 has been a C/C++ application with an embedded Python interpret.  This gives me the best of both worlds:</p>\n\n<ol>\n<li>The components and frameworks that make up the application are, for a given release of an application, immutable.  They must also be very stable, and hence, well tested.  A Statically typed language is the right choice for building these parts.</li>\n<li>The wiring up of components, loading of component DLLs, artwork, most of the GUI, etc... can vary greatly (say, to customise the application for a client) with no need to change any framework or components code.  A dynamic language is perfect for this.</li>\n</ol>\n\n<p>I find that the mix of a statically typed language to build the system and a dynamically type language to configure it gives me flexibility, stability and productivity.</p>\n\n<p>To answer the question of "What\'s with the love of dynamic languages?"  For me it\'s the ability to completely re-wire a system at runtime in any way imaginable.  I see the scripting language as "running the show", therefore the executing application may do anything you desire.</p>\n'}, {'answer_id': 2211451, 'author': 'Bob', 'author_id': 259579, 'author_profile': 'https://Stackoverflow.com/users/259579', 'pm_score': 1, 'selected': False, 'text': '<p>I don\'t have much experience with dynamic languages in general, but the one dynamic language I do know, JavaScript(aka ECMAScript), I absolutely love.</p>\n\n<p>Well, wait, what\'s the discussion here? Dynamic compilation? Or dynamic typing? JavaScript covers both bases so I guess I\'ll talk about both:</p>\n\n<p><strong>Dynamic compilation</strong>:</p>\n\n<p>To begin, dynamic languages <em>are</em> compiled, the compilation is simply put off until later. And Java and .NET really are compiled twice. Once to their respective intermediate languages, and again, dynamically, to machine code.</p>\n\n<p>But when compilation is put off you can see results faster. That\'s one advantage. I do enjoy simply saving the file and seeing my program in action fairly quick.</p>\n\n<p>Another advantage is that you can write and compile code <em>at runtime</em>. Whether this is possible in statically compiled code, I don\'t know. I imagine it must be, since whatever compiles JavaScript is ultimately machine code and statically compiled. But in a dynamic language this is a trivial thing to do. Code can write and run itself. (And I\'m pretty sure .NET can do this, but the CIL that .NET compiles to is dynamically compiled on the fly anyways, and it\'s not so trivial in C#)</p>\n\n<p><strong>Dynamic typing</strong>:</p>\n\n<p>I think dynamic typing is more expressive than static typing. Note that I\'m using the term expressive informally to say that dynamic typing can say more with less. Here\'s some JavaScript code:</p>\n\n<p><code>var Person = {};</code></p>\n\n<p>Do you know what Person is now? It\'s a generic dictionary. I can do this:</p>\n\n<pre>Person["First_Name"] = "John";\nPerson["Last_Name"] = "Smith";</pre>\n\n<p>But it\'s also an object. I could refer to any of those "keys" like this:</p>\n\n<pre>Person.First_Name</pre>\n\n<p>And add any methods I deem necessary:</p>\n\n<pre>Person.changeFirstName = function(newName) {\n  this.First_Name = newName;\n};</pre>\n\n<p>Sure, there might be problems if newName isn\'t a string. It won\'t be caught right away, if ever, but you can check yourself. It\'s a matter of trading expressive power and flexibility for safety. I don\'t mind adding code to check types, etc, myself, and I\'ve yet to run into a type bug that gave me much grief (and I know that isn\'t saying much. It could be a matter of time :) ). I very much enjoy, however, that ability to adapt on the fly.</p>\n'}, {'answer_id': 2912815, 'author': 'Agnel Kurian', 'author_id': 45603, 'author_profile': 'https://Stackoverflow.com/users/45603', 'pm_score': 1, 'selected': False, 'text': '<p>Nice blog post on the same topic: <a href="http://tinyurl.com/5mulds" rel="nofollow noreferrer">Python Makes Me Nervous</a></p>\n\n<blockquote>\n  <p>Method signatures are virtually\n  useless in Python.  In Java, static\n  typing makes the method signature into\n  a recipe: it\'s all the shit you need\n  to make this method work. Not so in\n  Python.  Here, a method signature will\n  only tell you one thing: how many\n  arguments you need to make it work. \n  Sometimes, it won\'t even do that, if\n  you start fucking around with\n  **kwargs.</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/42934', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1862/']