top | item 45962386

(no title)

vinkelhake | 3 months ago

This felt like a blast from the past. At a few times reading this article, I had to go back and check that, yes, it's actually a new article from the year 2025 on STM in Haskell and it's even using the old bank account example.

I remember 15 or 20 years (has it been that long?) when the Haskell people like dons were banging on about: 1) Moore's law being dead, 2) future CPUs will have tons of cores, and 3) good luck wrangling them in your stone age language! Check out the cool stuff we've got going on over in Haskell!

discuss

order

lmm|3 months ago

Yeah, remember when we used to care about making better programming languages that would perform faster and avoid errors, instead of just slapping blockchains or AI on everything to get VC money. Good times.

doliveira|3 months ago

Only half-joking: maybe Java was a mistake. I feel like so much was lost in programming language development because of OOP...

mrkeen|3 months ago

And it's all still true, although I would offer the usual argument that concurrency!=parallelism, and if you reach for threads&STM to try to speed something up, you'll probably have a bad time. With the overhead of GC, STM-retries, false-sharing, pointer-chasing, etc you might have a better time rewriting it single-threaded in C/Rust.

STM shines in a concurrent setting, where you know you'll multiple threads accessing your system and you want to keep everything correct. And nothing else comes close.

exasperaited|3 months ago

To be maximally fair to the Haskell people, they have been enormously influential. Haskell is like Canada: you grow up nicely there and then travel the world to bring your energy to it.

VBprogrammer|3 months ago

Yeah, I wrote an essay on STM in Haskell for a class back in 2005 I think.

dist-epoch|3 months ago

I think Intel x86 had some hardware support for STM at some point. Not sure what's the status of that.

PhilipRoman|3 months ago

Disabled on most CPUs, plagued by security issues. I haven't used it but I assume debugging would be extremely painful, since any debug event would abort the transaction.

kragen|3 months ago

That's not software transactional memory, it's hardware transactional memory, and their design was not a good one.