Mastodon Feed: Post

Mastodon Feed

dysfun@treehouse.systems ("gaytabase") wrote:

made some decisions on littlegem today:

there will (probably) be a Heap<T> type for refcounted heap references in the vein of smart pointers. the compiler will insert refcount operations as appropriate in the style of koka's perceus (albeit likely with a modified algorithm), meaning it can compile without need of a large support library while having something akin to garbage collection (no cycle busting).

the default mode will thus be unboxed and if you want heap things, you can have them with the smart pointer and the integrated compiler support. there can of course be other types of smart pointer and this gives us a way both to flatten nested structs into a single allocation and a natural place to plug in raw pointers or such for use in unsafe code later.
Heap<T> does make you think about whether it should be on the heap or not, but that's about it, the compiler does most of the work

i think we are going to end up with more powerful types than i was thinking yesterday. possibly ones i will have to learn how to implement 😅 i just don't think i'd have it any other way. i will make sure the simple case is simple of course.