Erlang Doesn’t Fit The JVM
weblog.hypotheticalabs.com
Erlang Doesn’t Fit The JVM
1–10 of 51 posts
Re: Erlang Doesn’t Fit The JVM
#2Re: Erlang Doesn’t Fit The JVM
#3However, the JVM is less suited to running non-OO languages. Languages like Erlang, Haskell, and Scheme provide features, like tail recursion, closures, and continuations, which are not prominent in the mainstream OO world the JVM targets. They depart far enough from the OO model to make the JVM a poor platform choice.
That's strange, because all of the Smalltalk VMs are capable of closures and many of them can do continuations, yet Smalltalk is often cited as one of the purest OO environments. (I'm also fairly sure that tail recursion can be done as a compiler trick.)
That said, there are real limitations of the JVM. Most Smalltalk VMs can be targeted by a Java compiler to do a dandy job as a JVM. It's much harder to target Smalltalk for a JVM, unless you limit the capabilities of the environment. (Particularly runtime compilation.)
Re: Erlang Doesn’t Fit The JVM
#4If these are real limitations of the JVM, what does that say about Clojure?
Re: Erlang Doesn’t Fit The JVM
#5Re: Erlang Doesn’t Fit The JVM
#6Re: Erlang Doesn’t Fit The JVM
#7The fact that you cant serialize exceptions to notify systems connected to a JVM that something blew up is just insane.
All objects should be able to be serialized (in binary) from one system to another as long as JVM versions and class libraries match... end of story.
Re: Erlang Doesn’t Fit The JVM
#8At it’s heart the JVM is designed to run OO languages very efficiently. This is why languages like Ruby and Python are (mostly) easily ported to the platform... However, the JVM is less suited to running non-OO languages. Languages like Erlang, Haskell, and Scheme provide features, like tail recursion, closures, and continuations, which are not prominent in the mainstream OO world the JVM targets. They depart far eno…
Only for a single function, at least on the JVM. For mutually recursive functions (ie, a() tailcalls b() which tailcalls a()) you either need the VM to do the optimization, or some explicit control over the stack pointer, or implementing your own function call model within one function.
For the first, you would need some sort of new tailcall instruction, or the VM would have to be guaranteed to do tail call optimizations. (You can't really give control of the stack explicitly while keeping things portable and efficient)
For the second, it's workable... if you don't care about interoperating with other languages on the JVM.
Re: Erlang Doesn’t Fit The JVM
#9At it’s heart the JVM is designed to run OO languages very efficiently. This is why languages like Ruby and Python are (mostly) easily ported to the platform... However, the JVM is less suited to running non-OO languages. Languages like Erlang, Haskell, and Scheme provide features, like tail recursion, closures, and continuations, which are not prominent in the mainstream OO world the JVM targets. They depart far eno…
[1] For example: in Java, methods with the same name but different argument types ("overloaded") are statically bound; whereas in Smalltalk, they are dynamically bound. Java dynamically binds methods with the same name and same argument types that are defined in a subclass/implementation ("overridden"). Sounds like a performance tradeoff to me. (Is Smalltalk performance C-like or Python-like?)
Re: Erlang Doesn’t Fit The JVM
#10Isn't LLVM a more interesting universal machine to target anyway?