1 Pythonc--Python to C++ translator
3 Copyright 2011 Zach Wegner
5 Pythonc is pronounced like "Pie Thonk", for obvious reasons.
7 It currently translates some nontrivial subset of Python code into C++. No
8 claims are made about the correctness or efficiency of the generated code.
11 The translator is released under the GPLv3.
13 The C++ backend, used by the generated code, is released under the Apache license.
17 Pythonc is intended to be a translator of a very simple subset of Python,
18 suitable for use in embedded applications.
20 Eventually, the translator will be able to optimize the code substantially
21 while translating. A speed somewhere close to C++ is expected. Sound ridiculous?
22 Of course it does. But we'll just have to wait and see.
25 Improve the memory management
26 Restructure the front end so most logic is in the syntax.py domain
27 Do lots of simple but effective optimizations during translation
28 Fill in enough of the Python builtins/simple modules to not care anymore
29 Clean up the back end code
32 Remove all use of the STL
37 Pythonc has only been tested to work with Python 3. It could quite possibly
38 work for Python 2 though. The subset of Python implemented is hardly distinguishable
39 as Python 2 or 3, except that "print" is a function.
41 It uses the Python ast module to parse the Python code.
43 There are just a few places with incompatibilities:
44 All integers are signed 64-bit ints
45 Str/bytes are the same thing
46 Tuples/lists are the same thing
47 Genexps/list comprehensions are the same thing
48 Probably a bunch of other little things
50 Some things it doesn't support as of now:
51 Classes with inheritance
52 Any dynamic features (introspection/runtime code generation)
55 Imports/the entire standard library
57 Several cases of complex compound expressions (e.g. assigning to slices)