[erlang-questions] Erlang 3000?

Robert Virding <>
Sat Nov 15 22:56:59 CET 2008


You have mentioned a very real problem, although some of the things you
point out are actually justified. For example ets/dets explicitly handle
tuples where one of the elements is the key while dict/orddict/gb_trees work
with separate keys and values so a difference here is expected. It is a pity
that gb_trees does not have a dict compatible api where it is possible.

That argument ordering is different and that sometimes the thing worked upon
comes first, or last, or sometimes even in the middle is unfortunate. The
different, or rather inconsistent, ways of indicating success/failure is
also unfortunate.

Reworking Erlang to fix many of these errors would probably worth the
effort, though it might split the user group. One could also fix the syntax,
although making it look more like C#/Java would probably be last on my list
of priorities, if it ever got there in the first place. I mean the idea is
to look forwards and try and get rid of old blemishes of the past and not
import someone elses old crud.

It would also be fun, though I think it would be more difficult than many
believe.

Robert

2008/11/15 damien morton <>

> I don't suppose there's and Erlang 3000 project in the works?
>
> The Python people set out to create Python 3000, throwing backwards
> compatibility out the window in favour of fixing language and library
> design errors.
>
> I mentioned earlier the variety of ways that the Erlang libraries
> signal returning a value or not. Some examples:
>
> proplists:get_value(Key, List) -> undefined | Value
>
> dict:find(Key, Dict) -> {ok, Value} | error
>
> gb_tree:lookup(Key, Tree) -> {value, Val} | none
>
> dets:lookup(Name, Key) -> [Object] | {error, Reason}
>
> ets:lookup(Tab, Key) -> [Object]
>
> All these operations on standard ADTs are roughly equivalent, and yet
> they have different or conflicting naming conventions, different
> return value protocols, and different orderings of their arguments.
>
> While ets:lookup and dets:lookup return a tuple, one of whose members
> is the key, gb_tree:lookup return the value of a {key,value} pair.
>
> gb_tree:lookup, dict:find and proplists:get_value all perform the same
> operation, and though the return value protocol is different in each
> case, at least the arguments are the same.
>
> The key asset for any well designed language or library is
> learnability, which comes from regularity, i.e. having learned
> something in one situation, one can apply that knowledge to similar
> situation with a high probability of success.
>
> Erlang already does a lot of things differently from other languages,
> but when every single library module does things differently from the
> others, well, that's a lot of heterogeneity for a novice to deal with.
>
> I wasted an hour so so tonight trying to figure out a problem that
> stemmed from proplists having a different argument ordering to ets - I
> just instinctively assumed they had the same argument ordering, and
> why shouldn't I?
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081115/a1f1fa02/attachment.html>


More information about the erlang-questions mailing list