mighty-gerbils / gerbil

Gerbil Scheme
https://cons.io
GNU Lesser General Public License v2.1
1.16k stars 112 forks source link

Provide REPL command to view source-optimized, expanded Scheme code #1271

Open dpk opened 1 month ago

dpk commented 1 month ago

Opening this issue by request.

Chez and Loko have an expand/optimize procedure, and Guile a ,optimize REPL command, that let you see the output of their cp0-equivalent source-level optimization passes run on the expanded code you give it.

In Gerbil you can currently do this by running gxc -s -S -O (keep Scheme source file, don’t invoke Gambit, do run optimizations) and looking at the output .scm file, but a way to do this from the REPL would be nice!

vyzo commented 1 month ago

Yes, indeed!

Something in :std/interactive would be great, maybe as part of the IDE pkg.