Hacker News new | ask | show | jobs
by simcop2387 2757 days ago
Couldn't find it easily, but what model are they using to make this dead-lock free as they advertise? I've seen a number of languages try to accomplish this same goal but usually with a huge caveat on what kinds of programs are allowed, or by randomly killing threads when a dead-lock is detected.
1 comments

If you understand why a purely functional language like Haskell rocks at parallelism without worrying about deadlocks, then: same answer here.

I'll agree this isn't ready yet to be the first example of functional parallelism in someone's life, but I'm pretty excited to play with this computational model.

Even with Haskell you can still have deadlocks [1]. They give you the tools to write code that you can prove won't have them, but restricting the kinds of programs you can write. But it's an opt-in thing, it's not a promise of the language that you can't do it. Rust is trying to do a similar thing, but it's still also possible to write yourself into a corner with deadlocks if you work against the feature.

Another language I saw recently that has this promise was Pony which uses an actor and message passing model to try to accomplish this but it doesn't actually prevent you from hitting the case, instead it'll just kill a random actor until the deadlock is gone [2]. This can work but it needs to be up front that you MUST write your software to be ready to be killed at any time and continue to function.

It's really an impossible situation to completely "solve", given that doing so would require a solution to the halting problem. So it's always a fun place for me to start looking at any new language if they talk about locks and dead-locks. So far I think Haskell and Rust (and probably other ML family) have the best balance being struck since you can opt in to statically proving this if you restrict those parts of your program but you're not required to do so by the language itself.

[1] https://www.fpcomplete.com/blog/2018/05/pinpointing-deadlock... [2] https://news.ycombinator.com/item?id=9485333