Internet C++ and Python?
dsh8290 at rit.edu
Fri Nov 17 15:29:55 CET 2000
At the moment I disagree with adding static type declarations. For a while, however, coming from an Eiffel/C++/Java/C background I thought it would improve it. The lack of type declarations is what allows python to be so dynamic and require so much less typing than the other OO langagues mentioned above. Take for example orbit-python. (or maybe the other python corba wrapper, I forget which is which) It will read and parse the idl files at runtime and create the appropriate python type for the user. How would this be possible in a statically-typed language? Also, how much effort and pain do programmers have to go through sometimes to make a C++/Java program compile without complaining about type mismatches? Even if the types are fully compatible, you must do stuff with inheritance and interfaces, etc. to make it compile. Python is really cool by allowing you to substitute a compatible class without doing any more work than necessary.
A more optimizing byte-compiler would be cool, but I would rather not sacrifice the power of python for speed. That's what the other languages are for.
Perhaps requiring a declaration of variables (aka limitiation of namespace) would increase effiiciency? (though I haven't profiled it at all)
(what I mean is a typeless decl. of the form """local foo, fubar""" that would cause the statement """foobar = None""" to not compile)
On Fri, 17 Nov 2000 06:11:03 Jochen Schmidt wrote:
| Courageous wrote:
| > I've heard Vyper is faster than vanilla Python. But that aside, I believe
| > you will have to wait on some fairly heavy-duty compiler technology,
| > man. Getting dynamic languages to perform well is a black art.
| I wonder often why some many people think that adding type-declarations
| to python would be so difficult!
| Maybe it would help the language-designers to take a deep look at
| CommonLisps type-declaratiions.
| Then it could be that those often heard "need for _static_ type-declarations
| " is counted as nonsense as it is.
| Adding CommonLisp-like declarations to python should be a very simple
| and backwards-compatible solution that makes incremental development of
| an really optimizing python-compiler possible.
More information about the Python-list