[erlang-questions] RFC: Erjang's Java API prototype
Wed Jun 16 21:00:57 CEST 2010
Why do I get the feeling that I am one of those to whom Ulf is referring? :-)
In Erlang you have basically two different types of "things":
immutable data structures and processes. Processes are things which
obey process semantics (async messages, error signals, process
isolation, etc) and have internal state, how they are actually
implemented is completely irrelevant. Even ETS tables, which don't
seem like processes, behave almost like processes as you can view the
ets API as wrappers around message passing. (Aside: it is a great
shame we don't have proper EIDs and a proper asynch message interface
to ETS tables, think of the wonderful code you write).
So where am I going with all this. If you want to interface something
external to Erlang, in this case Java objects, in a clean Erlangy way
then you should try to get it to look like either as immutable data or
as a process. As Kresten had presented them they don't. So I don't
approve. :-) Note, I have no problems with Erjang interfacing Java
object or other languages or objects on the JVM, if you have all these
libraries you should try and use them, you can't seriously expect
different Erlang implementations running on different systems to have
the same external environment. It is solely on how it looks from the
I am now going to expose my ignorance about Java. Couldn't you use
hashmaps to implement ETS tables and thereby get the best of both
worlds? You could open an existing hashmap or create a new one when
you open an ETS table. This would solve *this* case, but the general
problem remains of now to access Java things in an Erlangy way.
One final comment is about why it is important. Most of Erlangs error
handling mechanism builds on processes, process semantics and
immutable data. If you start messing this you are going to get strange
effects which can be very hard to find the reason for.
But I am definitely one of "the language sticklers in the Erlang community".
P.S. I am sending this to both erlang-questions and as a comment to
On 14 June 2010 13:57, Ulf Wiger <> wrote:
> I think this is well worth looking into, especially for
> those who like discussing semantics, overloading, type
> inference and such.
> High marks for elegance. There are some open issues that could
> benefit from some attention from the language sticklers in the
> Erlang community.
> Ulf W
> Ulf Wiger
> CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
> WE'VE CHANGED NAMES!
> Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG
> SOLUTIONS LTD.
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
More information about the erlang-questions