*caution* severely OT!!

Alejandro Imass ait at p2ee.org
Tue Sep 13 19:51:11 UTC 2011

On Tue, Sep 13, 2011 at 3:34 PM, Gary Kline <kline at thought.org> wrote:
> guys,
> can anyone start me on the way of porting a python program to C?
> tia,

Porting as in re-write and it will depend on the complexity and
perhaps objective/motivation of such rewrite.

In any case, you will have to re-write the program in C from scratch
using the original program only as reference.

If your objective is performance, perhaps it's better analyze the
bottle necks of the current program and port only those section to C
by means of a shared-object lib. I do this with Perl and XS. I dunno
how it's done in Python but I understand it's just as easy. Python and
Perl and many of the so-called "scripting languages"are actually byte
compiled and have very good performance so it may make more economic
sense to go for hybrid solution instead of a full re-write to C.

If your objective is having a single executable with a few
dependencies, then you could settle for something like Perl PAR but
for Python.

If your objective is distributing closed-source binaries then you have
to re-write to a fully compiled language such as C.

Can you shed some light on why you want to do this?


> gary
> --
>  Gary Kline  kline at thought.org  http://www.thought.org  Public Service Unix
>           Journey Toward the Dawn, E-Book: http://www.thought.org
>          The 8.51a release of Jottings: http://jottings.thought.org
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

More information about the freebsd-questions mailing list