Skip to content

Replace Boehm GC #17

@cryptocode

Description

@cryptocode

Bio currently use Boehm GC as the garbage collector.

While this has been a good stepping stone during the development of Bio, it must be replaced with a garbage collector written in Zig.

The first iteration will be a precise, non-moving mark/sweep allocator exposed through Zig's std.mem.Allocator interface.

The next iteration of Bio is a bytecode VM, and only the executor will use the tracing GC. The parser, macroexpander, and compiler will use regular arenas. This design keeps memory usage and GC pressure much lower during embedded API cases, where many cycles of compile/execution is common.

Bio can be used via an API, which must offer a clear separation of memory models. For example, after executing a Bio script, the host application can get an owned copy of the result by supplying an allocator.

There will likely be the concept of "host variables", which serves as GC roots as well. These are similar to top-level Bio variables, but they are directly accessible from the host via a simple put/get API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions