4 ms·
Fantastic article, but I still don't quite understand what kind of real-world tasks on typical projects become easier with AST manipulation. After all, how ofte
by golergka 10y ago
Fantastic article, but I still don't quite understand what kind of real-world tasks on typical projects become easier with AST manipulation. After all, how often do you write a debugger?
- mordocai 10y agoTheoretically every project is easier with AST manipulation due to being able to create a high level DSL that directly maps to your problem. In practice, I think good DSLs are hard to make and so most projects never get the full benefit. I don't have any production lisp experience though(i'm a hobbyist lisper) so I could definitely be wrong there
- sedachv 10y ago> Fantastic article, but I still don't quite understand what kind of real-world tasks on typical projects become easier with AST manipulation. After all, how often do you write a debugger? A good example comes from Python: decorators had to be added as a special extension in 2003 (https://www.python.org/dev/peps/pep-0318/ https://www.python.org/dev/peps/pep-0318/) and the `with` statement in 2005 (https://www.python.org/dev/peps/pep-0343/ https://www.python.org/dev/peps/pep-0343/). Both are very useful for web programming, but do not need PEP committees and years of work when you have macros (examples: https://github.com/vsedach/cliki2/blob/master/src/accounts.lisp#L213 https://github.com/vsedach/cliki2/blob/master/src/accounts.l... https://github.com/vsedach/cliki2/blob/master/src/wiki.lisp#L155 https://github.com/vsedach/cliki2/blob/master/src/wiki.lisp#...)