alpha 0.1.0

Here is Eco

An introduction to the Eco compiler, its goals, and origins.

Acknowledgements

Eco has a clear lineage. It is forked from Guida, which in turn is a fork of the original Elm compiler.

The original Elm compiler and the Elm language were created by Evan Czaplicki, whose work defined the foundations this project relies on: the language design, the type system, and the surrounding ecosystem.

Décio Ferreira ported the Elm compiler from Haskell to Elm, making it possible to have a self‑hosting toolchain. Eco builds directly on these efforts. It would not exist without Evan’s years of work on Elm and Décio’s work on Guida, and I am grateful to both of them.

Elm Compiler Optimized

Eco is a re‑implementation of the Elm compiler, written in Elm itself. The name stands for Elm Compiler Optimized, reflecting its dual focus on staying true to Elm’s design while pushing hard on performance and modern compilation techniques.

From a technical perspective, Eco is a production‑oriented compiler that targets both native code and JavaScript. It retains Elm’s familiar guarantees—strong static typing, purity, and a focus on maintainable, front‑end applications—while extending the range of deployment options. The ability to compile Elm down to native code opens the door to new classes of applications and performance profiles, while continuing to support JavaScript keeps Eco compatible with the existing Elm ecosystem.

A distinctive design choice in Eco is that it preserves type information throughout the entire compilation pipeline. Many compilers targeting JavaScript throw away most or all type information early in the process. Eco takes the opposite approach: it keeps rich type data available to later stages, enabling optimizations that would otherwise be impossible or much harder to perform. This aligns with the spirit of Elm’s type system—types are not just for catching errors at compile time; they can also guide the generation of efficient machine code.

Eco’s overarching aim is to be a high‑performance, production‑grade Elm compiler designed with modern hardware in mind. By combining Elm’s declarative model and strong types with an aggressively optimizing backend, Eco seeks to make it practical to write large, performance‑sensitive systems in Elm without giving up the language’s clarity and reliability.

In short, Eco stands on the shoulders of the original Elm compiler and Guida, extending their ideas into a new compiler that is self‑hosted, optimization‑driven, and ready to target both JavaScript and native code—while remaining firmly rooted in the values and design of Elm.