Re: Compiling to Parrot

2003-01-29 Thread Dan Sugalski
At 1:15 PM +0100 1/28/03, K Stol wrote:

Hi there,

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).


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.

- Original Message -
From: Dan Sugalski [EMAIL PROTECTED]
To: K Stol [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 5:05 PM
Subject: Re: Compiling to Parrot



 At 5:01 PM +0100 1/21/03, K Stol wrote:
 well, I think not, then I can't help it. What do you think about

compiling

 Lua to parrot (IMCC)?

 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... :)

 From: Dan Sugalski [EMAIL PROTECTED]
At 4:46 PM +0100 1/21/03, K Stol wrote:
   Well, I'd do it as a project for my Bachelor's, so I won't get

permission

 to
   do such a project, if it already exists.
 
   Ah, that could be a problem. Will it be a problem if you start a
   project that someone else later also starts?
 
   From: Dan Sugalski [EMAIL PROTECTED]
  At 9:17 AM +0100 1/21/03, K Stol wrote:
 Hi there,
 
 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.
   
 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
 [EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk




--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk



Re: Compiling to Parrot

2003-01-28 Thread K Stol
Hi there,

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 [EMAIL PROTECTED]
To: K Stol [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 5:05 PM
Subject: Re: Compiling to Parrot


 At 5:01 PM +0100 1/21/03, K Stol wrote:
 well, I think not, then I can't help it. What do you think about
compiling
 Lua to parrot (IMCC)?

 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... :)

 From: Dan Sugalski [EMAIL PROTECTED]
At 4:46 PM +0100 1/21/03, K Stol wrote:
   Well, I'd do it as a project for my Bachelor's, so I won't get
permission
 to
   do such a project, if it already exists.
 
   Ah, that could be a problem. Will it be a problem if you start a
   project that someone else later also starts?
 
   From: Dan Sugalski [EMAIL PROTECTED]
  At 9:17 AM +0100 1/21/03, K Stol wrote:
 Hi there,
 
 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.
   
 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
 [EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk




RE: Compiling to Parrot

2003-01-27 Thread Matt Fowles
All~

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

 -Original Message-
 From: K Stol [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 3:18 AM
 To: [EMAIL PROTECTED]
 Subject: Compiling to Parrot


 Hi there,

 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





Re: Compiling to Parrot

2003-01-22 Thread Dan Sugalski
At 8:54 AM -0500 1/21/03, Christopher Armstrong wrote:

On Tue, Jan 21, 2003 at 08:41:47AM +, Simon Wistow wrote:

 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'


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) :-)


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.
--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


RE: Compiling to Parrot

2003-01-22 Thread Dan Sugalski
At 11:43 PM -0800 1/21/03, Paul Du Bois wrote:

The advantage of Lua (at least for my project, which is a game) is that it
is quite easy to embed, and quite easy to customize.  The C API is small and
easily understandable (at the expense of being a little bit of a pain to
use), and the internals are simple and quite malleable.  The language itself
is pretty ugly IMHO.

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.


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



--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk



RE: Compiling to Parrot

2003-01-22 Thread Chad Fowler
I lost the original mail asking for suggestions, so there is no quoted 
text here, but have you looked at Joy 
(http://www.latrobe.edu.au/philosophy/phimvt/joy.html).  Looks to be quite 
clean and simple.  I haven't had the time to delve into it, but when I was 
reminded of it on the Ruby list, I thought I would suggest it here.

Chad




Re: Compiling to Parrot

2003-01-21 Thread Leon Brocard
K Stol sent the following bits through the ether:

 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?



Re: Compiling to Parrot

2003-01-21 Thread K Stol
PHP is especially used in web pages. Would there be any advantage to have a
PHP-Parrot compiler?

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

- Original Message -
From: Simon Wistow [EMAIL PROTECTED]
To: K Stol [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 9:41 AM
Subject: Re: Compiling to Parrot


 On Tue, Jan 21, 2003 at 09:17:56AM +0100, K Stol said:
  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?)


 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




Re: Compiling to Parrot

2003-01-21 Thread Simon Wistow
On Tue, Jan 21, 2003 at 12:14:29PM +0100, K Stol said:
 PHP is especially used in web pages. Would there be any advantage to have a
 PHP-Parrot compiler?

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




Re: Compiling to Parrot

2003-01-21 Thread Dan Sugalski
At 9:17 AM +0100 1/21/03, K Stol wrote:

Hi there,

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.

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
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: Compiling to Parrot

2003-01-21 Thread K Stol
Well, I'd do it as a project for my Bachelor's, so I won't get permission to
do such a project, if it already exists.
Klaas-Jan

- Original Message -
From: Dan Sugalski [EMAIL PROTECTED]
To: K Stol [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 4:40 PM
Subject: Re: Compiling to Parrot


 At 9:17 AM +0100 1/21/03, K Stol wrote:
 Hi there,
 
 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.

 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
 [EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk




Re: Compiling to Parrot

2003-01-21 Thread Gopal V
If memory serves me right, Leon Brocard wrote:
 An interesting project to do would be to do a Java-Parrot compiler.

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



Re: Compiling to Parrot

2003-01-21 Thread Dan Sugalski
At 4:46 PM +0100 1/21/03, K Stol wrote:

Well, I'd do it as a project for my Bachelor's, so I won't get permission to
do such a project, if it already exists.


Ah, that could be a problem. Will it be a problem if you start a 
project that someone else later also starts?

From: Dan Sugalski [EMAIL PROTECTED]
  At 9:17 AM +0100 1/21/03, K Stol wrote:

 Hi there,
 
 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.

 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
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk



Re: Compiling to Parrot

2003-01-21 Thread Dan Sugalski
At 5:13 PM +0100 1/21/03, K Stol wrote:

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).


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.

From: Dan Sugalski [EMAIL PROTECTED]
  At 5:01 PM +0100 1/21/03, K Stol wrote:

 well, I think not, then I can't help it. What do you think about

compiling

 Lua to parrot (IMCC)?

 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... :)

 From: Dan Sugalski [EMAIL PROTECTED]
At 4:46 PM +0100 1/21/03, K Stol wrote:
   Well, I'd do it as a project for my Bachelor's, so I won't get

permission

 to
   do such a project, if it already exists.
 
   Ah, that could be a problem. Will it be a problem if you start a
   project that someone else later also starts?
 
   From: Dan Sugalski [EMAIL PROTECTED]
  At 9:17 AM +0100 1/21/03, K Stol wrote:
 Hi there,
 
 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.
   
 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
 [EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk




--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk



Re: Compiling to Parrot

2003-01-21 Thread K Stol
Is it possible for parrot-code to call functions in other parrot files?
(which implies there is some program which consists of multiple files)

Klaas-Jan

- Original Message -
From: Dan Sugalski [EMAIL PROTECTED]
To: K Stol [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 5:20 PM
Subject: Re: Compiling to Parrot


 At 5:13 PM +0100 1/21/03, K Stol wrote:
 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).

 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.

 From: Dan Sugalski [EMAIL PROTECTED]
At 5:01 PM +0100 1/21/03, K Stol wrote:
   well, I think not, then I can't help it. What do you think about
 compiling
   Lua to parrot (IMCC)?
 
   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... :)
 
   From: Dan Sugalski [EMAIL PROTECTED]
  At 4:46 PM +0100 1/21/03, K Stol wrote:
 Well, I'd do it as a project for my Bachelor's, so I won't get
 permission
   to
 do such a project, if it already exists.
   
 Ah, that could be a problem. Will it be a problem if you start a
 project that someone else later also starts?
   
 From: Dan Sugalski [EMAIL PROTECTED]
At 9:17 AM +0100 1/21/03, K Stol wrote:
   Hi there,
   
   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.
 
   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
   [EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk
 


 --
  Dan

 --it's like this---
 Dan Sugalski  even samurai
 [EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk




Re: Compiling to Parrot

2003-01-21 Thread Christopher Armstrong
On Tue, Jan 21, 2003 at 08:41:47AM +, Simon Wistow wrote:
 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'

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/



RE: Compiling to Parrot

2003-01-21 Thread Paul Du Bois
The advantage of Lua (at least for my project, which is a game) is that it
is quite easy to embed, and quite easy to customize.  The C API is small and
easily understandable (at the expense of being a little bit of a pain to
use), and the internals are simple and quite malleable.  The language itself
is pretty ugly IMHO.

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

 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