←back to thread

193 points ingve | 1 comments | | HN request time: 0.346s | source
Show context
michalsustr ◴[] No.43713518[source]
I’m not familiar with Haskell concurrency. The combination of green threads and large memory allocations due to immutable data structures sounds like it would be hard to implement a web server handling 10k+ concurrent requests on commodity hardware?

Btw. too bad author talks about microsecond guarantees usage but does not provide a link, that would be interesting reading.

replies(7): >>43713603 #>>43713615 #>>43713878 #>>43714039 #>>43715073 #>>43716268 #>>43724017 #
eru ◴[] No.43713603[source]
> [...] large memory allocations due to immutable data structures sounds [...]

Why would there be large memory allocations because of immutable data structures? Btw, you can also use immutable data structure in eg Rust fairly easily. And Haskell also supports mutation and mutable data structures.

However, Haskell can use a lot of memory, but that's more to do with pervasive 'boxing' by default, and perhaps laziness.

replies(1): >>43713874 #
nesarkvechnep ◴[] No.43713874[source]
No reason. OC probably thinks that immutable data structures are always copied when being operated on.
replies(1): >>43714389 #
michalsustr ◴[] No.43714389[source]
Yes indeed, unless you use ropes or other specialised structures
replies(4): >>43714422 #>>43715066 #>>43715416 #>>43724028 #
1. tasuki ◴[] No.43714422[source]
Doesn't it depend on the data structure? Eg prepending to a list is actually cheaper with immutable data structures: you keep the original list and add a new head pointing to its head. Now you have two lists available in your program, but only one stored in memory. Yay!