Parameterizing Mix Erlang Compiler to handle Core

28 views
Skip to first unread message

Chris Keele

unread,
Jul 14, 2016, 5:28:15 PM7/14/16
to elixir-lang-core
Hey all!

I've recently decided to sit down and try to make a toy language. Intrigued by a 2014 Robert Virding talk, and having a working AST in yecc and leex, I thought I'd play around with trying to compile it to Core Erlang.

In order to expedite learning about Core Erlang I decided to try to make a mix compiler for it for quicker feedback cycles, so I took a look at the Mix Erlang Compiler, and boy do I have no clue what's going on there. But I went in and tweaked hardcoded references to 'erl' and passed a command line flag in to the main compiler until I got something that worked.

I've had far less luck mimicking the test suite for the the Erlang Compiler task, but I can safely say my code works 100% of the time for the 1 hello world program I've tried it on once. The changes relevant to making the Erlang Compiler handle Core Erlang instead can be found here, and as you can see they're pretty minimal.

I'm wondering if
  • We'd actually want this in core, and if so
  • If the Erlang Compiler could be parameterized to handle this case as well, or
  • If a new compiler might make more sense
If consensus is this rightly belongs nowhere near core, I'd always appreciate some pointers on how I can improve what I have, or just any illumination into the compiler manifest code lifecycle, since I'll probably be using my code for a fair bit of experimentation over the next several weeks.

José Valim

unread,
Jul 15, 2016, 3:50:57 AM7/15/16
to elixir-l...@googlegroups.com
I would like to see more use cases before adding a core compiler to the language. In particular, if you are writing your own language, it is most likely that sooner rather than later you will have your own compiler on top of core and then you won't use the core compiler at all.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/bea2c78a-31d5-4cac-b271-6142b668a115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages