4 ms·
I knew that Erlang was originally written in Prolog, but I somehow managed to never look at any Prolog code before. It explains so much about the structure and
by chrisduesing 16y ago
I knew that Erlang was originally written in Prolog, but I somehow managed to never look at any Prolog code before. It explains so much about the structure and approach that Erlang took.
I am curious to explore how the Erlang interpreter was written, in light not of the similarities, but the subtle differences between the two languages. The use of -> was particularly interesting in comparison to how it is used in Erlang.
- silentbicycle 16y agoRead this paper: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.3972 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.3... In Prolog (as with Haskell, OCaml, and others), you can define new operators with user-definable meaning and precendence. ->, !, and some other operators used in Erlang were left undefined in Prolog specifically for making DSLs. (That's also why Erlang code looks approximately like Prolog code with a bunch of extra operators added - it was a Prolog DSL.) Prolog is a pretty good language for quickly protyping interpreters.