Commit Graph

5 Commits

Author SHA1 Message Date
Jesse D. McDonald 8c683a2451 Fix up remaining references to boolean_value, fixnum_value, and cons. 2012-07-14 13:52:25 -05:00
Jesse D. McDonald 9e789dce14 First version of simplified garbage collector.
For now, this GC is non-generational, and much slower than the old
version. It tracks objects by a fixed object ID rather than changeable
memory address. Small object (eight bytes or less) are stored directly
in the array, indexed by object ID, while larger object are allocated
with malloc() (for now) and stored in the array as a pointer. Object
IDs are stored as 32-bit integers, even on 64-bit platforms.

Advantages:
- Simpler design
- Requires less memory on 64-bit platforms
- Object IDs don't change when running the GC
- No need to store a random "hash" value in vectors/strings/structs
- Can hash pairs by identity, not just value
- Can move objects individually, without fixing up all references
- Can determine object type from value, without another memory access

Disadvantages:
- Lower initial performance (non-generational, relies on malloc())
- 32-bit values place a (high) limit on total number of objects
- Must explicitly free unreachable object IDs after GC
2012-07-14 13:47:58 -05:00
Jesse D. McDonald f3458173c4 Implement simple self-hosting compiler (src/compiler.rls). 2012-07-14 13:47:39 -05:00
Jesse D. McDonald e1662ca4b8 Convert tail-call parameters to a byte-string.
Add special variables for keyword arguments & values.
Add support for keyword arguments to (simplify-apply).
Implement full string parsing in src/reader.rls.
TODO: Support keywords in (simplify-lambda) and writer.
2012-07-14 13:46:42 -05:00
Jesse D. McDonald ca8d68c023 Add automatic dependency tracking to the build rules.
Move optional extension modules (e.g. mod_io.c) into mods/ subdir.
Fix missing #include in reader.c.
2012-07-14 13:42:30 -05:00