Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×

Python-to-C++ Compiler 181

Mark Dufour writes "Shed Skin is an experimental Python-to-C++ compiler. It accepts pure, but implicitly statically typed, Python programs, and generates optimized C++ code. This means that, in combination with a C++ compiler, it allows for translation of pure Python programs into highly efficient machine language. For a set of 16 non-trivial test programs, measurements show a typical speedup of 2-40 over Psyco, about 12 on average, and 2-220 over CPython, about 45 on average. Shed Skin also outputs annotated source code."
This discussion has been archived. No new comments can be posted.

Python-to-C++ Compiler

Comments Filter:
  • Ewwwww (Score:3, Funny)

    by $RANDOMLUSER ( 804576 ) on Thursday June 15, 2006 @01:25PM (#15541375)
    As a UNIX admin, I was saddled with one of these kinds of things years ago, a DEC-BASIC to C compiler for UNIX. The output code quality was incredibly bad: machine generated variable and function names, bizarro nested struct/union/struct data structures, 400-line functions peppered with calls to 1-line functions. Completely unreadable. Thank $DEITY that project died quickly.
  • Re:Ewwwww (Score:2, Funny)

    by Virak ( 897071 ) on Thursday June 15, 2006 @01:35PM (#15541489) Homepage
    Which is why I suggest you use brainfuck for all your coding needs. The generated code will make just as much sense as the original, if not more.
  • by kpharmer ( 452893 ) on Thursday June 15, 2006 @06:58PM (#15544751)
    Assume that it takes:
        - 4 hours to write a given program in python, 32 hours to write same program in C++
        - 10 seconds to run the python program, but just 2 seconds to run the faster C++ program
        - the program is run 20 times a day
        - assume the developer time costs as much as the the time of the person that runs it

    Ok, so it'll take 630 days of running this program for the faster C++ program to make up for the extra time to develop it. So, if you can wait two years for a payback then C++ is the way to go, otherwise code it in python.

    There that was easy. Ok, any other simple problems out there? Which editor you should use? What's just the right amount of comments per program? Which is better - cvs or subversion?

"If it ain't broke, don't fix it." - Bert Lantz

Working...