Code Monkey home page Code Monkey logo

tinypy-1's Introduction

64k tinypy
"batteries not (yet) included"
Copyright (c) 2008 Phil Hassey

Check it out:

$ python setup.py linux pygame
$ ./build/tinypy examples/julia.py
$ ./build/tinypy your-program-goes-here.py

Depends on:
- python (only for bootstrapping)
- sdl (for the pygame module)
- gcc

Credits:
    - math module - Rockins Chen <[email protected]>
    - VS support - Krzysztof Kowalczyk
    - bug fixin' - Dean Hall & Allefant

Thanks to allefant and the python community for all the tips and feedback!
Thanks to John M. for a python 2.5 compat. patch.
And to illume and the rest of #ludumdare for morale support.
Also thanks to python.org, lua.org, valgrind.org, nekovm.org, pypy.org
http://javascript.crockford.com/tdop/tdop.html
http://www.memorymanagement.org/articles/recycle.html
http://shed-skin.blogspot.com/

Other "tiny" python implementations:
http://pymite.python-hosting.com/
http://students.ceid.upatras.gr/~sxanth/pyvm/

F.A.Q.s:

Q. If I run boot.py it says you've got like 80k of code!  That's TOTALLY
    not 64k!  I want my money back.
A. Err... that's true.  But 64k sounds *SO* much better than 80k.
    If you *really* want it to be 64k, just run:
    $ python mk64k.py
    This does the following things:
        - changes 4 spaces into tabs and removes blank lines
        - removes comments
        - removes the "namespacing" i.e. "tp_print" becomes "print"

Q. The binary is bigger than 64k.  I hate big binaries.
A. I don't really care, but if you run "upx tinypy" it makes the tinypy
    binary smaller than 64k.

Q. No matter how you spin this, it's just plain NOT 64k.
A. Let the buyer beware?  I dunno, it's close enough.  Let's call it a rounding
    error, shall we?

Q. How come some oddball combinations of variable and named arguments don't work?
A. Ask me some other time.  Short answer: I do it like lua does it.  Only calls
    like this make sense:
        call_with_var_args(a,b,c,*d)
        call_with_named_args(a=b,**c)
    mixes of both just don't work, sorry!

Q. At the end of build.py tinypy doesn't work!
A. This is probably because of my use of -O3 in the final step.  Run the command
    again without -O3.  Some versions of GCC are buggy and don't do well with it.

tinypy-1's People

Watchers

weimingtom avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.