A few weeks ago I posted something about a Tcl->parrot compiler, but Will Coleda already was working on such a project. It would be a as a final project for my bachelor's. But because such already exists, I'm looking for something else.
I think parrot is a cool target for compiling, and I'd like to do some sort of a compiler project. However, I don't know which language to compile. My knowledge is basic, so any OO language would take too much time.
Has anybody any suggestions for me? (maybe modula2?)
Regards.
Klaas-Jan Stol
PHP?
Similar enough to Perl to make it interesting, nice clean design and an
available grammar. People have already done some work IIRC.
Lua?
Similar-ish to TCL and liked by the games industry. It is procedural but
provides meta mechanisms for implementing classes and inheritance.
Speaking of games, it would be interesting to see Parrot be used in that
direction. A lot of games currently are pretty much developed along the
lines of 'custom scripting language interfaced to custom game engine'
# game scripting in Python
http://www.gamasutra.com/features/20020821/dawson_pfv.htm
# Postmortem of Jak and Daxter which was scripted in Lisp
http://www.gamasutra.com/features/20020710/white_01.htm
Parrot seems to be ideal for this, especially since you could easily
have seperate scripting languages for, say, the world logic and the AI
for NPCs, both of which could compile to Parrot and interact with each
other.
Simon
--
I'm full of borrowed ideas that I have no intention of returning
> A few weeks ago I posted something about a Tcl->parrot compiler, but
> Will Coleda already was working on such a project. It would be a as a
> final project for my bachelor's. But because such already exists, I'm
> looking for something else.
An interesting project to do would be to do a Java->Parrot compiler.
Basing it on an existing Java compiler such as Jikes is probably the
best way to do this:
http://oss.software.ibm.com/developerworks/opensource/jikes/
You'd also probably use GNU Classpath:
http://www.gnu.org/software/classpath/classpath.html
HTH, Leon
--
Leon Brocard.............................http://www.astray.com/
scribot.................................http://www.scribot.com/
... Hmm... How *did* they finally kill Frosty?
LUA seems to be a very nice language, but how is this language to be used?
Is it in combination with a C program one would write? Or could it be used
as a stand alone application? In that case, it seems to me it would be
interesting to have a LUA->Parrot (with IMCC in between) compiler.
Regards.
Klaas-Jan Stol
Depends what you mean by 'advantage'.
Currently, as far as I know, PHP runs on a virtual machine, just like
Perl so it's a good candidate for porting. It is also relatively feature
comparable whilst being easier to parse.
Doing a PHP->Parrot compiler would have these advantages :
* demonstrate your understanding of a inplementing the
compiler for a featureful language
* allow interaction between Perl6 and PHP scripts/modules
* tap into the PHP community's tuits whcih would mean Parrot'd be likely
to get stuff like the Zend optimiser and a generic mod_* backend so
that all languages implemented on top of Parrot would have a
mod_(php/perl) Apache hook automagically.
* really push Parrot with a real-world, non toy language.
> LUA seems to be a very nice language, but how is this language to be used?
> Is it in combination with a C program one would write? Or could it be used
> as a stand alone application? In that case, it seems to me it would be
> interesting to have a LUA->Parrot (with IMCC in between) compiler.
As I said, I only know it from a games context where it's used as the
basis for the scripting engine. AIUI it can be used a a standalone
language as well.
From what I know it's specifically designed to be a portable, fast,
lightweight platform for extending platforms and providing a framework
for implementing domain specific languages.
So, basically, a perfect fit for Parrot.
In fact, if you take
http://www.lua.org/about.html
and s/Lua/Parrot/ it still makes sense :)
Simon
If you're interested in doing a Tcl compiler, by all means, go
ahead--I wouldn't let the fact that someone else is doing it stop
you. The point of doing it is for the experience, which you'll get
regardless of any other implementation. It's also distinctly possible
that neither you nor Will will finish a full implementation (as it's
likely a rather large undertaking for one person) but you'll each
have part of it that can be merged together.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk
----- Original Message -----
From: "Dan Sugalski" <d...@sidhe.org>
To: "K Stol" <k_s...@hotmail.com>; <perl6-i...@perl.org>
Sent: Tuesday, January 21, 2003 4:40 PM
Subject: Re: Compiling to Parrot
Hmm... I think with the current Parrot setup that might be a bit difficult.
We need object instructions for that , also I need to be able to define
classes,interfaces and all the Java thingys there ...
> Basing it on an existing Java compiler such as Jikes is probably the
> best way to do this:
Yikes ! (in a thick foreign accent)...
My bachelor's project is a Java compiler for DotGNU ... and I had a look
over of Jikes (and Kjc) for retargetting ... Eventhough I was planning on
building a stack bytecode , I found it quite something to hack on...
(in short, my attempts broke it...)
Kjc is a bit more decent though it's quite OO and might take some redesign
to pass back the result register (instead of "assuming" that the value is
in the stack top) ...
I've decided to base it on the Portable.net codegen... (I've got it into
parsing now...) ... This is a Java -> IL compiler from Java source ...
But once the C# -> Parrot compiler works , you might even have a Java ->
Parrot compiler ... (because I'm re-using almost all the C# AST nodes
for my compiler, the PMCodegen should generate correct Parrot as well).
Hopefully all this will work out for me... :)
Gopal
--
The difference between insanity and genius is measured by success
Ah, that could be a problem. Will it be a problem if you start a
project that someone else later also starts?
----- Original Message -----
From: "Dan Sugalski" <d...@sidhe.org>
To: "K Stol" <k_s...@hotmail.com>; <perl6-i...@perl.org>
Sent: Tuesday, January 21, 2003 4:58 PM
Subject: Re: Compiling to Parrot
I like the idea, and I don't think you'll see anyone else tackle it
for a while. (And if that falls through, there's always LISP... :)
Klaas-Jan
----- Original Message -----
From: "Dan Sugalski" <d...@sidhe.org>
To: "K Stol" <k_s...@hotmail.com>; <perl6-i...@perl.org>
Sent: Tuesday, January 21, 2003 5:05 PM
Subject: Re: Compiling to Parrot
If you follow the calling conventions, then yes you'll be able to
call python/ruby/perl/befunge routines from Lua code, and vice versa.
Klaas-Jan
----- Original Message -----
From: "Dan Sugalski" <d...@sidhe.org>
To: "K Stol" <k_s...@hotmail.com>; <perl6-i...@perl.org>
Sent: Tuesday, January 21, 2003 5:20 PM
Subject: Re: Compiling to Parrot
No, you won't be able to call befunge routines from Lua, because:
- befunge does not know how to define subroutines (at least befunge-93
and befunge-98... maybe befunge-103?). Well, to be honest, maybe I'll
introduce the hack I'm using in Inline::Befunge in order to have named
subroutines.
- befunge, because of its nature, _can't_ be compiled and is only
interpreted. So, in order to call befunge subs, you'll have to embed a
Befunge interpreter in your code.
Jerome
--
jqu...@mongueurs.net
One of the reasons I'm interested in Parrot -- I'm hoping that it's
going to have some secure execution facilities built-in from the
ground up (to facilitate user-code on virtual world servers) :-)
--
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
---------+ http://twistedmatrix.com/users/radix.twistd/
So... I can't think of a good purpose of Lua/Parrot myself. I'm not trying
to discourage you by any means! If I were to embed a Parrot interpreter for
our next game (!) I'd happily leave Lua behind.
p
Yep. I've not spec'd them out as I've been trying to deal with other
things, but secure execution is something I've been thinking of since
the beginning. Perl 5's model has some rather significant flaws, as
does Java's sandboxing, albeit fewer of them.
Oh, absolutely.
What one generally does is load in other bytecode files. Those files,
on loading, will install a variety of symbols into the interpreter's
global pool, at which point you can use them as you need to.
This is, generally speaking, a dynamic linking scheme, rather than
the more traditional static link that resolves symbols and such, as
we're dealing with a much more dynamic environment.
Well, then, let's see what we can do to make parrot suitable for your needs. :)
> > Only thing I need to know before I can start is: what would the purpose be
> > of a Lua to Parrot compiler? Lua is originally an embedded language for
>> easy-scripting, as far as I understand. How could it be used when targeted
>> to parrot? Would it be possible to call functions written in Lua
>> (and which
>> are then compiled to parrot) from (for example) a python script?
>> (So: python
>> script calls function writtenin Lua and compiled to parrot).
>>
>> Klaas-Jan
Chad
It occurs to me that no one has mentioned ML. ML would be a pretty good
language to compile to parrot, and has reasonably strong usage in academic
circle...
Matt
didn't have time to reply earlier, had to do some research on Lua and had to
get approval for the project, so couldn't let you know earlier. sorry about
that.
But now, I have it (the approval, that is) so I'll be implementing a
compiler for Lua->parrot (most probably IMCC in between).
thanks to the people who suggested/replied on my posting.
Regards
Klaas-Jan
----- Original Message -----
From: "Dan Sugalski" <d...@sidhe.org>
To: "K Stol" <k_s...@hotmail.com>; <perl6-i...@perl.org>
Sent: Tuesday, January 21, 2003 5:05 PM
Subject: Re: Compiling to Parrot
Cool. Go for it, good luck, and nudge us on any parrot features (or
misfeatures) that are getting in the way--we're not 1.0 yet, so
there's plenty of room for change where needed.