See Parrot, actually, make a C parser for Parrot. Will be very interesting to have C interpreted by Parrot, since there isn't any plans for that yet.

But I'm thinking, how you will handle alredy compiled codes, specially libraries? C is used not only because it can be compiled in any OS, but because we can use a lot of libraries/includes that are already done and because it can work directly with the OS, soo we can do anything with it. (and you will need to rewrite a lot of code... Argh!)

But I understand that for now your idea has an educational purpose, and I give you the best luck with it. Maybe we will have the 1st real C interpreted (not a fake C ok!). ;-P

About Parrot, take a look, we can do anything with it (or will), since it has an great architecture and it's a really good VM.

http://www.parrotcode.org/ (Get involved!)

And don't forget that one of the plans of Parrot is to can convert a code to another through Parrot Assembly Code. Soo, from a C code I can automatically convert it to Perl, Java, etc... Or from Perl to C!

Thinking now, adding a C interpreted to Parrot will open an option to can automatically convert Perl codes to C and then use this to compile it as a normal C code. But this will only be possible if you keep your C interpreter compatible with gcc definitions!

Graciliano M. P.
"Creativity is the expression of the liberty".


In reply to Re: C compiler ... in Perl by gmpassos
in thread C compiler ... in Perl by rje

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.