~technomancy/fennel#152: 
Reduce unnecessary gensym locals

The compiler currently binds values to gensym locals indiscriminately, leading to clutter in the compilation output. This is motivated by a need for idempotency, but many of these bindings are unneeded because they're symbols or literal values.

Across the "fennel-compendium" repository, which contains all Fennel games for TIC-80 and love2d ever to be submitted to a lisp game jam, we can see there are 496 unnecessary bindings. We should see if we can bring that number down.

https://p.hagelb.org/aotall.lua https://git.sr.ht/~technomancy/fennel-compendium/commit/f7a6886fc2ebfdccf0d1c87690850180a956e56f

Status
REPORTED
Submitter
~technomancy
Assigned to
No-one
Submitted
3 months ago
Updated
3 months ago
Labels
enhancement

~xerool 3 months ago

I've made a patch for case/match which gets rid of a lot of these bindings. That brings us down to 286 total unnecessary bindings.

https://lists.sr.ht/~technomancy/fennel/patches/39338

The next 277 of them are caused by destructure. Then, 8 of them are from -?> (mostly because -?> is used in fennelview) The last one is because someone wrote (match true ...). I don't mind if we leave the gensym around for that one.

Register here or Log in to comment, or comment via email.