DEV Community

Improving Elm's compiler output

Robin Heggelund Hansen on May 25, 2019

Elm is fast. This is not because of any innovation in the compiler. In fact, the Elm compiler hardly does any optimization at all. Elm is fast be...
Collapse
 
justgage profile image
Gage

Awesome changes! Are these changes going to be implemented soon?

Collapse
 
robinheghan profile image
Robin Heggelund Hansen

The honest answer to that is: don’t know 😅

Collapse
 
justgage profile image
Gage

Corollary, are you helping Evan directly now?

Thread Thread
 
robinheghan profile image
Robin Heggelund Hansen

I'm a member of the core team, so I do talk with Evan from time to time. But I still write PRs which he may, or may not, merge.

Thread Thread
 
justgage profile image
Gage

I just thought it was a core team of one, so that's cool 😁

Thread Thread
 
robinheghan profile image
Robin Heggelund Hansen

There's actually a whole bunch: elm-lang.org/community

:)

Collapse
 
mshaka profile image
m-shaka

Interesting article! Can I translate it into Japanese?

Collapse
 
robinheghan profile image
Robin Heggelund Hansen

Sure :)

Collapse
 
mshaka profile image
m-shaka

I'm sorry there is something that I can't understand in Inlining section.

  1. Is the intermediary number value is accumlator?
  2. What does we were folding over other things mean actually? And why aren't ints stored? In my knowledge, all local variables are stored on the stack or the heap.

I'm looking forward to your answer

Thread Thread
 
robinheghan profile image
Robin Heggelund Hansen
  1. yes
  2. other things like Booleans, Maps, Sets, Floats or other Objects. «If we weren’t storing ints» refers to the option of storing other intermediate values like objects.
Thread Thread
 
mshaka profile image
m-shaka

Thanks for your quick response! I understood.

I'm so sorry I have one more question, but this is last one.

It's about this sentence.

This is like getting the benefits of a monomorphising compiler, without actually having a monomorphishing compiler.

What I understand is below:
This talks about Inline Caching. If foldl is inlined, the function as argument of foldl is also inlined, so without Inline Caching code of inlined foldl's loop is specilized for argument functions type.
Is this right?

Thread Thread
 
robinheghan profile image
Robin Heggelund Hansen

This talks about Inline Caching => inline caches is something else, inlining is just replacing a function call with the implementation of the function.

without Inline Caching code of inlined foldl's loop is specilized for argument functions type => without inlining, the foldl's loop cannot be specialized because it has to handle all possible argument types.