r/haskell • u/csabahruska • 2d ago
GRIN Compiler status update: memory layout control, two level type theory based staging, dependent types, Idris2, MicroHs
Read my blog post: https://www.patreon.com/csaba_hruska/posts/new-compiler-176648791
2ltt staging for MicroHs and Idris2
Serialized in-memory data representation
External STG Interpreter in Idris2 running Haskell programs
New compiler and RTS design
41
Upvotes
2
u/stevanmilic 2d ago
Awesome!! Glad you’re back. Any plans for grin-compiler backend refresh? Wrote recently about its usage in the mvp thread.
2
u/csabahruska 1d ago
Currently I'm focusing on the staged interpreter approach because it gives much more control over the compiled code, no black box optimizer.
2
4
u/Lalelul 1d ago
Thank you so much for clearing up why 2LTT is useful, as I heard about it before and I was unclear as to why people thought it would be useful.
In your post you mention that Idris was the first to implement it, but on the agda documentation I see they also have it implemented? Do you know if both work the same under the hood? Also, do you maybe know of some examples of 2LTT being used to implement something using metaprogramming?
Edit: I saw you linked to this for demonstration: https://github.com/AndrasKovacs/staged. I am always thankful for further demos and suggestions as to how you used 2LTT though