4 ms·
Shed Skin: An experimental (restricted) Python-to-C++ compiler
- algorias 17y agoSounds like an interesting project. I wonder, however, if writing code in this subset of python is better than directly using a compiled, statically typed language. The subset is just so tiny. No a and *k, no nested functions. Most decorators won't work either.
- pgbovine 17y agoIf you're concerned about the loss of expressiveness, a related project to look into is RPython, which afaik allows you to program in a less restricted subset of Python and still compile down to efficient C code. When writing in RPython, you break your program down into 2 phases: 1.) An initialization phase which is PURE Python, so you can do all the dynamic/introspective/metaprogramming magic you want 2.) A main phase which is a restricted static subset of Python, which is much more Java/C#-like Here's an abstract and paper about it: http://www.disi.unige.it/person/AnconaD/papers/Recent_abstracts.html#AACM-DLS07 http://www.disi.unige.it/person/AnconaD/papers/Recent_abstra...
- liuliu 17y agoIt is interesting to see how the author handle memory management issue.