3 ms·
FP in Python is rather weak. Even JS does a better job there. Some of the code exercises will need completely different solutions than in Scheme, due to not hav
by zelphirkalt 2y ago
FP in Python is rather weak. Even JS does a better job there.
Some of the code exercises will need completely different solutions than in Scheme, due to not having TCO.
What do instructors do, when their 1 to 1 translated code fails? Tell the students, that due to the choice of language it does not work that way, and that they simply need to believe it? Or do they treat it all as externalize the stack problems and solve it that way?
It seems rather silly to force SICP into Python.
- agent281 2y agoPyret would be a good alternative. It's designed for education by racketeers. https://pyret.org/ https://pyret.org/
- FreakLegion 2y agoCPython doesn't do TCO, but you can implement it yourself in Python. This version is one of my all-time favorite StackOverflow answers: https://stackoverflow.com/questions/13591970/does-python-optimize-tail-recursion/18506625#18506625 https://stackoverflow.com/questions/13591970/does-python-opt...
- zelphirkalt 2y agoLooks like trampolines inside Y combinator. Interesting approach. Still of course with its own costs. I think some of the Scheme in JS implementation(s?) use trampolines as well, or at least considered doing that.