4 ms·
nice hack returning the next function in the chain. As a FSM user I will probably need this someday.
by danbmil99 18y ago
nice hack returning the next function in the chain. As a FSM user I will probably need this someday.
- adamc 18y agoAs the comments mention, it's an old technique called a trampoline.
- magv 18y agoI am surprised (and to some extent disappointed) that he did not know about trampolines, as it's common knowledge among language implementors (e.g. it's used everywhere to implement proper tail recursion for FFI calls). Somehow I though that being a language creator (or working on a compiler for a decade) implies unimaginable amount of knowledge...
- eru 18y agoGuido didn't even know about ephemeral and persistent data structures (see early comments at [1]). At least not by that name. But that's not a problem. Python, Perl etc have caught on, while Haskell has still a long way to go. [1] http://neopythonic.blogspot.com/2009/04/tail-recursion-elimination.html http://neopythonic.blogspot.com/2009/04/tail-recursion-elimi...
- briancooley 18y agoDoing a lot trumps knowing a lot, even when you make mistakes. It's amazing what GVR has accomplishled despite (apparently) being ignorant of things other language designers know about.
- 10ren 18y agoAnother point of view is to be disappointed in language theory, if one can be so incredibly successful without it. Reminds me of Edison.
- parenthesis 18y agoI think GvR's special expertise is more in the 'user-interface' of programming languages than in their implementation. The whole point of Python, really, is to put the former before the latter; which is exemplified in GvR's 'readable-stack-traces before fancy-features-in-the-implementation' reasoning on the present point.
- 10ren 18y agoEven if you’re designing for professional programmers, in the end your programming language is basically a user-interface design. You will get much better results regardless of what you’re trying to do if you think of it as a user-interface design. Alan Kay http://queue.acm.org/detail.cfm?id=1039523 http://queue.acm.org/detail.cfm?id=1039523
- Hexstream 18y agoIf he hadn't built so much, he might have had time to learn all that "theoretical" stuff (that can actually help in practice)...
- amalcon 18y agoI was just starting some state-machine code in Clojure last night, thought about how to best do it functionally (recur doesn't let you cross function boundaries), and said out loud "I'll use a trampoline!" If that happens again, I can tell the person I confused not to feel badly, because even Guido van Rossum didn't know about trampolines until recently.
- alphazero 18y agoRich Hickey discussed his using the trampoline pattern in the clojure implementation a while ago: http://groups.google.com/group/clojure/browse_thread/thread/6257cbc4454bcb85/4a21ea1a1cc725a4 http://groups.google.com/group/clojure/browse_thread/thread/...