Next Elm Online Meetup - Lets Build Lamdera

On May 27th @ 20:00 GMT+1 there will be an Elm online meetup:

https://meetdown.app/group/10561/Elm-Online-Meetup

========

The Lamdera compiler has been open sourced:

Mario has done some great work on figuring out how to extend the original Elm compiler whilst making minimal changes to the source code. He did give a presentation on this at the last Elm camp, but I didn’t fully grasp it at the time so… I am interested in learning how to build it, to explore and read some of the codebase, and understand the “extension” techniques used so that I can begin to learn how to make compiler contributions of my own.

I am starting from the point of being a novice at Haskell (15 years ago read a few chapters of a book and gave up when it started going on about monads), and having minimal knowledge of the Elm compiler code. As such, you can expect to be able to follow along from a similar starting point.

My intention is for this to be a cooperative learning session. If participants come prepared and ready to do some hands on stuff, we can go through the entire process of checking out the code, installing Haskell and any associated tooling necessary, and building it, and then running our locally built compilers on a test program.

If anyone has some spare time between now and the meetup and cares to do any investigation of the code, or have a go at hacking at something, do please bring your work along. I don’t need to be driving the entire session and we can take our time to get everyones build working or follow interesting tangents and so on.

To get you started, here is how I have begun my efforts to study the code:

mkdir -p lamdera/lamdera
git clone https://github.com/lamdera/compiler.git lamdera/lamdera/

mkdir -p elm/compiler
git clone https://github.com/elm/compiler.git elm/compiler/

kdiff3 lamdera/lamdera elm/compiler

(or use some other diff tool than kdiff3, but I quite like kdiff3 as an interactive tool for exploring a codebase diff).

Then look at the compiler/ and builder/ folders. Already I can see how the minimal injection of new code is being done, and how more extensive new work for Lamdera has been placed into the ext* folders.

I hope to see you there!

12 Likes

I feel like I need to disclose because it might get assumed otherwise; we (the Lamdera team) did not commission Rupert to do this topic! :smile: this is his own initiative. But we are stoked about it and some of our team will be joining to assist and answer any questions if needed.

If anyone wants to poke around ahead of time, the dev setup docs can be found here.

8 Likes

Absolutely - although I am still open to receiving a commission :laughing:

What is driving my interest is that Lamdera is open source and seems more open to pull requests. It has structure to follow to make changes to the compiler, and is taking the principle of forward-and-backward compatability and in that sense is not a hard fork of Elm but something that is staying true to the language. The structure keeps options open to upgrade should a new version of the original Elm compiler arrive, so work done here is likely to retain its value.

As such, it aligns with my views on the best direction of travel and presents an opportunity to contribute and experiment without being controversial or following the “lonely path” of a breaking fork.

My particular interest is in new backends for other compiler targets.

5 Likes