Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1913 | jaeger | 1 | 64k tinypy |
2 | "batteries not (yet) included" |
||
3 | Copyright (c) 2008 Phil Hassey |
||
4 | |||
5 | Check it out: |
||
6 | |||
7 | $ python setup.py linux pygame |
||
8 | $ ./build/tinypy examples/julia.py |
||
9 | $ ./build/tinypy your-program-goes-here.py |
||
10 | |||
11 | Depends on: |
||
12 | - python (only for bootstrapping) |
||
13 | - sdl (for the pygame module) |
||
14 | - gcc |
||
15 | |||
16 | Credits: |
||
17 | - math module - Rockins Chen |
||
18 | - VS support - Krzysztof Kowalczyk |
||
19 | - bug fixin' - Dean Hall & Allefant |
||
20 | |||
21 | Thanks to allefant and the python community for all the tips and feedback! |
||
22 | Thanks to John M. for a python 2.5 compat. patch. |
||
23 | And to illume and the rest of #ludumdare for morale support. |
||
24 | Also thanks to python.org, lua.org, valgrind.org, nekovm.org, pypy.org |
||
25 | http://javascript.crockford.com/tdop/tdop.html |
||
26 | http://www.memorymanagement.org/articles/recycle.html |
||
27 | http://shed-skin.blogspot.com/ |
||
28 | |||
29 | Other "tiny" python implementations: |
||
30 | http://pymite.python-hosting.com/ |
||
31 | http://students.ceid.upatras.gr/~sxanth/pyvm/ |
||
32 | |||
33 | F.A.Q.s: |
||
34 | |||
35 | Q. If I run boot.py it says you've got like 80k of code! That's TOTALLY |
||
36 | not 64k! I want my money back. |
||
37 | A. Err... that's true. But 64k sounds *SO* much better than 80k. |
||
38 | If you *really* want it to be 64k, just run: |
||
39 | $ python mk64k.py |
||
40 | This does the following things: |
||
41 | - changes 4 spaces into tabs and removes blank lines |
||
42 | - removes comments |
||
43 | - removes the "namespacing" i.e. "tp_print" becomes "print" |
||
44 | |||
45 | Q. The binary is bigger than 64k. I hate big binaries. |
||
46 | A. I don't really care, but if you run "upx tinypy" it makes the tinypy |
||
47 | binary smaller than 64k. |
||
48 | |||
49 | Q. No matter how you spin this, it's just plain NOT 64k. |
||
50 | A. Let the buyer beware? I dunno, it's close enough. Let's call it a rounding |
||
51 | error, shall we? |
||
52 | |||
53 | Q. How come some oddball combinations of variable and named arguments don't work? |
||
54 | A. Ask me some other time. Short answer: I do it like lua does it. Only calls |
||
55 | like this make sense: |
||
56 | call_with_var_args(a,b,c,*d) |
||
57 | call_with_named_args(a=b,**c) |
||
58 | mixes of both just don't work, sorry! |
||
59 | |||
60 | Q. At the end of build.py tinypy doesn't work! |
||
61 | A. This is probably because of my use of -O3 in the final step. Run the command |
||
62 | again without -O3. Some versions of GCC are buggy and don't do well with it. |