4 ms·
> picolisp script which prints the source code in the target language. The ability to execute and modify ASTs as the nested lists they are is just so convenient
by pflanze 4y ago
> picolisp script which prints the source code in the target language. The ability to execute and modify ASTs as the nested lists they are is just so convenient.
I'd be interested in seeing some of your code doing this. I've done lots of Scheme and some Clojure and CL, and in my own programming style I mostly avoid using bare s-expressions to represent ASTs (I use structures/objects instead[1]) except in macros, because that is giving me less ambiguity and better error checking. I wonder whether we are working at different levels of scale, or different ways of working that make us prefer one over the other.
[1] I guess it's clear what I mean--basically coding like in an object oriented language, albeit without mutation--but here's an example (definitions and use): https://github.com/pflanze/chj-schemelib/blob/master/corescheme.scm https://github.com/pflanze/chj-schemelib/blob/master/coresch... https://github.com/pflanze/chj-schemelib/blob/master/corescheme-optimize.scm https://github.com/pflanze/chj-schemelib/blob/master/coresch...