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 a

Trapping find_lex failure; case for search_lex?

2003-08-01 Thread Jos Visser
Hi, I am writing a parrot code generator back-end to an interpreter for a long-lost (some would say dead, but I prefer hibernating :-) programming language: Comal (see http://www.josvisser.nl/opencomal). Anyway, in the course of my code generation I have run into the situation where I think I

Re: [imcc] objects speed, .include and file-scoped vars, and various stuff

2003-08-01 Thread Leopold Toetsch
Jerome Quelin [EMAIL PROTECTED] wrote: - will objects introduce a speed overhead? For sure, but not a big one. You can AFAIK obtain an integer index for an attribute or method so its basically an array lookup. - if I implement the Lahey space module as a regular module, how can I declare

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.

Re: Question about interpreter == NULL

2003-08-01 Thread Juergen Boemmels
Leopold Toetsch [EMAIL PROTECTED] writes: Juergen Boemmels wrote: Leopold Toetsch [EMAIL PROTECTED] writes: [...] PIO_eprintf PIO_printf for printing to stderr/stdout during 1st interpreter construction destruction if something goes wrong. In all other cases we have an valid

Re: Question about interpreter == NULL

2003-08-01 Thread Leopold Toetsch
Juergen Boemmels [EMAIL PROTECTED] wrote: They should not fail more drastic than necessary. Only fail if its not possible to report an error to the upper level. Yep. That's right. To panic() is not necessary nost of the time. bye boe leo

Re: [perl #23186] [PATCH] adding yield semantics to IMCC

2003-08-01 Thread Leopold Toetsch
Kenneth A Graves [EMAIL PROTECTED] wrote: The .pcc_* directives are working for me in terms of implementing function calls. I want to do something similar for iterator calls. I've decided to implement iterators using coroutines. I have applied it. The test program foo.pir is now a test in

Re: Trapping find_lex failure; case for search_lex?

2003-08-01 Thread Leopold Toetsch
Jos Visser [EMAIL PROTECTED] wrote: Hi, 1)Is there an efficient way to trap the failure of a find_lex? Not yet. We have to clean up the internal_exception stuff first. Cfind_lex could e.g. return a NULL in case of failure, and we could then throw an exception in Fvar.ops at the

%_ - is it available for use?

2003-08-01 Thread Nick Ing-Simmons
We have been discussing how to pass data to Tk callbacks. In particular Entry widget validation routines. There are a number of items that they _might_ be interested in but a typical routine would only use a few. Currently it passes them all as positional parameters. One idea that occured to

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: [perl #23186] [PATCH] adding yield semantics to IMCC

2003-08-01 Thread Leopold Toetsch
Kenneth A Graves [EMAIL PROTECTED] wrote: Inside the iterator, there are three differences compared to a function: 1) Every register in use needs to be saved to the user stack. (Anyone have a clean way to do this?) Its the same thing as calling a subroutine in the first place. Imcc has to

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,

Re: approaching python

2003-08-01 Thread Benjamin Goldberg
Joseph F. Ryan wrote: Benjamin Goldberg wrote: Joseph Ryan wrote: Benjamin Goldberg wrote: [snip] Hmm... If imcc is smart enough, (or perhaps I should say, when the flow control is simple/clear enough) it should be able to see when a value is pushed onto the stack, and later popped off,

Re: approaching python

2003-08-01 Thread Benjamin Goldberg
Benjamin Goldberg wrote: [snip] If someone's code emits something like: save $P1 restore $P2 Then IMCC should be able to optimize that to: $Ptemp = $P1 $P2 = $Ptemp Actually, that (sometimes) should be able to be changed to: $P2 = $P1 noop or: noop

Re: [imcc] objects speed, .include and file-scoped vars, and various stuff

2003-08-01 Thread Jerome Quelin
Leopold Toetsch wrote: Jerome Quelin [EMAIL PROTECTED] wrote: - will objects introduce a speed overhead? For sure, but not a big one. You can AFAIK obtain an integer index for an attribute or method so its basically an array lookup. Nice. So maybe I'll go for an object... - if I

Re: [perl #23039] [PATCH] event handling-2

2003-08-01 Thread Benjamin Goldberg
Leopold Toetsch wrote: OK here it is. Again the description for the record: 1) Initialization: - normal core: build op_func_table with all opcode #4 [1] - CG core: build ops_addr[] filled with this opcode - prederef cores: build a list of (backward) branch instructions

Re: [RFC] Dynamic PMC Classes

2003-08-01 Thread Gordon Henriksen
On Wednesday, July 30, 2003, at 04:28 , Dan Sugalski wrote: At 12:43 +0200 7/30/03, Leopold Toetsch wrote: I have started looking at dynamic classes. I have currently - new subdirectory /dynclasses - small hack for classes/pmc2c.pl to consider this directory too - dynclasses/foo.pmc,

Re: [perl #23039] [PATCH] event handling-2

2003-08-01 Thread Leopold Toetsch
Benjamin Goldberg [EMAIL PROTECTED] wrote: Leopold Toetsch wrote: OK here it is. Again the description for the record: 1) Initialization: - normal core: build op_func_table with all opcode #4 [1] - CG core: build ops_addr[] filled with this opcode - prederef cores: build a list

Re: approaching python

2003-08-01 Thread Leopold Toetsch
Benjamin Goldberg wrote: save $P1 restore $P2 [ ... ] $P2 = $P1 or even removed entirely, rewriting everything after the to refer to $P1 instead of $P2. Does imcc do anything like this? Not yet. But it will do, at least for Parrot calling conventions, where register moves should

Re: [imcc] objects speed, .include and file-scoped vars, and various stuff

2003-08-01 Thread Leopold Toetsch
Jerome Quelin [EMAIL PROTECTED] wrote: Leopold Toetsch wrote: Just put a .local or .sym declaration outside/in front of your subs. This declares a file-scoped variable. It does not seem to be file-scoped: .include gets pulled in inside the lexer, so its the same, as it were in that file. And

imcc's call vs first class functions

2003-08-01 Thread Michal Wallace
Hey all, I've got lambda (single-expression anonymous subroutine) working in pirate now, but I wasn't sure how to get it to do the correct calling convention with IMCC's call. For example, pirate turns this: print (lambda x: x+1)(0) # prints 1\n into this: (the commented line is the

Re: Perl 6's for() signature

2003-08-01 Thread Abhijit A. Mahabal
[EMAIL PROTECTED] (Rod Adams) wrote in message Proposed behavior of *?@ : All Arguement to Parameter mapping left of it are processed Left to Right. Once seen, the mapping starts over right to left. Everything remaining is slurpable. Yes, it's more expensive to use, just like the RE version,

E6 question

2003-08-01 Thread Mark J. Reed
Is it possible with the new parameter declaration syntax to declare a mandatory name-only parameter? -Mark

Re: E6 question

2003-08-01 Thread Luke Palmer
Is it possible with the new parameter declaration syntax to declare a mandatory name-only parameter? Not directly, no. However, some trickyness with macros would probably let you do it. I don't yet understand macros well enough to show you... Luke Mark

Re: Perl 6's for() signature

2003-08-01 Thread Luke Palmer
[EMAIL PROTECTED] (Rod Adams) wrote in message Proposed behavior of *?@ : All Arguement to Parameter mapping left of it are processed Left to Right. Once seen, the mapping starts over right to left. Everything remaining is slurpable. Yes, it's more expensive to use, just like the RE

E6: Small Junctions

2003-08-01 Thread Dave Whipp
In E6, Damian write: A junction is a single scalar value that can act like two or more values at once. Whenever I see a statement like this, I tend ask myself What happenned to zero and one?. Perhaps its intentional; perhaps its sloppy writing. What issues arise with junctions of 0 or 1 members?

problem with register allocation

2003-08-01 Thread Stéphane Payrard
Hi everybody, That was nice to meet many of you in person at YAPC::EU, I am trying to learn about continuations and Parrot. I hit a problem of register allocation. I don't know if it is a miscomprehension from me or a bug. Probably the former. Apparently P16 is used both for my Perlhash and the

Re: problem with register allocation

2003-08-01 Thread Luke Palmer
Hi everybody, That was nice to meet many of you in person at YAPC::EU, I am trying to learn about continuations and Parrot. I hit a problem of register allocation. I don't know if it is a miscomprehension from me or a bug. Probably the former. Apparently P16 is used both for my Perlhash

Re: imcc's call vs first class functions

2003-08-01 Thread Leopold Toetsch
Michal Wallace [EMAIL PROTECTED] wrote: Hey all, I've got lambda (single-expression anonymous subroutine) working in pirate now, but I wasn't sure how to get it to do the correct calling convention with IMCC's call. I'm pretty sure, that you should use Parrot calling conventions for all

Re: imcc's

2003-08-01 Thread Leopold Toetsch
Joseph F. Ryan [EMAIL PROTECTED] wrote: I think you should try to implement lamda through .Sub's. Take a look at parrot/t/pmc/sub.t for some examples. However, you might not be able to rely on IMCC to handle arguments and results so much, since I don't think IMCC uses the new cps calling

Re: problem with register allocation

2003-08-01 Thread Leopold Toetsch
Luke Palmer wrote: I think we should remove nested subs from imcc, because they aren't buying us anything and are only causing confusion. Yep. Melvin is for this too. I said, there are users of this feature, so be careful, but again another one falling into the very same trap ... The user

Re: problem with register allocation

2003-08-01 Thread Kenneth Graves
Date: Fri, 1 Aug 2003 22:46:29 +0200 From: Stéphane Payrard [EMAIL PROTECTED] I am trying to learn about continuations and Parrot. I hit a problem of register allocation. I don't know if it is a miscomprehension from me or a bug. Probably the former. Apparently P16 is used both

Re: [perl #23186] [PATCH] adding yield semantics to IMCC

2003-08-01 Thread Kenneth Graves
From: Leopold Toetsch [EMAIL PROTECTED] Date: Fri, 1 Aug 2003 14:50:05 +0200 Kenneth A Graves [EMAIL PROTECTED] wrote: Inside the iterator, there are three differences compared to a function: 1) Every register in use needs to be saved to the user stack. (Anyone have a clean

Re: Perl 6's for() signature

2003-08-01 Thread Damian Conway
FWIW, we're aware of the problem. I posed this very question to Larry a few months back, when I was writing E6. We're still mulling over the correct answer. The last thought on the problem that Larry's shared with me was that there may need to be a special case for allowing a single block

Re: E6: assume nothing

2003-08-01 Thread Damian Conway
Trey asked: To take the E6 example of currying part: List::Part::part.assuming(labels = sheep goats) One had to curry in Clabels to be the same as it was defined in Cpart originally, i.e. C sheep goats . What if one wanted to curry in whatever the default is, i.e., assuming nothing

Re: E6: assume nothing

2003-08-01 Thread Luke Palmer
Trey asked: To take the E6 example of currying part: List::Part::part.assuming(labels = sheep goats) One had to curry in Clabels to be the same as it was defined in Cpart originally, i.e. C sheep goats . What if one wanted to curry in whatever the default is, i.e.,

Re: E6: assume nothing

2003-08-01 Thread Luke Palmer
I wrote: Damian explains: Trey asked: To take the E6 example of currying part: List::Part::part.assuming(labels = sheep goats) One had to curry in Clabels to be the same as it was defined in Cpart originally, i.e. C sheep goats . What if one wanted to curry in

Re: E6 question

2003-08-01 Thread Damian Conway
Mark J. Reed wrote: Is it possible with the new parameter declaration syntax to declare a mandatory name-only parameter? Probably. I think that the '?', '*', and '+ prefixes are abbreviations for traits (Cis optional, Cis List, Cis optional is named). So a named, mandatory parameter would be:

Re: Perl 6's for() signature

2003-08-01 Thread Simon Cozens
[EMAIL PROTECTED] (Damian Conway) writes: The last thought on the problem that Larry's shared with me was that there may need to be a special case for allowing a single block parameter after the slurpy And the Rubyometer creeps up another few notches... (Gosh, you'd almost think that Matz had

Junctions Set Theory

2003-08-01 Thread Derek Ross
Hello, Do junctions have a direct representation as predicate logic statements? In particular, do the following logic statements correspond directly to the following perl6 junctions: LOGIC PERL6 JUNCTION (DESCRIP) = (forall x)(x

Re: Junctions Set Theory

2003-08-01 Thread Abhijit A. Mahabal
On Fri, 1 Aug 2003, Derek Ross wrote: Do junctions have a direct representation as predicate logic statements? In particular, do the following logic statements correspond directly to the following perl6 junctions: LOGIC PERL6 JUNCTION (DESCRIP) =

Re: Junctions Set Theory

2003-08-01 Thread Luke Palmer
Hello, Do junctions have a direct representation as predicate logic statements? Yes. Damian and I have already worked them out in a link I have already posted today: http://groups.google.com/groups?hl=enlr=ie=UTF-8oe=UTF-8safe=offselm=3DF2FE76.6050602%40conway.orgrnum=2 In particular,

Re: %_ - is it available for use?

2003-08-01 Thread Damian Conway
Nick Ing-Simmons wrote: We have been discussing how to pass data to Tk callbacks. In particular Entry widget validation routines. There are a number of items that they _might_ be interested in but a typical routine would only use a few. Currently it passes them all as positional parameters. One

Blurring the line between assertions and tests

2003-08-01 Thread Michael G Schwern
I had an idea yesterday. On more than one occassion, a I've been asked about running tests against a live site. My usual waffle is to talk about assertions or to build a seperate test suite which is explicitly non-modifying. Or something Skud came up with which was to tag blocks of tests in the

Re: Blurring the line between assertions and tests

2003-08-01 Thread Michael G Schwern
On Fri, Aug 01, 2003 at 01:07:15PM -0700, Michael G Schwern wrote: Another way is to use a TEST: block and have Filter::Simple strip them out. TEST: { cmp_ok( ... ); } snip Questions? Comments? Approval? Hell, why wait for wiser heads?

Re: Blurring the line between assertions and tests

2003-08-01 Thread Michael G Schwern
Make that... http://www.pobox.com/~schwern/src/Test-AtRuntime-0.01.tar.gz -- I knew right away that my pants and your inner child could be best friends.

Re: Blurring the line between assertions and tests

2003-08-01 Thread Rafael Garcia-Suarez
Michael G Schwern wrote in perl.qa : The only part missing is the ability to shut the tests off once you've released it to production. You could perhaps use the assertion feature of perl = 5.9.0 (assertion.pm and -A switch -- yes I know it lacks docs.)

Re: Blurring the line between assertions and tests

2003-08-01 Thread Adrian Howard
On Friday, August 1, 2003, at 09:07 pm, Michael G Schwern wrote: [snip] I was thinking about inline testing, Test::Class and such and how it would be nice if we could just write test functions right in our code, like assertions. Like Carp::Assert::More, but I want all the Test:: stuff

Re: Perl 6's for() signature

2003-08-01 Thread Larry Wall
On Fri, Aug 01, 2003 at 11:01:15PM +0100, Simon Cozens wrote: : [EMAIL PROTECTED] (Damian Conway) writes: : The last thought on the problem that Larry's shared with me was that there : may need to be a special case for allowing a single block parameter after : the slurpy : : And the Rubyometer

I scare me.

2003-08-01 Thread David H. Adler
I'm sure it needs a few tweaks, but I've managed to write a hq9+ interpreter in pasm. [insert deity here] help us all. :-) Any thoughts on this? http://www.thetasigma.com/parrot/ dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ It's all eggs, bacon, beans and a fried