Skip to content

Instantly share code, notes, and snippets.

@Tpaefawzen
Created July 29, 2025 09:16
Show Gist options
  • Select an option

  • Save Tpaefawzen/dad353f4a6bea19d8340252c78ec0491 to your computer and use it in GitHub Desktop.

Select an option

Save Tpaefawzen/dad353f4a6bea19d8340252c78ec0491 to your computer and use it in GitHub Desktop.
Idea of compiling Grass esolang
T is unsigned integers type
Program ::= /* */ | Program Cmd
Var = Local T | Param T | Globl T | Wtf
App = [2]Var
Abs = struct { args: T; len: T; body: [len]App; }
Cmd = App | Abs
In var union, T indicates 0-indexed variable index
Local is inside Abs
Param is Abs Param
Globl is upper namespace
Wtf is index out of bound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment