4 ms·
First, this is an excellent comment and should have a much higher score than my fanboyish original :-) I agree that Scala is restricted by the JVM (and the aim
by strlen 17y ago
First, this is an excellent comment and should have a much higher score than my fanboyish original :-)
I agree that Scala is restricted by the JVM (and the aim of full compatibility with Java) and as a result type inference, pattern matching and more suffer heavily. F#, OCaml and Haskell are better examples of modern type systems as they're less encumbered. I am fairly curious about how F# works around the CLR (or rather, how much CLR accommodates type systems different from C#'s), guess it's up to me to RTFM.
> It's as if people are so tired of Java that they are looking for a way out, willing to compromise just for some syntactic sugar.
I think this hits the nail on the head, but I don't see it as a bad thing. If there's a very strong reason to be on the JVM (e.g., other projects or libraries, operations preferences), it's nice to have an option that lets one have a more productive and enjoyable experience.
There are times where it feels like a big compiler hack (which it is), but first class functions (even if they're compiled down to anonymous classes), closures, optional lazy evaluation, type inference, limited pattern matching, case classes, traits/mixins, "encouraged" immutability, the collections, etc... add-up.
There are occasionally bugs and performance issues with compiler and the collections library, but overall I don't see what's compromised compared to programming in Java itself. I'd argue syntactic sugar classification applies more to Java 7's planned closures and first class methods.
> OOP was designed for dynamic type-systems
Yes, that's literally true. OOP feels natural in dynamically typed languages, even when it's bolted on (CLOS in Common Lisp, Perl 5).
It's still a mystery to me why Java "won over", given that Smalltalk had (at the time) better performing virtual machines (compared to older JVMs which were superceeded by HotSpot, which was originally used by Strongtalk) and great tooling. There are known examples of teams of inexperienced programmers working under guidance to produce large, well working projects in Smalltalk.
> That's why I hope people will invest in VMs that support dynamic languages in the future ... static typing is a bitch to get right, and it would be easier if the VM wouldn't impose a strict type-system on you.
Clojure, in my view, suffers the most from the type system that the JVM imposes. It would be interesting to see if Clojure and Scala would eventually target less restrictive VMs (reverting to compiler hacks on the JVM to functionally emulate these VMs).
- WildUtah 17y agoIt's still a mystery to me why Java "won over", given that Smalltalk had (at the time) better performing virtual machines (compared to older JVMs which were superceeded by HotSpot, which was originally used by Strongtalk) and great tooling. It's very simple. Smalltalk was expensive. Students, hobbyists, people working at cheap corporations, startups, open source projects, and the like couldn't write, share, and distribute working systems on it. I understand there were some good vendors with steep student discounts and the like. My roommate loved some of them. But he could not hack with friends for free (or even very cheap) on it. And that little bit of money makes all the difference. Not that it would have taken off otherwise; there are many factors, but no language or VM that charges for access has taken off in a generation except where access to hardware is strictly limited by law (smartphones) or expense (FPGA, large scale microcontroller projects).
- stcredzero 17y agoIt's very simple. Smalltalk was expensive. Students, hobbyists, people working at cheap corporations, startups, open source projects, and the like couldn't write, share, and distribute working systems on it. In fact, it was the deliberate strategy to become a "boutique" language, a secret weapon of the Fortune 500. The Smalltalk companies missed out on "The Bazaar" and the mindshare benefits of an open community.