Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Be grateful for Perl OO

by artist (Parson)
on Jan 28, 2003 at 15:45 UTC ( #230621=note: print w/replies, xml ) Need Help??

in reply to Be grateful for Perl OO

1. Create your code in Perl to go with
2. templates to
3. create C++ code out of it.

You get all the benefits of Perl that you mentioned and your final code is in C++. While maintaining the code, you can just look at the Perl code and re-create the C++ code whenever required.


Replies are listed 'Best First'.
Re: Re: Be grateful for Perl OO
by Elian (Parson) on Jan 28, 2003 at 16:54 UTC
    Ah, templating. A really handy technique many people forget about when writing C/C++ code, as we've been burned by the horror that is the C macro system. (Which, BTW, may well be of use here by itself)

    We're using a custom templating system pretty aggressively in parts of Parrot, I've used custom built templaters to preprocess a chunk of source before cut'n'pasting it into another source file somewhere--while it's not the most elegant solution, and you usually only do it once, it takes a lot of the error-proneness out of the drugework sourcecode.

Lang::C++::Template? (was Re3: Be grateful for Perl OO)
by dragonchild (Archbishop) on Jan 28, 2003 at 15:48 UTC
    That brings up an interesting point - has anyone created something like C++::Template or Lang::C++::Template? Would there be a use for it? How would one go about specifying it?

    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

      I simply used Text::Template to generate C code, it worked without any problems and too many escape codes.

      Just my two cents, -gjb-

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://230621]
[marto]: good morning all
[1nickt]: watcha marto
[Discipulus]: good morning marto, 1nickt for you the sky is still black, no?
[Corion]: Hi all ;)
[1nickt]: just turning grey
[virtualsue]: likely to be grey here all day judging by the forecast
[1nickt]: The deer are in the back garden looking for corn left over from yesterday; the birds are not yet making a commotion. There is frost on the ground.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2017-11-21 11:41 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (297 votes). Check out past polls.