[erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG)

Ulf Wiger <>
Sat Oct 28 01:14:38 CEST 2006


Den 2006-10-28 00:04:02 skrev Bob Ippolito <>:

> As a relatively new user to Erlang there's only three
> things that I've noticed that would've helped me out
> in any significant way:
>
>  1. Better record syntax. Current syntax is very repetitive.
> It's also not obvious how to do "schema evolution" of records
> without changing their name (at least temporarily).

Agreed.

> I think I'd be very happy with "structs" as proposed by Joe
> Armstrong in 2001 [1] -- the performance characteristics of
> records are much less important to me than having a data
> structure with named fields for maintainability.

I think it's mainly a matter of time before there's a
replacement for records. It is widely agreed that there is
a need for something like 'structs', but there are a couple
of ideas on what that something should look like, and then
there is the matter of coming up with an efficient
implementation.


>  2. Bit matching syntax. All of my gripes seem to have
> been addressed at EUC 05 in the "Bit-level Binaries and
> Generalized Comprehensions in Erlang" paper [2], but are
> not yet in an OTP release.

As I understood Björn G's recent post, this is forthcoming.
I believe this is great.

>  3. Easier ways to do parse transforms. There are places
> in code where I want to do very predictable things based
> on a static lookup table that I'd like to have in compiled
> code.

How funny. I just wrote such a parse transform yesterday. (:

I was quite pleased with how it turned out. I pretty much
used the exprecs module from the user contributions at
trap_exit.

I agree that parse transforms should be easier. I've made
a few attempts at making it so. There should really be a
reusable library, and I think that one could be made, perhaps
based on e.g. the exprecs module, or at least along the
same lines (using syntax_tools).

Some things, like how to do proper error reporting from
within a parse transform, are undocumented. It took me
a while to figure out how to do it.


> http://www.erlang.org/ml-archive/erlang-questions/200301/msg00103.html
> [2] http://www.erlang.se/euc/05/1640PerKostis.pdf
>  Note that NONE of these are backwards incompatible changes.
> I'm quite happy with Erlang as it is, but there are obvious
> ways to improve it.

There is some low-hanging fruit, where Open Source users
can easily help out. Adding structs, or things like the
bit syntax additions, are certainly more daunting tasks.

> It also seems that other people have already thought of *and*
> implemented these things, it just takes time to migrate to the
> OTP distribution.

The time it takes for changes to migrate into OTP can depend
on a number of things:

- Some of the proposed changes offer a partial solution, but
   in order to make it into OTP, 'someone' has to finish the
   job, write the documentation and test suites, etc. It
   would be easier to help with this if the OTP documentation
   sources and test suites were available, of course. There
   are reasons why they aren't at this time, but it may change
   (some of the test suites are in fact available.)

- Someone usually needs to at least consider things like
   sanity, consistency and generality. This process can be
   helped by doing a short write-up as part of the contribution.
   These things take time, and if the OTP team has to do all
   of it, it will of course slow down the process.

- IPR issues are something that a company like Ericsson has
   to take seriously, since (being a big company) it's a
   rather likely target of copyright law suits. Sometimes, it can
   be a lot easier to simply leave certain libraries outside
   of OTP, because - let's face it - reverse patent searches
   are virtually impossible to conduct.

BR,
Ulf W
-- 
Ulf Wiger



More information about the erlang-questions mailing list