This page is no longer maintained — Please continue to the home page at www.scala-lang.org

off the wall, and kinda off topic: jvm on erlang?

8 replies
Raoul Duke
Joined: 2009-01-05,
User offline. Last seen 42 years 45 weeks ago.

with all due i bow i'm not worthy respect to the folks who are
bringing message passing actor goodness to those of us who can't use
erlang, at the same time i'm sorta tired of people barely reinventing
the whole erlang gestalt (there is more to what makes erlang erlang
than just message passing, imho). how about a jvm in beam? :-)

sincerely.

Jim Miller
Joined: 2009-01-05,
User offline. Last seen 42 years 45 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?

There has been a ton of discussion about this on the erlang message
lists over the past few years as Erlang has increased its visibility.
While I'm not able to fully reconstruct all of the arguments I believe
that it boils down to significant technical challenges resolving the
differences between BEAM and the JVM virtual machines.

I would also argue that there are differences between Scala's approach
and that of Erlang. Erlang's actor implementation is built into the
Erlang VM while the Scala actor implementation is pure library
implementation. The reports written by Odersky et al show that the
pure library implementation has some really nice scaling
characteristics and can/should be able to compete with the Erlang (re
built into VM) model.

So while it appears as though the Scala community is reinventing the
wheel this is only true at the API level. The implementation is
completely different and allows for continual improvement as people
study and gain insight into where improvements can be gained.
Swapping in different libraries is easier than changing VM's (maybe an
over-simplification but I think I've made my point)

On Tue, Mar 10, 2009 at 5:05 PM, Raoul Duke wrote:
> with all due i bow i'm not worthy respect to the folks who are
> bringing message passing actor goodness to those of us who can't use
> erlang, at the same time i'm sorta tired of people barely reinventing
> the whole erlang gestalt (there is more to what makes erlang erlang
> than just message passing, imho). how about a jvm in beam? :-)
>
> sincerely.
>

Raoul Duke
Joined: 2009-01-05,
User offline. Last seen 42 years 45 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?

> Swapping in different libraries is easier than changing VM's

i'm willing to believe that :-)

(but i think it is an interesting thought experiment to consider how
much energy will go into inventing another actor model on a vm that
doesn't seem to support lwp and isolation (let alone tail calls or
good hot swapping or OTP or ...) vs. putting that energy into an
alternate future history.

of course, i'm pretty much completely unqualified to do any of these
things, so i'm not particularly seriously casting stones or anything,
it was more just thinking out loud about what the relative merits of
the systems are, which is relevant to any end-user looking into apply
the actor model.)

sincerely.

Alex Cruise
Joined: 2008-12-17,
User offline. Last seen 2 years 26 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?

On 03/10/2009 04:29 PM, Raoul Duke wrote:
> (but i think it is an interesting thought experiment to consider how
> much energy will go into inventing another actor model on a vm that
> doesn't seem to support lwp and isolation (let alone tail calls or
> good hot swapping or OTP or ...) vs. putting that energy into an
> alternate future history.
>
Realistically, There Can Be Only One Erlang or Scala. However, in the
Scala world, there can be any number of competing actors libraries, and
selecting a different one can be as simple as downloading a jar and
changing your imports. :)

The It's Just A Library principle (needs a catchy name ;) is extremely
important but IMO under-appreciated.

And while JVM != BEAM (and vice versa, reflexively) the JVM has shown
that it scales extraordinarily well, just not using the same techniques
as BEAM.

-0xe1a

Raoul Duke
Joined: 2009-01-05,
User offline. Last seen 42 years 45 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?

> Realistically, There Can Be Only One Erlang or Scala.
> The It's Just A Library principle (needs a catchy name ;) is extremely
> important but IMO under-appreciated.
> And while JVM != BEAM (and vice versa, reflexively) the JVM has shown that
> it scales extraordinarily well, just not using the same techniques as BEAM.

overall i think i don't disagree -- up to a point. the point being
that if you want the stuff that makes erlang /really/ cool, the OTP,
the hot-swap, the really lightweight processes, the isolation, then
you aren't likely to be getting that from the JVM just yet. (yes i
know of things like javarebel.)

which might not be a point that a lot of people care about, for their purposes.

sincerely.

Jim Miller
Joined: 2009-01-05,
User offline. Last seen 42 years 45 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?

