Re: generic code generator? [was: subroutines and python status]

2003-08-14 Thread Stephen Thorne
On Tue, 5 Aug 2003 12:48, Michal Wallace wrote: It does seem like there are some snags getting languages to talk to each other, even with the calling conventions, but even so, I'm even more convinced now that a generic, overridable code-generator is the way to go. It seems to me that if we

Re: generic code generator? [was: subroutines and python status]

2003-08-14 Thread Michal Wallace
On Tue, 5 Aug 2003, Stephen Thorne wrote: It seems to me that if we want to maximize the number of languages using it, the generic compiler shouldn't depend on anything but C and parrot... But until we get it working, I'd like to stick to a dynamic language like

Re: generic code generator? [was: subroutines and python status]

2003-08-14 Thread Joseph Ryan
Michal Wallace wrote: On Sun, 3 Aug 2003, K Stol wrote: What do you think? Want to try squishing pirate/python and pirate/lua together? :) Yeah, I like the idea. Let's try this out. Well, I finished reading your report[1] and posted some of my (rather unorganized) thoughts up

Re: generic code generator? [was: subroutines and python status]

2003-08-14 Thread K Stol
- Original Message - From: Joseph Ryan [EMAIL PROTECTED] To: Michal Wallace [EMAIL PROTECTED] Cc: K Stol [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 12:24 AM Subject: Re: generic code generator? [was: subroutines and python status] Michal Wallace wrote: On Sun

Re: generic code generator? [was: subroutines and python status]

2003-08-14 Thread Dan Sugalski
At 11:09 PM -0400 8/4/03, Michal Wallace wrote: On Tue, 5 Aug 2003, Stephen Thorne wrote: Thus the code generator is best suited to be in a language that can be run from within the parrot machine, otherwise statements like 'eval()' would not be possible without binding parrot to a

Re: generic code generator? [was: subroutines and python status]

2003-08-14 Thread Michal Wallace
On Tue, 5 Aug 2003, Dan Sugalski wrote: The original thought was to use the new perl 6 grammar engine/code to do this, but I think it'll be a while before that's ready to go. I think perl6 is definitely the way to go, once it's ready. BTW, what's the deal with Bundle::Perl6? I tried

Re: generic code generator? [was: subroutines and python status]

2003-08-10 Thread Michal Wallace
On Tue, 5 Aug 2003, Joseph Ryan wrote: Okay, I don't have a good syntax in mind yet, the point is it's a template language and you can subclass/override/extend the template. Maybe there's no syntax and it just uses cleanly coded classes in some oo language. Or perl6 with it's grammars and

Re: generic code generator? [was: subroutines and python status]

2003-08-08 Thread Dan Sugalski
At 1:35 PM -0400 8/5/03, Michal Wallace wrote: On Tue, 5 Aug 2003, Joseph Ryan wrote: Okay, I don't have a good syntax in mind yet, the point is it's a template language and you can subclass/override/extend the template. Maybe there's no syntax and it just uses cleanly coded classes in some

Re: generic code generator? [was: subroutines and python status]

2003-08-08 Thread Michal Wallace
On Thu, 7 Aug 2003, Dan Sugalski wrote: haskell_parser - ast - pirate - parrot_code -- imcc - pbc ^ | parrot_code__templates So the haskell

Re: generic code generator? [was: subroutines and python status]

2003-08-05 Thread Michal Wallace
On Sun, 3 Aug 2003, K Stol wrote: What do you think? Want to try squishing pirate/python and pirate/lua together? :) Yeah, I like the idea. Let's try this out. Well, I finished reading your report[1] and posted some of my (rather unorganized) thoughts up at [2] It does seem like there

generic code generator? [was: subroutines and python status]

2003-08-03 Thread Michal Wallace
On Fri, 1 Aug 2003, K Stol wrote: From: Leon Brocard [EMAIL PROTECTED] ... I don't like things becoming dead-ends. How much work do you think it'd be to extend it some more and update it to latest Lua? ... 2: I misdesigned the code generator; that is, at the point where I couldn't start

Re: generic code generator? [was: subroutines and python status]

