You might remember W++ — a chaotic scripting language I originally built on .NET. Well, I’ve rewritten it from scratch in Rust + LLVM, and accidentally invented something new: a garbage collector for threads.
Instead of leaving OS threads to manual management, W++ treats them as heap objects. They’re reference-counted, swept, and safely cleaned up — just like any other GC value.
Highlights: • Threads are managed with `Arc` + `Weak` and collected by a background daemon • `GcMutex` auto-unlocks if its owning thread dies • Thread ancestry tracking prevents recursive spawns • A background GC thread periodically joins finished threads • All compiled to native LLVM IR — no VM required
The result? No zombie threads, no deadlocks that outlive their owner, and no manual joins.
It’s experimental, not perfect — but it works. If you’ve built runtimes or GCs before, I’d love your thoughts.
GitHub: https://github.com/sinisterMage/WPlusPlus Feedback, critique, or “you’re insane but I love it” comments welcome!