Docs about Elm Runtime

Hello everybody.

I’m interested on learn more about Elm Runtime. How it works and how is implemented in Javascript with particular focus on the subscription system.

Any documentation page about it?

I have never seen any documentation about it. Whenever I have messed with the runtime, to understand it, debug something or experiment with a change, I just read the code. Most of the time the code is very well written and easy to follow.

Thank you @rupert , can you point me to the runtime source code on Github?

I find it very hard to follow many times :sweat_smile:

You’ll find the code in the various elm/* packages. For example:

What I like to do, is opening some compiled Elm app JS in VSCode (or your editor/IDE of choice) and read through the code there. “Go to definition” and “parameter name inlay hints” help tremendously. At the same time, I keep the source code on GitHub open for cross reference, because sometimes things are called just a or b in the compiled code but maybe __callback in the source code.

You might also be interested in this repo:

It’s an attempt at documenting some things about the runtime and experimenting with a different implementation.

3 Likes

I’ve written two blog posts that deal with are tangentially related to this subject.

Deals mostly with how rendering/events work from a conceptual perspective.

Might be also interesting, but it’s more about higher level architectural patterns.

1 Like

Very interesting. Thank you.

The underlying runtime system is based on effects managers. You can google for “elm effects managers” to find some discussion, including:

6 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.