3 ms·
Python has some issues that can really interfere with doing Scheme-style FP in in it (no tail-call optimization, single-expression-only lambdas, closure/scope p
by silentbicycle 18y ago
Python has some issues that can really interfere with doing Scheme-style FP in in it (no tail-call optimization, single-expression-only lambdas, closure/scope problems, general hostility from Guido), but IMHO it's a great general-purpose language, and well suited to teaching, particularly for introducing higher-order functions.
Lua has much more Scheme influence than Python does (while being otherwise pretty similar). Its design assumes proficiency with C, however, so, while very practical, it's probably not as good a language for people new to programming.
- jerf 18y agoYeah, that's why I called it "what they used to call functional programming". Functions are first-class values and closures are easy to get at. (Some people quibble with the exact implementation, but they are definitely there. Such people will be happier with Python 3.0, but still not entirely satisfied.) This is what "functional programming" used to mean. Now it means having immutable values, tail recursion, easy lambdas, powerful type systems, and so on. There's a clear historical progression from past to present, but there's still been changes in what the term means over time which means that different people mean different things by "functional programming" if they don't clarify.
- silentbicycle 18y agoAgreed. I originally said "lisp-style", but changed it to "scheme-style" for just that reason.
- abecedarius 18y agoI didn't miss tail-call optimization much when I studied SICP using XLisp back in the 80s (with 640kb of memory) -- only a couple exercises blew the stack and made me add a while loop. Of course it matters more for real programming on real data, and I agree with your comment generally.