241 points · by okket · 8y ago · 37 comments
https://8thlight.com/blog/kofi-gumbs/2017/05/02/core-erlang....
Core Erlang is an intermediary language targeting 'BEAM', the Erlang virtual machine.
I've spent about 2.5 years of my career writing Erlang code. It's statements like "Core Erlang is less complicated than Erlang" that always trouble me about the Erlang community - Core Erlang is less complicated for compilers, not for humans. In this first in a series of blog posts about Core Erlang, there is no context given around what it is or why anyone should care.
Erlang is a great language and environment, but it really struggles with the marketing aspects of a platform, that is, how to make it accessible to humans.
I've been a Scala dev for years and I gradually learned FP by moving from Java to Scala, but in the case of Elixir, I've only barely looked at some Erlang previously.
Would you say Elixir has done a better marketing job of being accessible to developers?
Also, please don't use rhetoric of the form "We need to make software accessible to/usable by humans." If the software is not usable by humans, who exactly is using it? To what species do they belong? Say "new users"/"people unfamiliar with the language"/etc. instead.
This blog entry is part of an ongoing series about the passes in an Erlang compilation. The author probably assumed some familiarity with Erlang itself, and previous entries in the series, not intending this entry for an audience of general unspecified humans. I'm not sure it's the author's duty to turn every technical post they write into newbie-accessible marketing.
Is Erlang an abstraction on top of Core Erlang? I ask because the later is far more verbose than the former. Is there a performance or extensible benefit to this more verbose and precise form that I am not aware of?
The only benefit is that it is easier for a machine to do the transformation from Core Erlang to BEAM bytecode than it would be if that machine would have to transform Erlang in one go, similar to how a C compiler will first make a tree like representation of the program in memory, will then convert that tree into some assembly (or a meta assembly language that is still platform independent) which will then be converted to binary. Each of those stages has a corresponding equivalent in the Erlang domain:
Erlang -> C
Abstract Format -> AST
Core Erlang -> Assembler
BEAM Bytecode -> binary
The equivalence is obviously not exact but good enough for this explanation.
- fez ( https://github.com/kjnilsson/fez ) is an F# to Erlang compiler (compiling to Core Erlang)
A good intro with some word about core erlang too
https://skillsmatter.com/skillscasts/11312-fez-fsharp-type-s...