On the use of Core Erlang vs Abstract Syntax by tools after 23.0
Mon Jun 8 15:58:56 CEST 2020
I also use Core Erlang as part of my research because it gets rid of
some quirky behaviour of Erlang and compiles out some redundant syntax
and it's still relatively high level.
The removal of `receive` expressions is also frustrating for me because
it affects the *theory* of Core Erlang: the previously high-level
receive behaviour is now hidden behind opaque primops.
Like Kostis noted in issue #1277, the fact that an EEP led to a breaking
change in Core Erlang is surprising. The "Enhancement" in "Erlang
Enhancement Proposal" has connotations of forwards-compatible changes in
my mind. Perhaps I should re-evaluate my assumptions on this.
The only reason I know in advance that my Core Erlang analyses will not
work on OTP 23 is because of your email.
It seems strange that low-level primops have replaced high-level receive
expressions and pattern matches in Core Erlang. Perhaps the Core Erlang
specification and compiler passes could have been amended, instead.
I note that EEP-52 mentions this exact approach as a potential avenue to
implementation but that it could have significantly complicated some
I realise however that it is somewhat poor form to criticise changes to
Erlang/OTP when I have been given a fair chance to comment on them via
the EEP process. Björn had to make a decision about where changes were
to be made. With compiler complexity and the Core Erlang spec in the
room, and without any objections from the community, Core Erlang drew
the short straw. The change to Core Erlang could of course be reverted
and the necessary changes could be made to the core compiler passes and
the syntax of binary patterns in the spec, but I doubt that Björn or
anyone else is willing to undo all of the work in PR2521 and then redo
it the "other way" (5547 lines changed over 14 files).
It seems like the writing has been on the wall for Core Erlang for a
little while now. As Björn noted in the comments of issue #1277, the
biggest non-Erlang users of the BEAM target the Abstract Format instead.
For example, the Elixir maintainers have already started working on
implementing new features from 23.0. Perhaps they can do this easily
precisely because they target the Abstract Format? It seems stable enough.
At this point I'm inclined to stop using Core Erlang altogether in
favour of the SSA representations introduced relatively recently. The
SSA forms don't have patterns or receive expressions either, but at
least the language has less surface area.
I would definitely like to see a renewed effort towards a well-defined
and well-maintained intermediate format, but there are important
questions to ask: who would really use it, and would the number of users
justify the cost of maintaining it?
- Joe Harrison
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: OpenPGP digital signature
More information about the erlang-questions