Remix.run Logo
wheatBread an hour ago

This post is about one of my favorite aspects of the Acadia compiler, symbolic evaluation.

The compiler evaluates queries as much as possible at compile-time, so it is able to reduce `case` expressions, `let` expressions, etc. One neat outcome of this is that large expressions can sometimes be fully evaluated at compile-time, so they end up having no runtime cost at all!

I like this feature because it also only works because the query language is not Turing Complete. The design choices described in https://acadia.engineering/blog/solving-the-1-plus-N-query-p... that avoids 1+N patterns, also guarantees that queries terminate. This means they terminate whether you run them at runtime or at compile-time!

Anyway, the post also has an example app that uses https://github.com/acadia-engineering/elm-simple-server to run Elm code on the server, so maybe that is interesting as well.