Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > [OT] Perl to C Converter?

Reply
Thread Tools

[OT] Perl to C Converter?

 
 
Alan Connor
Guest
Posts: n/a
 
      08-22-2004


There's this utility called html2ps that's written in perl, but
the box I want to run it on doesn't have room for perl. It does
have room for a C compiler.

Be nice if I could find a tool that converted perl to C.

Thanks in advance for any help.

(running debian linux here)

AC

 
Reply With Quote
 
 
 
 
Alan Connor
Guest
Posts: n/a
 
      08-22-2004
On 22 Aug 2004 09:50:52 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:
>
>
> "Profetas" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed) alkaboutprogramming.com>...
>> > Alan Connor wrote:
>> >>
>> >> There's this utility called html2ps that's written in perl, but
>> >> the box I want to run it on doesn't have room for perl. It does
>> >> have room for a C compiler.
>> >>
>> >> Be nice if I could find a tool that converted perl to C.
>> >
>> > The tool exists, its called "a programmer who knows perl and C".

>>
>> I have done some research on this topic and I couldn't find any

>
> LOL!


There are utilities for converting one programming language to another.

Lots of them. For major and minor languages.

(The very program I am referring to above, html2ps, is
such a program. HTML is a language understood by webbrowsers, and PS is
a language understood by printers.)

Why not this one?

Why couldn't that programmer that knows both languages sit down and
write a perl2C converter in C?

The answer is, of course, that they could.

Have they?

That's what I am trying to find out.

AC


 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      08-22-2004
Alan Connor wrote:

> There's this utility called html2ps that's written in perl, but
> the box I want to run it on doesn't have room for perl. It does
> have room for a C compiler.


A general purpose perl-to-C converter will be the same size as perl itself.
If the program you're coverting uses eval($string), then you'd have to
include the *entire* perl language.
-Joe
 
Reply With Quote
 
Joe Smith
Guest
Posts: n/a
 
      08-22-2004
Alan Connor wrote:

> There are utilities for converting one programming language to another.
> Why not this one?
> Why couldn't that programmer that knows both languages sit down and
> write a perl2C converter in C?


Too much effort, insufficient payoff.
Look at "perldoc -q compile" to see how others have done similar.
-Joe
 
Reply With Quote
 
Alan Connor
Guest
Posts: n/a
 
      08-22-2004
On Sun, 22 Aug 2004 20:05:10 GMT, Joe Smith <(E-Mail Removed)> wrote:
>
>
> Alan Connor wrote:
>
>> There's this utility called html2ps that's written in perl, but
>> the box I want to run it on doesn't have room for perl. It does
>> have room for a C compiler.

>
> A general purpose perl-to-C converter will be the same size as perl itself.
> If the program you're coverting uses eval($string), then you'd have to
> include the *entire* perl language.
> -Joe


Sure, but the perl-to-C converter would not have to be on the box that
I want to run html2ps on. I can do the conversion and compilation elsewhere
and then have a nice little C binary to install on that box, which will be
a small fraction of the size of perl and the perl html2ps.

AC



 
Reply With Quote
 
Richard Pennington
Guest
Posts: n/a
 
      08-22-2004
Alan Connor wrote:

> On Sun, 22 Aug 2004 20:05:10 GMT, Joe Smith <(E-Mail Removed)> wrote:
>
>>
>>Alan Connor wrote:
>>
>>
>>>There's this utility called html2ps that's written in perl, but
>>>the box I want to run it on doesn't have room for perl. It does
>>>have room for a C compiler.

>>
>>A general purpose perl-to-C converter will be the same size as perl itself.
>>If the program you're coverting uses eval($string), then you'd have to
>>include the *entire* perl language.
>> -Joe

>
>
> Sure, but the perl-to-C converter would not have to be on the box that
> I want to run html2ps on. I can do the conversion and compilation elsewhere
> and then have a nice little C binary to install on that box, which will be
> a small fraction of the size of perl and the perl html2ps.
>
> AC
>
>
>


When the little C binary encounters eval($string) it could email
the big box and ask it to convert $string to C, compile it, and
email the binary back. Watch out for virus protection filters!

-Rich
--
Richard Pennington
Email: (E-Mail Removed)
http://www.pennware.com ftp://ftp.pennware.com

 
Reply With Quote
 
Alan Connor
Guest
Posts: n/a
 
      08-22-2004
On Sun, 22 Aug 2004 20:11:55 GMT, Joe Smith <(E-Mail Removed)> wrote:
>
>
> Alan Connor wrote:
>
>> There are utilities for converting one programming language to another.
>> Why not this one?
>> Why couldn't that programmer that knows both languages sit down and
>> write a perl2C converter in C?

>
> Too much effort, insufficient payoff.


Huh? Most of the perl groups are dead. Millions of gigabytes of hdd
space could be saved, as well as all the other system resources that
perl requires.

Such a program would be used extensively.

And perl would lose a lot of users. Someone would set up an ftp site
with C versions of most of the perl programs and who wouldn't choose
them over perl if they weren't interested in learning to program in perl?

> Look at "perldoc -q compile" to see how others have done similar.
> -Joe


