sunjay / brain

A high level programming language that compiles into the brainfuck esoteric programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic Memory Allocator

sunjay opened this issue · comments

This is the beginning of being able to have dynamically allocated objects in brain (instead of the static things we have now).

We need a malloc-esque API for memory allocation (without the downsides)

Once we have this kind of "heap" memory, not every type will be copy anymore. The code generation will need to be fixed to only copy when it is appropriate.

The heap could start at the index before 0 since all static allocation happens to the right of that and the Brainfuck tape is infinite in both directions.

Resources: