I found Lobster the same way as @ducktape (V discord), and decided to put it to 
the test with a difficult memory management challenge, a persistent balanced 
tree... difficult because there is no clear ownership model: structure is 
shared among all versions of the tree, and rebalancing makes link tracing 
non-trivial.

I happened to have an [implementation in 
Nim](https://github.com/dcurrie/nim-bbtree/blob/master/src/bbtree.nim) that I 
[ported to 
Lobster](https://github.com/dcurrie/lobster-bbtree/blob/master/bbtree.lobster).

The memory management worked well in both Nim (default gc) and Lobster.

The Lobster type inference/checker separates nillable and non-nillable versions 
of reference types, so several changes were needed to convince Lobster that 
references wouldn't be nil. The Lobster generic type inference is interesting 
to explore: typical Lobster code is very lightly annotated with types, if at 
all.

Reply via email to