4 ms·
I'll totally jump back on to the Scala bandwagon once it breaks free of the JVM. I'd love for Clojure to make the same jump to LLVM however it relies far more
by rickmode 15y ago
I'll totally jump back on to the Scala bandwagon once it breaks free of the JVM.
I'd love for Clojure to make the same jump to LLVM however it relies far more on the host platform's libraries (the Java/C# libraries).
- jherdman 15y agoI'm actually a little confused by this. Isn't one of the major benefits of Scala, Clojure, JRuby, et al, that it is hosted on the JVM?
- wbhart 15y agoYes, it is. And I suspect the Scala people aren't advocating that it move away from the JVM. However, I can definitely say, should a Scala on LLVM become available with trivial FFI with native code and close to compiled C performance even for the Scala interpreter (this is definitely possible), I would heartily switch to Scala from C. I absolutely love the idea of Scala on the LLVM back end. That opens up a whole new world to me which currently doesn't exist. I've recently been trying to design my own language on the LLVM Jit. So far, many of the design decisions I am making are very similar to, or the same as Scala, even though I am familiar with many different languages. What's missing from Scala for me personally, is precisely what is proposed in this paper.
- runT1ME 15y agoFunctional and hybrid functional languages benefit greatly from a highly tuned GC. I don't see LLVM supporting something on par with the JVM's collector anytime soon so I think you'll lose a lot of the speed you see with Scala on the JVM unfortunately.
- aphexairlines 15y agoThe flip side is that the Scala developers can provide a GC tuned to Scala's use case, rather than the JVM's focus on Java's use case.
- cageface 15y agoAbsolutely. And a lot of Scala's warts come from its transparent Java compatibility. As much as I like Scala, if I'm going to throw out the one thing that makes it more practically useful than any other functional language I might as well just use a cleaner and more elegant language like Haskell in the first place.
- wbhart 15y agoHaskell has some great features, such as type classes (the power of these has not been fully realised). In other cases I have mixed feelings. The monad business is sometimes absolutely brilliant (Parsec is a good example) and at other times tremendously painful (dealing with simple IO). Other features are just a pain in the neck. Very strict type checking means that using types that depend on parameters that are integers (e.g. m x n matrices) can be a real bugbear. It's apparently possible, but requires some deep magic and incantations (which I don't know). As much as I personally love Haskell, with its elegant syntax which makes better use of white space than just about any other language, it is really sometimes a head screw to get your mind around its more intricate features. As a result, people in my field (mathematics, specifically number theory) by and large won't touch it. Scala on the other hand is familiar, at its core. Anyone who has used a Computer Algebra System and done some basic programming with it can get somewhere with Scala. It makes a handful of pragmatic choices whilst retaining the theoretical soundness of the language. It also offers many advanced features which you don't know you need until you've been programming for a few years. What has been lacking, however, is an efficient and simple way to interface with the many high quality and high performance native mathematical libraries that are out there. Python has filled this void. But it's terribly slow for computationally intensive stuff. Its interface with C is dreadful, leading to solutions like Cython, where you lose the interactivity of the Python interpreter. And everything is left to runtime in Python, so there's no theoretical soundness. And from a theoretical point of view, Python makes easy things trivial and hard things really hard. It's an extremely elegant language which looks a lot like the mythical mathematical pseudo-code language. But beyond a certain level of complexity, you very quickly get into hot water. Aldor had a lot of things right. But no one will use it because of its not quite open license. So there's just a massive void there which is neatly filled by a Scala on LLVM. It cannot come soon enough for me. Having said all that, I did once believe that Haskell was by far the best language. It's the only language I ever used where I thought, "oh, finally I am using a grown-ups' language rather than a toy". That was quite an epiphany. But it was followed by the dismal realisation that absolutely no one cared that it was so great and that this was because some of the things that are so natural in an imperative style become a lot like solving a very difficult problem in Haskell, unless someone already solved it for you.