Erlang on a JVM/CLR

I’ve just started reading Joe Armstrongs book on Erlang and listened to his excellent talk on Software Engineering Radio.

Its an interesting language/system and one whose time seems to have come around with the advent of multi-core machines.

My question is: what is there to stop it being ported to the JVM or CLR? I realise that both virtual machines aren’t setup to run the lightweight processes that Erlang calls for – but couldn’t these be simulated by threads? Could we see a lightweight or cutdown version of Erlang on a non Erlang VM?

9 thoughts on “Erlang on a JVM/CLR

  1. user

    I don’t know of any technical problem inhiting this.

    Actually Scala (a JVM functional language) uses what is called an Actor Model that is very similar to, and as I understand it borrows heavily from, the Erlang model of shared-nothing concurrency.
    Threads could not simulate Erlang processes. They’re much too heavy-weight.

    Reply
  2. user

    You could not use JVM/CLR libraries, given their reliance on mutable objects.

    Erlang exception handling is quite different from JVM and CLR exceptions, you would need to handle this somehow.

    Implementing processes as threads would mean that any sizable Erlang system runs out of memory pretty fast (process size on my machine on creation: 1268 bytes, thread stack size in CLR: 1 MB) and communication between processes is much slower than in Erlang.

    What you probably want is an Actor Model implementation on JVM or CLR.

    Scala and Clojure have already been mentioned. In addition, there are many Actor implementations for JVM:
    Kilim, Functional Java, Jetlang, Actors Guild, ActorFoundry, and at least one for CLR: Retlang, which can be used from any JVM/CLR language.

    Reply
  3. user

    Possible? Yes. Practical? Well, probably not; they solve different problems in very different ways, and thus have lots of major differences in the way they do things. This would make porting hard, and performance would likely suffer severely. That doesn’t mean it can’t be done, just that there are better ways to accomplish what such a port would bring to the table.

    Reply
  4. user

    For educational reasons, we are implementing a subset of ErlangVM for CLR. We were highly inspired by Kresten Krab Thorup and his project Erjang, a JVM based Erlang VM. Erjang uses kilim framework for representing lightweight processes, and it starts to attract attention.

    Javalimit – Erjang’s author blog.

    Erjang repository

    Reply

Leave a Reply

Your email address will not be published.