2 ms·
> ...manual loops instead of `map` and `reduce` and `filter`... ...you're free to implement such functions in a Zig/Odin/Nim library as well, but in the end it
by flohofwoe 3y ago
> ...manual loops instead of `map` and `reduce` and `filter`...
...you're free to implement such functions in a Zig/Odin/Nim library as well, but in the end it's just another way to loop over data, and inside your own implementation there will be regular loops, so why bake this stuff into the language when it can be done just as effciently in a library.
- pjmlp 3y agoThis is only possible if the language is powerfull enough to express such things as library types, and the optimizer good enough to ellide them. Only then it can be done "just as effciently in a library.".