Show HN: W++ – Garbage-Collected Threads

Share This Post

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 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!


Comments URL: https://news.ycombinator.com/item?id=45655920

Points: 1

# Comments: 0

Source: news.ycombinator.com

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Windows Securitym Hackers Feeds

Will AI lengthen lifespans or shorten them?

Article URL: https://www.ft.com/content/eac9e5e4-5401-4411-9a69-c037b609c0cb Comments URL: https://news.ycombinator.com/item?id=45691380 Points: 1 # Comments: 0 Source: www.ft.com

Do You Want To Boost Your Business?

drop us a line and keep in touch

We are here to help

One of our technicians will be with you shortly.