summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_frame.c
Commit message (Collapse)AuthorAge
* altos/scheme: Rename to 'scheme', clean up buildKeith Packard2017-12-05
| | | | | | | | | Constant block is now built in a subdir to avoid messing up source directory. Renamed to ao_scheme to reflect language target. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Fix stash usage across frame allocationKeith Packard2017-12-03
| | | | | | | Must un-stash before allocation failure check. Use frame_stash instead of poly_stash for frames. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: split set/def. Add def support to lambdasKeith Packard2017-12-01
| | | | | | | | In scheme, set can only re-define existing variables while def cannot redefine existing variables in lambda context. Def within lambda creates a new variable at the nearest enclosing scope. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Split out frame vals from frame structKeith Packard2017-12-01
| | | | | | | This lets the frame be resized without moving the base structure. The plan is to allow all frames to be resized, not just the global frame. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Finish first pass through r7rsKeith Packard2017-11-17
| | | | | | | | | | * print -> write, patom -> display * Add read-char, write-char * Add exit, current-jiffy, current-second, jiffies-per-second * Add for-each and string-for-each * Avoid duplicate builtins with different atoms Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Sort frames by atomKeith Packard2017-02-20
| | | | | | | | | Fortunately, the collector always retains the relative order between addresses, so we can sort based on the atom address itself. This reduces the time spent looking for names in larger (e.g. global) frames. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Add continuationsKeith Packard2017-02-20
| | | | | | This provides call/cc and makes 'stacks' visible to the application. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Remove some stale frame debugging checksKeith Packard2017-02-20
| | | | | | No-one sets frame->_num to 0xff to hit these Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: re-use small framesKeith Packard2017-02-20
| | | | | | | | | This saves a pile more use of the allocator by noting when frames have not been referenced from another frame and freeing them when they go out of scope. Frames with references are left to the allocator to deal with. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Change GC to do moves in batches of 32Keith Packard2017-02-20
| | | | | | This should make it quite a bit faster than doing one at a time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Make sure memmove only happens once per object. Other GC fixesKeith Packard2017-02-20
| | | | | | | | | | | | The memmove may be overlapping, so make sure it happens only once by just checking whether move_size has been set, rather than looking at ao_lisp_moving; that doesn't get set when moving a noted cons as that still needs to be walked at a later time. Fix up the various looping move functions to all use the same pattern. Atom was busted. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Deal with memory compation in the middle of operationsKeith Packard2017-02-20
| | | | | | | | Handle memory compaction in places where we've got pointers into the heap across an allocation operation. Either re-compute the values from managed global references or add new roots across the allocation. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: working on lexical scopingKeith Packard2017-02-20
| | | | | | Not working yet Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: convert GC to non-recursiveKeith Packard2017-02-20
| | | | | | | Use a boolean array to note cons cells which would otherwise recurse, then loop until that array is empty. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Change GC move APIKeith Packard2017-02-20
| | | | | | | | Pass reference to move API so it can change the values in-place, then let it return '1' when the underlying object has already been moved to shorten GC times. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add lambda support to lispKeith Packard2017-02-20
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Separate out values from atomsKeith Packard2017-02-20
This enables changing values of atoms declared as constants, should enable lets, and with some work, even lexical scoping. this required changing the constant computation to run ao_lisp_collect() before dumping the block of constant data, and that uncovered some minor memory manager bugs. Signed-off-by: Keith Packard <keithp@keithp.com>