4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
I think you are misunderstanding. To put it another way: because, in C, the optimisation is not guaranteed, recursion is rarely used in practice. This is a shame as many problems do have a recursive structure and are best solved using recursion. It's probably the best decision for C, but not for a high-level language.
comment 2y ago · link · parent
comment 2y ago · link · parent
I'm actually quoting Prof Andrew Appel of Princeton: https://www.cs.princeton.edu/~appel/papers/ssafun.pdf
You seem to think that functional programming and in-place updates are mutually exclusive. This is not the case, e.g. Haskell supports mutation as a tracked and controlled side-effect. It can even give static guarantees that a function is pure even it uses mutation internally. Recent research even suggests that compilers can add the in-place updates for us: https://www.microsoft.com/en-us/research/publication/fp2-ful...
comment 2y ago · link · parent
comment 2y ago · link · parent
As for Haskell, it does pretty well being 100 times faster than Python with 100 times less the number of people working on it.
comment 2y ago · link · parent
comment 2y ago · link · parent
Some of these checks could be removed by languages with better compilers and likely more restrictions. That is the better approach. As a user, I don't want to run code that is potentially unsafe and/or insecure.
comment 2y ago · link · parent
comment 2y ago · link · parent