4 ms·
While I see the value in optimizing a language for these "language-enhancements" such as adding new iterators, I would be concerned about a language architect w
by cduan 19y ago
While I see the value in optimizing a language for these "language-enhancements" such as adding new iterators, I would be concerned about a language architect who sacrificed efficiency in other areas as a result. I'd much rather have blazing-fast each() alone over medium-speed each(), map(), fold(), unfold(), collect(), etc.
(Sidenote: isn't it a little unfair to compare the collect() implementation, which uses a for-loop, with a recursive unfold() method? Though I don't doubt that the iterative unfold() version would still be relatively slow.)
- shiro 19y agoSo the Right Thing is a language that allows to extend by itself, and makes such extensions run blazingly fast as well. It's been done in some languages (like the one with lots of ()'s) and I don't think there's an inherent obstacle for Ruby to do so, though it would take time. I don't think they should sacrifice speed for extensibility now, but it'd be nice to aim at both as long-term goals.