3 ms·
But it does disagree. Python is a dynamic language where essentially everything is indirect (an object). Hardcoding types and methods (so they compile to simpl
by danuker 4y ago
But it does disagree. Python is a dynamic language where essentially everything is indirect (an object).
Hardcoding types and methods (so they compile to simple/fast machine code as the video proposes) takes away flexibility (but you can do that with Cython by the way, but it is not nearly that popular).
- dgb23 4y agoI don’t know/use python. But I assume that it has hasmaps and vectors that are backed by something performant and possibly JITed? The table driven, static dispatch approach Muratori isn’t necessarily “hard coded” in the general case. It’s just data driven, or table driven as he puts it. It’s not less flexible as you can easier add (append!) new cases. In fact it reminds me of how I do it in higher level languages like JS and Clojure. Of course we’re paying a substantial performance tax when using higher level, dynamic languages. We’re paying that tax in order to get very tangible benefits. But we can still program in a way that is data oriented, simple and easy to work with by the compiler and runtime (JIT).