3 ms·
I like lisp. :-) But your GC mark (fe_mark) is recursive => it's not embeddable. You need to take care to have O(1) stack for the whole system. All functions
by beeforpork 4y ago
I like lisp. :-)
But your GC mark (fe_mark) is recursive => it's not embeddable. You need to take care to have O(1) stack for the whole system. All functions: no recursion. The gcstack may grow, obviously, no problem, but the system stack must be O(1), because you cannot dynamically grow it in embedded systems. And this includes GC mark. This is the typical problem, so I looked there first. ulisp (lispbadge) has the same problem...
You can make the mark phase iterative by storing the backtracking stack inside the heap cells you're marking. It's no problem, just a bit annoying to debug, but it needs to be done to claim 'embeddable'. Maybe 20 lines more code.
It can be fixed!
- detaro 4y ago"embeddable" usually means "usable inside another program" (e.g. for user scripting), not "running on microcontrollers"