technoblogy / ulisp

A version of the Lisp programming language for ATmega-based Arduino boards.
http://www.ulisp.com/
MIT License
372 stars 45 forks source link

Reducing the footprint of AVR-Nano #62

Open eclab opened 9 months ago

eclab commented 9 months ago

AVR-Nano leaves 1% program memory space :-( I understand it's a tight squeeze but am wondering what items could be jettisoned to make it a bit tighter to allow for other code to be there, and for Lisp code to be stored in PROGMEM. One obvious target would be the REPL and the Serial library...

devcarbon-com commented 9 months ago

@eclab I'm currently working on a project for a client that I'm running on a hybrid of ulisp and cpp, and also needed some more flash space.

I've found a really nice way to do this is simply to comment out ulisp fn's I wouldn't be using out of the symbol table. The linker takes care of the rest during compilation.

Platformio has a nice tool that lets you see what is taking up flash and sort by size, so I used that to quickly make some large gains. fn_format off the top of my head was the biggest one, but there are several high yield ones in there.

technoblogy commented 9 months ago

A good tip - thanks!