porting python to C++
by hub, Wednesday 13 September 2006 at 22:02 :: Gnome :: #451 :: rss
Lennart has been playing with Cairo. I have been playing with porting Python to C++, and I ported this scripts. It was not that hard as 2 of the bugs were due to the Python-esque indentation (yes scoping with indentation, what a nice idea), one is due to C being permissive (stupid typo), and the last due to a bad transcription when the Python binding of Cairo tranfsorm cairo_text_extents_t
from a struct with named fields to an array with index...
Otherwise the biggest technical issue was to modify a bit the data types that use Python list to something that works with C++. I used the standard C++ library and a few of boost classes like boost::shared_ptr
and boost::format
.
Get the source: fring.cpp Build it with
g++ `pkg-config --libs --cflags cairomm-1.0` fring.cpp -g -o fring
Maybe it would be worthwhile to be write a small library that help porting from Python.
Comments
Thursday 14 September 2006 01:20, by Bill Weepie :: #
Thursday 14 September 2006 08:01, by Stéphan K. :: #
Post a comment
Comments are closed.