evincarofautumn / kitten

A statically typed concatenative systems programming language.
http://kittenlang.org/
Other
1.08k stars 39 forks source link

Does kitten require garbage collection? #193

Closed AnthonyJacob closed 6 years ago

evincarofautumn commented 6 years ago

Nope.

The plan is that boxed lists ([…], List<T>) and closures ({…}) are reference-counted, unboxed arrays ([|…|], Array<T, N>) and closures ({|…|}) won’t allocate, and since there’s no mutation at the moment, you can’t make reference cycles. If I add a mutable reference type, you’ll be responsible for avoiding cycles or manually breaking them with weak references (as in C++ and Rust).

And basically the only thing required from libc is malloc & free, so I want to make it possible to swap out the allocator or disable it if you’re writing low-level code; there will be a permission +Alloc, granted by default, which you can disable with -Alloc if you want to write code that’s not allowed to allocate on the heap.

Of course, this all depends on me actually working on the thing. :P