How close can pure functional programming get to C?
rtfeldman.com - 94 poäng - 9 kommentarer - 17810 sekunder sedan
Kommentarer (5)
- jandrewrogers - 10772 sekunder sedanMuch of the difference in optimizability is that C/C++ allows you to do fairly extreme copy elision. This is important because memory bandwidth tends to be a major performance bottleneck.
C/C++ code can trivially reach into some remote bit of state and mutate it directly. The compiler rarely objects, no matter how ugly the access method or pattern. It is up to the programmer to make sure the invariants hold and the compiler can’t always see through it. These elided copies add up, though it usually has a maintainability and safety cost.
It is related to why functional languages tend to be mediocre for supercomputing in practice despite having nice properties for massive parallelism in theory.
- pmkary - 144 sekunder sedanThis is kind of hacker news post and comments I like; extreme languages on extreme performance with extreme features, not types being added to a language ten gizzilion times slower than a tortoise and the post making anti-type flat-earthers getting freaked out if they have to vaccinate next.
- jeffbee - 9640 sekunder sedanThis seems to raise the question: is libdeflate fast? My overall impression of libdeflate is that it produces a similar output size to zstd but takes 40 times longer to do it. I realize these are different algorithms of course, but they aren't that different, both being in the Huffman line of the LZ family. So why is libdeflate considered a performance benchmark?
- eigenblake - 12746 sekunder sedanI'm very simple. I see Richard Feldman post. I like it. I'll leave it to the experts as to whether this is a case of opportunistic mutation.
- jdw64 - 9558 sekunder sedanWhat are some well known programs made with Roc? And I'm curious about the difficulty level of its syntax
Nördnytt! 🤓