3 ms·
I'd like to know more about this. I would think that the constraints afforded by functional languages would allow lots of awesome compiler optimizations that ma
by weberc2 9y ago
I'd like to know more about this. I would think that the constraints afforded by functional languages would allow lots of awesome compiler optimizations that make relatively naive functional programs quite a bit faster than relatively naive imperative programs, but I often see imperative languages like Go outperform languages like Haskell and I'm not sure why. Also, reasoning about performance in Go is quite a bit easier than reasoning about Haskell, probably because the optimizations are more straightforward. These differences are particularly interesting to me because I'm building a toy functional language that compiles to Go.
- fasquoika 9y agoIf you want reliable performance, you should look at functional languages besides Haskell. Off the top of my head I'd say that Chez Scheme, OCaml, and MLton are all probably faster than Go
- weberc2 9y agoIn my experience, OCaml seems to perform worse than Go in most interesting singlethreaded cases, and obviously it completely lacks a good parallelism story. I can't speak to Chez Scheme or MLton, but I may check them out in the future. Thanks for the recommendation!
- ernst_klim 9y ago>OCaml seems to perform worse than Go in most interesting singlethreaded cases Could you provide an example?