6 ms·
The trend of programming languages is to move toward static typing. Not as an afterthought, with gradual typing or retrofitted years later into an unwilling com
by hota_mazi 8y ago
The trend of programming languages is to move toward static typing. Not as an afterthought, with gradual typing or retrofitted years later into an unwilling compiler, but languages designed from day one with static typing, parametric polymorphism, and type inference.
Clojure's life time was limited from day one because it's simply going against the trend.
- michaelmrose 8y agoBecause python or Javascript aren't a thing?
- purple_ducks 8y agoGiven the huge uptake on Typescript, I don't think using JS as an example makes sense. Static typing helps. It doesn't have to be Java-esque. F# & friends have really nice static type systems where you don't need to declare types for most things - they're automatically inferred.
- michaelmrose 8y agoSeems like javascript is destined to be here for the long haul despite the presence of typescript. In fact static type proponents have been predicting the death of dynamic type languages since this gulf became apparent. Thus far reports of one camps deaths have been greatly exaggerated by the other.
- munificent 8y agoNo one is arguing that dynamically typed languages are all going to die out (though CoffeeScript and Perl certainly aren't doing well). Languages almost never die. People are still writing COBOL. But the relative share of programmers writing code in statically typed languages appears to be increasing. When the web got big, there was a very rapid growth in dynamically typed scripting languages: Perl, Python, Ruby, etc. Then, when client side web development became a thing, JS got huge and then CoffeeScript. In the past decade or so as developers have moved to writing larger more performance-intensive client-side applications (read: mobile with touch UIs running at 60 FPS), there is now a turn back towards static typing: TypeScript, Kotlin, Swift, etc. Also, the sophistication of static type systems is increasing. Generics are now a given, control over variance is increasingly common, as is static control over null references. This doesn't mean the graph will go towards static types forever, but it certainly appears to be right now.
- puredanger 8y agoPendulums swing....
- hota_mazi 8y agoThat's a false analogy. CD's are not going to become popular again to listen to music because "pendulums swing". When a trend is clearly going toward increased comfort or clear progress, there is only one direction that the trend is going. I argue that statically typed languages are headed in that direction and that in ten, twenty years from now, dynamically typed languages will be looked at as "something that seemed like a good idea at the time".
- puredanger 8y ago"Increased comfort" and "clear progress" are subjective measures about which people may disagree (to whit, I disagree). I argue that in ten or twenty years from now, we will have great tools in dynamic languages to express constraints when needed, without requiring proofs. These are opinions, not facts.
- purple_ducks 8y agoIs there anything to capture (dev-)runtime data & generate specs from that as a starting point?
- puredanger 8y agohttps://github.com/stathissideris/spec-provider https://github.com/stathissideris/spec-provider
- purple_ducks 8y agosuper. thanks
- michaelmrose 8y ago
- hota_mazi 8y agoThis is a similar straw man to someone claiming the trend of cars is clearly going electric and you saying "I doubt it, look at all these gas propelled cars we have today". Python and Javascript are going to be around for a while, sure, but 1) they are also moving toward static type safety and 2) fewer and fewer projects will be started in these languages because statically typed alternatives are a better choice across the board.
- michaelmrose 8y agoDefine strawman: "an intentionally misrepresented proposition that is set up because it is easier to defeat than an opponent's real argument." The parent poster stated that clojures days were numbered because in his opinion statically typed languages were becoming increasingly popular and Clojure didn't follow this trend. I specifically mentioned JavaScript and python because people have been extolling the virtues of static typing literally before either shipped, while both rose to prominence, and became wildly popular. I'm arguing that neither posters personal preference nor even a correctly assessed trend in computer language design is by itself a useful tool to predict the future success of a given language. This especially rings false when the same prediction is made several decades in a row. I wont even address your analogy because analogies are like buttholes. Everyone has one and yours stink.
- munificent 8y agoThe largest recent change in Python is adding support for type annotations [1]. TypeScript is now the #7 language on GitHub. Matz has said that a major goal of Ruby 3.0 is optional static types [3]. Facebook has reportedly ported large amounts of their PHP code to Hack, which adds static types to PHP. [1]: https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html [2]: https://octoverse.github.com/projects#languages https://octoverse.github.com/projects#languages [3]: https://blog.heroku.com/ruby-3-by-3 https://blog.heroku.com/ruby-3-by-3
- michaelmrose 8y agoThe poster above mine said that languages that didn't ship out of the box with mandatory typing had a limited lifespan. Indeed grafting types onto python, ruby, and even php seems more likely than people stopping using.
- insulanian 8y agoThis 100x! I don't understand how people can work on a complex codebase without a strong static type system. I've tried it once, and still remember the lack of confidence after every non-trivial refactoring.
- puredanger 8y agoI've worked on multiple large Java codebases, and on semi-large Clojure code bases. The Java ones compiled great but were full of bugs obscured by 100s of useless classes with bespoke interfaces. I found the Clojure code bases to be far more tractable because the language leads to better opportunities for abstraction and more concise code with way less incidental complexity. I think spec can add another layer of description where it's useful (and is not required where it's not).
- hota_mazi 8y agoThat's anecdotal, and probably more a consequence of the seniority of the engineers who wrote these two code bases than the nature of the type systems. My point about static type systems is broader and actually backed by science and mathematics. And also, just observing the trend and seeing where the wind blows.
- puredanger 8y agoOh, do tell? Please point me at the scientific and mathematical evidence. I would be interested to see it.
- Roboprog 8y agoIndeed. I’ve googled for this research, and there isn’t much of it - just something that “everybody knows”. The best, recent thing I found was a study done about 5 years ago or so (I think) by a fellow at UC Davis, and the data were pretty weak. Functional programming, and the requisite memory management, had at least as big an effect as static typing. At this point some Haskell snob steps in and say “sound typing”... :-) http://web.cs.ucdavis.edu/~filkov/papers/lang_github.pdf http://web.cs.ucdavis.edu/~filkov/papers/lang_github.pdf
- iLemming 8y ago> Clojure's life time was limited from day one Clojure is a Lisp. When the evidence and pragmatism of static type systems become scientifically proven facts I'm sure someone will figure out a way to extend the language without turning it into a disaster. Right now Clojure makes sense and it is way more productive to use it than any statically typed language.