2003-08-03 Thread K Stol
- Original Message - From: Michal Wallace [EMAIL PROTECTED] To: K Stol [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, August 03, 2003 2:25 AM Subject: generic code generator? [was: subroutines and python status] On Fri, 1 Aug 2003, K Stol wrote: From: Leon Brocard [EMAIL

Re: generic code generator? [was: subroutines and python status]

2003-08-03 Thread Michal Wallace
On Sun, 3 Aug 2003, K Stol wrote: At this moment, I'm looking at a new version of Lua, the previous 'pirate' compiled (well, sort of :-) Lua 4 Lua 5 has some features, such as coroutines (If I remembered well) and all kinds of neat stuff for which Parrot has built-in support (and it dropped

Re: generic code generator? [was: subroutines and python status]

2003-08-03 Thread Stephen Thorne
On Sun, 3 Aug 2003 19:25, Michal Wallace wrote: On Fri, 1 Aug 2003, K Stol wrote: Really, there's a ton of overlap between the various high level languages that parrot wants to support. Maybe we could put together a generic code generator that everyone could use? Obviously, it would have to

JVM-PIR translator (was: Re: subroutines and python status)

2003-08-01 Thread Joseph Ryan
Leopold Toetsch wrote: Luke Palmer [EMAIL PROTECTED] wrote: You mind submitting a patch to put this in the languages/pirate I'd appreciate that very much. Pie-thon, here we come ... Speaking of adding new projects to languages, I have a partially complete JVM-PIR translator done. It's

Re: subroutines and python status

2003-08-01 Thread K Stol
- Original Message - From: Melvin Smith [EMAIL PROTECTED] To: Luke Palmer [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, July 31, 2003 3:33 PM Subject: Re: subroutines and python status At 01:51 PM 7/31/2003 -0600, Luke Palmer wrote: You mind submitting

Re: subroutines and python status

2003-08-01 Thread Leon Brocard
K Stol sent the following bits through the ether: Actually, I named my little project pirate (s. http://members.home.nl/joeijoei/parrot for this) already, but it's a bit of a dead end already (although I learnt much of it), so I don't mind. Quick, we need more parrot jokes... I don't like

Re: subroutines and python status

2003-08-01 Thread K Stol
- Original Message - From: Leon Brocard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 01, 2003 1:30 AM Subject: Re: subroutines and python status K Stol sent the following bits through the ether: Actually, I named my little project pirate (s. http://members.home.nl

Re: subroutines and python status

2003-08-01 Thread Dan Sugalski
At 11:04 PM +0200 7/31/03, Leopold Toetsch wrote: Luke Palmer [EMAIL PROTECTED] wrote: You mind submitting a patch to put this in the languages/pirate I'd appreciate that very much. Pie-thon, here we come ... As would I. If you're willing, Michal, we can check it in and get you CVS repository

Re: subroutines and python status

2003-08-01 Thread Michal Wallace
On Fri, 1 Aug 2003, Dan Sugalski wrote: At 11:04 PM +0200 7/31/03, Leopold Toetsch wrote: Luke Palmer [EMAIL PROTECTED] wrote: You mind submitting a patch to put this in the languages/pirate I'd appreciate that very much. Pie-thon, here we come ... As would I. If you're willing, Michal,

subroutines and python status

2003-07-31 Thread Michal Wallace
Hey all, I'm trying to get functions working in python, and I'm not sure the best way to do this. What seems natural to me is to define subroutines in the middle of the code as I walk the parse tree: .sub __main__ goto endsub .sub _f print :(\n ret .end endsub:

Re: subroutines and python status

2003-07-31 Thread Brent Royal-Gordon
Michal Wallace: I can store all my subroutine definitions in a list or something and then dump them out after the __main__ routine. Is that the right approach? It seems strange to me, but I'm new at this. That seems to be the way to do it, speaking as someone who's working on a Perl 5-to-PIL

Re: subroutines and python status

2003-07-31 Thread Leopold Toetsch
Michal Wallace wrote: Hey all, What seems natural to me is to define subroutines in the middle of the code as I walk the parse tree: You can do that: .sub __main__ bsr _main end .end .sub _main .sub _f print :)\n ret .end .sub _g print ;-)\n ret

Re: subroutines and python status

2003-07-31 Thread Leopold Toetsch
Michal Wallace [EMAIL PROTECTED] wrote: .sub __start__ call __main__ .end .sub __main__ .sub _f print :) ret .end $I0 = addr _f print $I0 end .end That prints :), followed by the address, No, can't imagine that: $ parrot -o- pirate.imc __start__:

Re: subroutines and python status

2003-07-31 Thread Luke Palmer
Hey all, I'm trying to get functions working in python, and I'm not sure the best way to do this. What seems natural to me is to define subroutines in the middle of the code as I walk the parse tree: .sub __main__ goto endsub .sub _f print :(\n ret

Re: subroutines and python status

2003-07-31 Thread Michal Wallace
On Thu, 31 Jul 2003, Leopold Toetsch wrote: You can do that: .sub __main__ bsr _main end .end .sub _main ... So you have just to emit code, to call your real main at the beginning. Well that worked, and even let me get rid of the endsub label: .sub __start__ call __main__

Re: subroutines and python status

2003-07-31 Thread Michal Wallace
On Thu, 31 Jul 2003, Brent Royal-Gordon wrote: Michal Wallace: I can store all my subroutine definitions in a list or something and then dump them out after the __main__ routine. That seems to be the way to do it, speaking as someone who's working on a Perl 5-to-PIL converter (using the

Re: subroutines and python status

2003-07-31 Thread Michal Wallace
On 31 Jul 2003, Luke Palmer wrote: It now runs amk's euclid.py perfectly now. Do we have a way to compare the speed vs python? :) We just modify it to repeat 100,000 times or so, and compare that way. Oh, duh. :) Which I did. Parrot comes in about 3x slower than python on euclid. From

Re: subroutines and python status

2003-07-31 Thread Luke Palmer
One of my questions is, why do you make so many PerlNums when there isn't a trace of a floating point number to be found...? Because I didn't read the docs that said PerlNum means float. :) I'll switch it to PerlInt (or maybe int?) later... Yeah, all your auxillary data; i.e. the flags

Re: subroutines and python status

2003-07-31 Thread Leopold Toetsch
Luke Palmer [EMAIL PROTECTED] wrote: You mind submitting a patch to put this in the languages/pirate I'd appreciate that very much. Pie-thon, here we come ... Luke leo

Re: subroutines and python status

2003-07-31 Thread Melvin Smith
At 02:54 PM 7/31/2003 -0400, Michal Wallace wrote: Actually, between imcc and the python compiler module, it's not nearly as hard as I thought it would be. So far, I think the parrot version is actually a lot simpler than the python compiler, just because imcc is doing so much of the work. Leo and

Re: subroutines and python status

2003-07-31 Thread Melvin Smith
At 01:51 PM 7/31/2003 -0600, Luke Palmer wrote: You mind submitting a patch to put this in the languages/pirate directory of the parrot distro? I'd like to stay up to date, and probably do some work (as, I imagine, would others). I'd like to officially complain that pirate is a cooler name than