[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Language converters to C



gopat@iserv.net (Patrick Mc Govern) writes:

> Are there programming language filters that can convert say an
> Awk program to C code?

If nothing else you could run a2p (awk to perl) and then send the
resulting code through the perl compiler.

> Not only would this be handy to use faster code,

Well, not in the above case.  It would run only at perl's speed
(which is a fair bit faster than awk, true :-)

> it would also be a good way to learn how to code in C by example.

In general, probably not.  Machine-generated source code is usually
barely human-readable and surely would not serve as a paragon of
coding style.  Think thousand-line-long switch statements :-)

There's plenty of good sample code out there...
--
        Jamie McCarthy
        jamie@mccarthy.org
 http://jamie.mccarthy.org/