News for hackers. Stuff that matters.
Re:Java Virtual Threads: A Case Study by whateveracct on Wednesday July 17, 2024 @10:14AM (#40986186)
What problems exactly? Haskell has a few things that imo it does better than most languages in this area:

- All IO is non-blocking by default.

- FFI support for interruptible.

- Haskell threads can be preempted externally - this allows you to ensure they never leak. Vs a goroutine that can just spin forever if it doesn't explicitly yield.

- There are various stdlib abstractions for building concurrent programs in a compositional way.

Re:Java Virtual Threads: A Case Study by kbolino on Wednesday July 17, 2024 @05:53PM (#40990707)
> Haskell threads can be preempted externally - this allows you to ensure they never leak. Vs a goroutine that can just spin forever if it doesn't explicitly yield.

Goroutines are preemptible by the runtime (since https://go.dev/doc/go1.14#runtime) but they're still not addressable or killable through the language itself.

Re:Java Virtual Threads: A Case Study by whateveracct on Thursday July 18, 2024 @02:04AM (#40992892)
The GHC runtime has lots of cool concurrency features.

Async exceptions as a way to pass messages (and kill threads!)

Allocation limits for threads.

Software Transactional Memory.