add an extra global that is never defined; this is used to handle names that never...
[pythonc.git] / README.txt
blob4f85500942c90f11505a65b6c714d701173e241c
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.
9 You have been warned.
11 The translator is released under the GPLv3.
13 The C++ backend, used by the generated code, is released under the Apache license.
15 Details
16 =======
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.
24 Some near-term plans:
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
31 Some long-term plans:
32 Remove all use of the STL
33 Use C instead of C++
35 Python support
36 ==============
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)
53 Exceptions
54 Floating point
55 Imports/the entire standard library
56 Useful error messages
57 Several cases of complex compound expressions (e.g. assigning to slices)
58 Generators
59 Operator overloading