4 ms·
This is where I'm really not clear. What makes Python harder to compile than Smalltalk (which had some native compilers - Smalltalk/X) or Objective-C?
by protomyth 14y ago
This is where I'm really not clear. What makes Python harder to compile than Smalltalk (which had some native compilers - Smalltalk/X) or Objective-C?
- loodno 14y agoWell nobody said it would be harder to compile. However the fact is that there is not a compiler for Python, so unless someone writes one that is a downside. Also, the semantics of Python would likely not lead to efficient compiled code anyway, when compared to something like C, Java, or even Haskell - static languages.
- maxerickson 14y agoThe corners of the language make it difficult to benefit from compilation. Per the language, things like the internals of an instance of a class can be manipulated at runtime, so the compiled output ends up needing to support the entire dynamic runtime. Cython and Nuitka (among others) do this to varying degrees.
- randomdata 14y agoDidn't Smalltalk basically invent the idea of being able to open up objects at runtime? Even Objective-C, with its strong Smalltalk ties, allows for runtime modification.
- scott_s 14y agoAny language with eval is probably going to, by default, be interpreted. You can compile a language with eval, but it means you'll need to stick the compiler into every binary with a program that calls eval.
- pnathan 14y agoCommon Lisp allows all sorts of internal runtime manipulation and is usually compiled to machine code. :-)