Hello Philip, There are two paths you could go down, depending on your level of interest and your free time to write code:
1) Write your language compiler using Parrot's PCT tools. This has the great advantage of running on Parrot (garbage collectable, memory-managed, exception handling, etc) and is written in a subset of Perl 6 (which is very high level compared to C/lex/yacc). Obviously requires you to rewrite almost everything from the ground up, but you'd be surprised how much faster development goes using these tools. This is especially true if you already have the grammar rules handy because you can transcribe them pretty quickly, usually. PCT is part of the Parrot repo and can help insulate you from changes to PIR/PBC. So when we do change things, you won't need to change your compiler. 2) Have your compiler output PIR or PBC code which executes with Parrot. You keep most of your existing code but need to build a PIR/PBC codegen backend and link against libparrot. Parrot executes that generated output. If you wanted to have runtime code evaluation you would also need to write the bindings so that Parrot could call back into your compiler, which might be non-trivial depending on how everything is designed. Parrot was specifically designed to allow this kind of stuff (C/lex/yacc front-ends), although there aren't a lot of existing examples of languages that use it so you may run into some rough patches as you develop (which will help us to find and fix them!). If I may ask, what language are you writing the compiler for? Also, if you're interested Parrot does need more hackers working on things like improved garbage collectors and other subsystems, so your expertise in those areas would always be helpful. --Andrew Whitworth On Mon, Oct 5, 2009 at 2:18 PM, Philip Herron <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hey guys, > > I've been looking around your wiki's tutorials etc and it all seems > pretty interesting, I've been developing my own interpreter for a > language I've been designing for some time now. Just not quite sure > how it could all fit together if i wanted to create byte-code using > parrot. > > What i mean is, I've been parsing and doing my own runtime and garbage > collection etc as an interpreter written in C using some things like > yacc and lex, readline, gnu/mp, mpfr ... . But if i was to make an > implementation to produce byte-code to run on parrot, what do i do? > > Can i still use my own parser from the examples I've been looking at > it seems to be you have your own parser tools? Or am i thinking about > how it all works wrong. And if i am still able to use my own parser i > guess it means i must have to try and link against .pir stuff, so that > probably doesn't work. > > Another idea might be if i was still to use my own parser and bits and > pieces, is it safe to just produce byte-code manually from a program i > make on my side and run it on parrot if i see more what the byte-code > looks like. > > Anyways parrot seems like a cool project :) i should really start > playing with the examples now. So i understand it all a bit better. > > - --Phil > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkrKOFsACgkQAhcOgIaQQ2EBjwCbBtxNPcCHOthk6xueSk3Qz2aU > bDgAn0gRKmpaUzxFMHeYN9XV7f4+LcUn > =ccAh > -----END PGP SIGNATURE----- > > _______________________________________________ > http://lists.parrot.org/mailman/listinfo/parrot-dev > _______________________________________________ http://lists.parrot.org/mailman/listinfo/parrot-dev
