Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

Yes. Concurrency is easier in functional languages.

Many of them provide a concurrency monad which allows you to write expressions like this:

   read_from_socket_into_buffer params >>= 
   process_buffer >>= 
   ...
Where you roughly read the '>>=' as follows: "the left side might take an arbitrary amount of time to produce a result. While it's off and doing its thing, go and do something else. Once it has produced the result, take it and feed it as a parameter to function on the right."

BTW, It's quite easy to implement your own concurrency monad, however: the real work is the wrapping of all the blocking system calls into this framework.



This sounds a bit like async in some other languages.


Lots of functional language featured end up copied into traditional languages (monads, immutability, pattern matching, lambdas, etc). The difference is that these are almost always more ergonomic in a functional language that was designed with these features in mind vs. having them bolted on afterwards




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: