It's been three days since I announced the existence of Erjang - a JVM-based Erlang VM - and I thought it would be appropriate to do a wrap-up of the comments received so far. Mind you, there is no release, just a bag of files over at github.
Some commenters question the very idea of doing an Erlang on the JVM, asking - assuming it is doable - why this is even a good idea. Erlang already has a great VM, so why another one? See for instance the discussion here at reddit.
- Erjang is different from BEAM (the Erlang VM). It will never have the same (soft) real-time characteristics that BEAM has. For instance,
- With Erjang, you will will experience global garbage collection every once on a while, whereas with BEAM this doesn't happen because every process has it's own heap.
- The flip side of this is that Erjang doesn't copy messages, so you can pass large data structures (immutable, of course) between processes at minimal cost. This is ideal for sharing things like persistent data structures (as Clojure has them). [in fact, integrating clojure is an interesting idea to work on...]
- So from this, Erjang can feasibly provide better over-all performance, assuming you can live without the real-time promises.
- Erlang is a great language, even for applications that don't have soft real-time requirements, but "just" want the great concurrency model, the distribution features, and the extensive set of Erlang libraries.
- A good language deserves more than one implementation, so I think Erjang will only further strengthen it's reach.
- IMHO, the best thing about Java is it's virtual machine. [In fact the language is horrible in many ways and I am not proud of having been part of putting generics in there]. The JVM however - is the finest piece of machinery built since I don't know when, and it is an area that has received enormous engineering and innovation attention the last 15 years. In particular the HotSpot team (folks with Self-DNA) and the IBM VM's (people with OTI-dna) have done great things. I have been following these, and it is clear to me that virtual machine technology is an area where other people still have a lot to learn [hello, CLR team!].
- The Java platform is widely trusted and depended upon. Granted, there has also been many failures, but that comes with the success of the platform. I think providing a Java-based implementation of a language strengthens its position, because it makes it an easier choice for some.
Even if Erjang is not as fast as BEAM, it might be a sensible choice for some.
- Erjang can run within a WebSphere or WebLogic server with no "native code". Maybe that will make it a good choice when organizations are "stuck" on those platforms, for whatever reasons.
- Erjang can potentially run anywhere there is a decent JVM, which includes stuff like AS/400, extending the reach of the platform.
- Erjang can directly use existing java-based integration infrastructure out there. And there is a lot of that.
But I think - and hope - that Erjang will be faster than BEAM. But probably, there is some way to go before we match HiPE. What do you think?