Earlier quoted context omitted.
There is one other undeniable advantage to dynamic languages: you can express things in a dynamic language that you can't in a static one. Static languages try to be as sound as possible, at the cost of some completeness. Dynamic languages are less concerned with soundness and can be more complete. As an example, duck typing is usually not possible to achieve in a static language - it's really hard to allow duck typi…
OCaml has duck typing for objects (strictly speaking it is "structural typing").
Have Static Languages Won?
51–60 of 120 posts
Re: Have Static Languages Won?
#52Which static language should supposedly have won?
> Which static language should supposedly have won? It's absolutely not that specific static languages have "won". But rather that the latest crop of static languages have proved that the oft-cited downsides of static typing, e.g. type stuttering in declarations, can be pragmatically addressed by other means, e.g. type inference. As such, the cost differential of static languages over dynamic is reduced to near-zero,…
Re: Have Static Languages Won?
#53I hoped to have debunked, though not thoroughly, the myth that dynamic languages cannot scale to power large projects in my recent talk at Pycon CA. Just take a look at Openstack. It's powering clouds in CERN and Yahoo! Japan where it provides the infrastructure for delivering earthquake notifications to the public -- a valuable and critical service! And it's written largely in Python. It does rely on systems written…
> I hoped to have debunked, though not thoroughly, the myth that dynamic languages cannot scale to power large projects in my recent talk at Pycon CA. Just take a look at Openstack. It's powering clouds in CERN and Yahoo! Japan where it provides the infrastructure for delivering earthquake notifications to the public -- a valuable and critical service! And it's written largely in Python. That doesn't say much in itse…
In total Openstack encompasses around +4M SLOC written in Python. How much is deployed in a given cloud depends on the configuration. However the community must still shepherd and manage all of that code and make regular, stable releases on a six-month cadence.
It's not "just" glue code.
> As you say "It does rely on systems written in static languages and is itself written in one" which kind of refutes the whole argument, doesn't it?
Not necessarily. Awk was necessarily written because querying unstructured input is a huge pain in plain C. Kernighan gave a recent example of this in one of his recent talks on programming language design.
The caveat is there is a limit at which adding more lines to an awk program becomes counter-productive. It's essentially a good DSL but a terrible language. I think Python defies that -- with the millions of lines of code managed by the community of thousands of developers a large system written in a dynamic language isn't impossible or necessarily hindered by its lack of static type analysis.
> For those cases couldn't one just use a DSL or at worse an sandboxed isolated dynamic language from inside a STL talking care for the rest of the system?
In some sense this is how I view Python and languages of its kind... but I think in practice it's more of a philosophical viewpoint. In practice dynamic languages are general purpose and much suited to certain kinds of programming that static languages are not.
Common Lisp and Smalltalk are great examples of dynamic languages kicking butt. Starting in the debugger and developing self-introspecting systems has a peculiar effect on the programmer. One tends to develop a domain language for solving a class of problems in order to make them tractable. One thing I dislike however is how divorced it can be from the machine. Some Common Lisp compilers can produce really awesome code but it does take a little more burden from the programmer to gain such efficiency from the compiler (compared to the tactical omissions of defined behavior from languages like C which allow almost trivial optimizations... with the trade off that certain errors are quite likely on my part if I'm not careful).
I think there is room for both in the world. I really enjoy OCaml, C, Python, and Common Lisp... and I would seriously consider the problem before the language. Our job after all is to transform data and not spend time writing pretty, elegant, or clever code for the code's sake.
update: grammar.
Re: Have Static Languages Won?
#54Earlier quoted context omitted.
> Just because you don't have to explicitly write out the type does not make it any less static. No, but not having to write the type was one of the biggest attractions of dynamic languages -- a lot of us didn't care that much for being fully dynamic, but just enjoyed the less ceremony of dynamic languages. As for not having to commit to types for some cases, STL languages can also have a "void *" or "variant" or "dy…
There is one other undeniable advantage to dynamic languages: you can express things in a dynamic language that you can't in a static one. Static languages try to be as sound as possible, at the cost of some completeness. Dynamic languages are less concerned with soundness and can be more complete. As an example, duck typing is usually not possible to achieve in a static language - it's really hard to allow duck typi…
I do believe there are cases where dynamic typing is genuinely useful, but those make up a very small portion of real-world problems.
Re: Have Static Languages Won?
#55I hoped to have debunked, though not thoroughly, the myth that dynamic languages cannot scale to power large projects in my recent talk at Pycon CA. Just take a look at Openstack. It's powering clouds in CERN and Yahoo! Japan where it provides the infrastructure for delivering earthquake notifications to the public -- a valuable and critical service! And it's written largely in Python. It does rely on systems written…
OpenStack is the perfect example of how Python doesn't work well for larger projects. It's only because of an absolutely massive investment in testing that OpenStack works at all. I think it's more accurate to say that OpenStack works despite an unsuitable choice for implementation language.
Re: Have Static Languages Won?
#56Personally I developed most of my web apps in C# but I find Python great for prototyping and data analysis tasks. Why is there a need to declare a winner?
Re: Have Static Languages Won?
#57In academia and corporate? Sure. In real world? Php, Python, Ruby and Javascript still reign supreme. Mobile is another story since main platforms are controlled by corporations, but if it were for the hobbyists neither java nor swift would have had a chance.
In what sense are academia and corporate not "the real world"?
Re: Have Static Languages Won?
#58This post and the one that prompted it both seem to be begging the question. I don't see greater percentage use of static vs. dynamic languages now compared to ten or twenty years ago. There is a lot of interesting research into strong static type systems but that has been going on for ages (ML family of languages). In fact, I'd say if anything there is a big surge every decade or so in dynamic languages when a new p…
Ada users are paranoid and Java users are concerned about project cost.
Re: Have Static Languages Won?
#59I believe the biggest advantage with a good static type system is that programmers can design good datatypes and specify their relationships - and the compiler can then detect any inconsistencies(ideally anyway).
Re: Have Static Languages Won?
#60Availability of an interpreter has been one of the major advantages of programming in dynamic languages. With languages like Haskell, Scala coming with first class interpreters, this advantage is being lost to a certain extent. I think it should be possible to build interpreters even for mainstream static langs like C++ and Java, they probably exist already, though I'm not sure why they haven't found larger acceptanc…
I do use a interpreter with both scala and python a lot.