News for hackers. Stuff that matters.
Re:Flattening ASTs (and Other Compiler Data Structures) by rurban on Saturday January 11, 2025 @10:52AM (#42666649)
I worked in a language where all datastructures were "flattened", could be trivially serialized to disk, and read in again. Called print and read. The language was called lisp. All flat, just parens.

Some of my compilers export the AST as lisp trees. Much smaller and more readable than json, and it can be executed. Uniform like bricks

Re:Flattening ASTs (and Other Compiler Data Structures) by vanderZwan on Saturday January 11, 2025 @01:36PM (#42667948)
> All flat, just parens.

So not flat then. Prefix is not postfix. Forth, and most concatenative languages, are much closer to actually bein, flat.

Lisp is trivial to flatten, but that's not the same thing.