Okay. Thanks.

But why would they have "done similar" if such an effort has "insufficient
payoff"?

AC


 
Reply With Quote
 
Alan Connor
Guest
Posts: n/a
 
      08-22-2004
On Sun, 22 Aug 2004 20:37:29 GMT, Richard Pennington <(E-Mail Removed)> wrote:
>
>
> Alan Connor wrote:
>
>> On Sun, 22 Aug 2004 20:05:10 GMT, Joe Smith <(E-Mail Removed)> wrote:
>>
>>>
>>>Alan Connor wrote:
>>>
>>>
>>>>There's this utility called html2ps that's written in perl, but
>>>>the box I want to run it on doesn't have room for perl. It does
>>>>have room for a C compiler.
>>>
>>>A general purpose perl-to-C converter will be the same size as perl itself.
>>>If the program you're coverting uses eval($string), then you'd have to
>>>include the *entire* perl language.
>>> -Joe

>>
>>
>> Sure, but the perl-to-C converter would not have to be on the box that
>> I want to run html2ps on. I can do the conversion and compilation elsewhere
>> and then have a nice little C binary to install on that box, which will be
>> a small fraction of the size of perl and the perl html2ps.
>>
>> AC
>>
>>
>>

>
> When the little C binary encounters eval($string) it could email
> the big box and ask it to convert $string to C, compile it, and
> email the binary back. Watch out for virus protection filters!
>


ROTFL !!


AC



 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      08-22-2004
Alan Connor <(E-Mail Removed)> writes:
[...]
[...]
> There are utilities for converting one programming language to another.
>
> Lots of them. For major and minor languages.
>
> (The very program I am referring to above, html2ps, is
> such a program. HTML is a language understood by webbrowsers, and PS is
> a language understood by printers.)
>
> Why not this one?
>
> Why couldn't that programmer that knows both languages sit down and
> write a perl2C converter in C?
>
> The answer is, of course, that they could.
>
> Have they?
>
> That's what I am trying to find out.


Such a tool does in fact exist.

See my article <(E-Mail Removed)>, posted 2003-11-05, subject
'Re: "Mastering C Pointers"....', for an explanation of the reason I'm
choosing not to share more information with you. My final statement
in that article still stands, but I make no promises.

<http://groups.google.com/groups?selm=lzptg77jsg.fsf%40cts.com>

Just a reminder that behavior has consequences.

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
 
Reply With Quote
 
tigervamp
Guest
Posts: n/a
 
      08-22-2004
Alan Connor <(E-Mail Removed)> wrote in message news:<Br5Wc.30453$(E-Mail Removed) thlink.net>...
> On 22 Aug 2004 09:50:52 -0700, (E-Mail Removed) <(E-Mail Removed)> wrote:
> >
> >
> > "Profetas" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed) alkaboutprogramming.com>...
> >> > Alan Connor wrote:
> >> >>
> >> >> There's this utility called html2ps that's written in perl, but
> >> >> the box I want to run it on doesn't have room for perl. It does
> >> >> have room for a C compiler.


If you just want to get an html to postscript converter on your
machine, you can download one of many such C programs. <OT> It is
also possible to convert a perl program into a native executable using
freely available experimental software or the Perl2Exe software
provided by indigoSTAR (www.indigostar.com). You could then run this
converted Perl program on a machibe that does not have Perl </OT>

> >> >> Be nice if I could find a tool that converted perl to C.
> >> >
> >> > The tool exists, its called "a programmer who knows perl and C".
> >>
> >> I have done some research on this topic and I couldn't find any

> >
> > LOL!

>
> There are utilities for converting one programming language to another.
>
> Lots of them. For major and minor languages.


Not sure what you mean by major and minor languages.

> (The very program I am referring to above, html2ps, is
> such a program. HTML is a language understood by webbrowsers, and PS is
> a language understood by printers.)
> Why not this one?


<OT> I think there is a big difference here. First, html and ps are
not programming languages, they are markup languages used to describe
how something should be presented. Additionally, most of the time,
html and ps documents are not read or written by hand, they are
created and presented with tools that understand the language which is
why I think that tools that can convert between them are more useful
(since there probably aren't many people that can convert to or from
postscript by hand). A tool to convert between programming languages,
especially between something like C and Perl, would be much more
difficult to implement and would probably require some knowledge of
both languages just to use in most cases anyway. I also don't think
the demand is there. </OT>

> Why couldn't that programmer that knows both languages sit down and
> write a perl2C converter in C?
>
> The answer is, of course, that they could.
>
> Have they?


<OT> Not that I am aware of, and as I said above, it probably wouldn't
be an seamless solution. It would also probably involve having Perl
installed on the machine doing the conversion. I also don't think
that many people who know both languages are very interested in
creating such a tool (and apparently they aren't). Perl is more of a
high-level scripting language and most people that use it don't really
have an interest in having their programs converted to C. Alot of
people using Perl have migrated from C or have a dislike for C as well
</OT>

> That's what I am trying to find out.
>
> AC


Rob Gamble
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 04-04-2011 10:00 PM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments