[erlang-questions] RFC: Erjang's Java API prototype
Robert Virding
rvirding@REDACTED
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
Erlang side.
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".
Robert
P.S. I am sending this to both erlang-questions and as a comment to
Krestens blog.
On 14 June 2010 13:57, Ulf Wiger <ulf.wiger@REDACTED> wrote:
>
> I think this is well worth looking into, especially for
> those who like discussing semantics, overloading, type
> inference and such.
>
> http://www.javalimit.com/2010/06/a-java-api-for-erjang.html
>
> High marks for elegance. There are some open issues that could
> benefit from some attention from the language sticklers in the
> Erlang community.
>
> BR,
> Ulf W
> --
> Ulf Wiger
> CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
> http://www.erlang-solutions.com
> ---------------------------------------------------
>
> ---------------------------------------------------
>
> WE'VE CHANGED NAMES!
>
> Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG
> SOLUTIONS LTD.
>
> www.erlang-solutions.com
>
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>
More information about the erlang-questions
mailing list