>>29
You can still have some dynamic shit and statically compile stuff -- Sepples is a shit example of this with shitty RTTI. Haskell is probably a better example -- dynamic typing via inference can be compiled statically.
The Starkiller project
1,2 which I've mentioned a couple of times was a static type inferencer for Python. It works in almost every sane place, except when you're doing weird shit like dynamically importing modules and calling
eval. I think there were also some issues resolving the dynamic scope (which is an issue, considering dynamic name resolution is a serious bottleneck in Python interpreters) but I can't find any references.
And, as I've fucking mentioned before, Psyco
3 is a fucking crazy JIT for Python which caches the exact instructions executed by the interpreter when functions are called, then replaces the functions with those cached instructions such that future calls don't touch the interpreter at all. It does some hackish shit to work around the dynamic bits, but the end result is that code which the interpreter would bottleneck (tight loops and numeric shit) gets an incredible speedup.
AFAIK, Psyco only works on x86 machines and doesn't play nicely with embedded Python though (it definitely doesn't work for
mod_python, which is where I wanted to use it).
As far as performance is concerned, last I checked PyPy hadn't really produced any results
4 (though it hopefully will, eventually). It's got some damn cool sandboxing features
5 though.
Anyway, did any of you faggots have something to discuss other than "BAWWWWW PYTHON ISN'T C AND DOESN'T PRODUCE NATIVE BINARIES YET"?
[sup]References:
[1]
http://web.mit.edu/msalib/www/urop/
[2]
http://www.sauria.com/~twl/conferences/pycon2004/20040324/Starkiller.txt
[3]
http://psyco.sourceforge.net/
[4]
http://tuatara.cs.uni-duesseldorf.de/benchmark.html
[5]
http://codespeak.net/pypy/dist/pypy/doc/sandbox.html