Hey HN! I’ve been working on something that might change how we think about multithreading.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 requiredThe 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!
First seen: 2025-10-26 15:05
Last seen: 2025-10-26 15:05