# Row-Level Security with Elm and Acadia

**URL:** <https://discourse.elm-lang.org/t/row-level-security-with-elm-and-acadia/10907>\
**Category:** Show and Tell\
**Created:** [September 16, 2026, 11:21am UTC](https://discourse.elm-lang.org/t/row-level-security-with-elm-and-acadia/10907 "2026-09-16T11:21:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![evancz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/evancz/32/16_2.png) [@evancz](https://discourse.elm-lang.org/u/evancz)\
**Post date:** [September 16, 2026, 11:21am UTC](https://discourse.elm-lang.org/t/row-level-security-with-elm-and-acadia/10907/1 "2026-09-16T11:21:22Z")

</div>

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

> **[Simple and Efficient Row-Level Security](https://acadia.engineering/blog/simple-and-efficient-row-level-security)**

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 [here](https://acadia.engineering/blog/solving-the-1-plus-N-query-problem) 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 [`elm-simple-server`](https://github.com/acadia-engineering/elm-simple-server) to run Elm code on the server, so maybe that is interesting as well.

---

<div class="post-metadata">

**Author:** ![dwayne](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dwayne/32/5478_2.png) [@dwayne](https://discourse.elm-lang.org/u/dwayne)\
**Post date:** [September 16, 2026, 2:59pm UTC](https://discourse.elm-lang.org/t/row-level-security-with-elm-and-acadia/10907/2 "2026-09-16T14:59:11Z")

</div>

This is awesome! I’ve been tempted to write a post called “Only 698 Programming Languages to Go,” but I restrained myself. The idea being that Elm and Acadia feel like two of Peter Landin’s [“next 700 programming languages”](https://dl.acm.org/doi/10.1145/365230.365257).

I just love how you’ve taken the lambda calculus as the core and then methodically selected the best, most relevant ideas from programming language theory to craft elegant solutions to practical problems. I’m in awe. Great work!

---

<div class="post-metadata">

**Author:** ![G4BB3R](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/g4bb3r/32/4544_2.png) [@G4BB3R](https://discourse.elm-lang.org/u/G4BB3R)\
**Post date:** [September 17, 2026, 1:16am UTC](https://discourse.elm-lang.org/t/row-level-security-with-elm-and-acadia/10907/3 "2026-09-17T01:16:58Z")

</div>

I am loving this sequence of blogposts!

Do you think this technique will ever be ported to Elm partially? Since it doesn’t have the guarantee of terminating?

---

<div class="post-metadata">

**Author:** ![evancz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/evancz/32/16_2.png) [@evancz](https://discourse.elm-lang.org/u/evancz)\
**Post date:** [September 17, 2026, 7:06am UTC](https://discourse.elm-lang.org/t/row-level-security-with-elm-and-acadia/10907/4 "2026-09-17T07:06:50Z")

</div>

Thank you! ❤

In the context of Elm, I would expect more traditional approaches (like inlining) to produce better results. After inlining you would look for some typical simplifications, so you could end up skipping code that way.

The trouble is that JS VMs are already doing this, so if Elm did it too, we’d likely end up having larger assets but not necessarily faster code. So I think this kind of stuff is only plausible if the compilation target is something different.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [September 27, 2026, 7:06am UTC](https://discourse.elm-lang.org/t/row-level-security-with-elm-and-acadia/10907/5 "2026-09-27T07:06:58Z")

</div>

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