3 ms·
> Functional programming experts say that their code is efficient because the compiler translates it to an efficient representation on the CPU. They have TCO an
by Akronymus 4y ago
> Functional programming experts say that their code is efficient because the compiler translates it to an efficient representation on the CPU. They have TCO and other things. But they don't mutate data and hence every function call creates a new data in memory taking up space. How do they overcome that?
By letting the compiler make assumptions. For example, consecutive map calls can be converted into a single one. If the data isn't shared with something else, the compiler can mutate it. MUCH easier to paralellize maps.
As a starting point for those nitty grittys, this talk is probably as good as any https://www.youtube.com/watch?v=vzfy4EKwG_Y https://www.youtube.com/watch?v=vzfy4EKwG_Y