On Tue, Mar 10, 2009 at 7:55 PM, Raoul Duke wrote:
>> Realistically, There Can Be Only One Erlang or Scala.
>> The It's Just A Library principle (needs a catchy name ;) is extremely
>> important but IMO under-appreciated.
>> And while JVM != BEAM (and vice versa, reflexively) the JVM has shown that
>> it scales extraordinarily well, just not using the same techniques as BEAM.
>
> overall i think i don't disagree -- up to a point. the point being
> that if you want the stuff that makes erlang /really/ cool, the OTP,
> the hot-swap, the really lightweight processes, the isolation, then
> you aren't likely to be getting that from the JVM just yet. (yes i
> know of things like javarebel.)
>

Because I think that this is actually a worthy discussion that touches
on why I moved to Scala from Erlang I'll continue. Except for the
isolation (which is tricky in a heavyweight VM), the other items that
you describe can all be implemented in library fashion using the
existing VM. Everything in OTP is simply implemented as a library,
written in Erlang, so this obviously means you could write equivalents
in Scala (as I have in some cases). Hot swapping is achievable
through the class loader (I've done this exact thing in past Java
projects, its not hard), and the lightweight processes have been shown
to be achieved in practice through the existing actor model.

Supervision trees, gen_server, gen_fsm, gen_event and those are simply
libraries that define interfaces that have to be implemented. Its
simply a matter of someone sitting down and writing something. This
would be significantly easier to do than, and more people can do them,
than trying to implement BEAM on the VM.

Raoul Duke
Joined: 2009-01-05,
User offline. Last seen 42 years 45 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?

> can all be implemented in library fashion using the existing VM.

thanks for the thoughts! i am learning. i believe i understand your
point that the delta between the two can be reduced.

i still wonder, however, about the devil in the details. like, can the
jvm really get the same safety and isolation and performance of
erlang's lwps? (of course, one has to ask how much is enough vs.
getting "all" of it. when it comes to safety and isolation i think
there is a big difference between something that just supports lots of
processes, and one where they /really/ can't fubar each other.) and,
while any old programmer can just write up some libraries for Scala to
do Erlangy things, how long will it be before the results have the
same quality (lack of bugs) as the presumably already extensively
time-tested Erlang versions?

(not that those are show stoppers, and i certainly never want to
prevent progress. i guess this all stems from me being bothered by
what i think i hear implicitly being hinted at when people talk about
their new favourite actors-in-jvm implementation, that it isn't that
big a deal to make these things see we're already done, we can start
running space shuttles on it! ja, i'm being hyperbolic; i just wish
there was more acknowledgment of the usefulness of all Erlang's
pieces.)

sincerely.

Justin du coeur
Joined: 2009-03-04,
User offline. Last seen 42 years 45 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?
On Tue, Mar 10, 2009 at 8:50 PM, Raoul Duke <raould [at] gmail [dot] com> wrote:
i just wish
there was more acknowledgment of the usefulness of all Erlang's
pieces.)

I actually think the pieces are very useful -- indeed, they're the main reason I seriously considered using Erlang for my app instead of Scala.  (I personally think Scala's a much better language, but OTP is a compelling chunk of technology.)

But keep in mind that the duplication of these stacks isn't an entirely bad thing.  Having two different groups attacking the underlying Actor architecture with different approaches means that the problem space is being explored more thoroughly.  Yes, there's some redundant effort, but it's likely to produce new ideas that will feed back in both directions.

So honestly, I see the Scala Actors project as likely to be good for Erlang in the long run, in much the same way that I think C# has been good for Java.  A little competition between similar systems keeps everybody sharper, and keeps folks from getting complacent.  I really don't see this as a zero-sum game -- rather, I think the two projects strengthen each other in the long run...
Raoul Duke
Joined: 2009-01-05,
User offline. Last seen 42 years 45 weeks ago.
Re: off the wall, and kinda off topic: jvm on erlang?

> I really don't see this as a
> zero-sum game -- rather, I think the two projects strengthen each other in
> the long run...

ja wohl, I totally agree with that, and apologize if I came across as
seeing it as some zero-sum situation where Erlang had to 'win'.
hearing that some folks recognize there is more than just message
passing To Do is reassuring. :-)

sincerely.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland