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 s

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

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

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

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 callin

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 Pe

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 S

Re: imcc's "call" vs first class functions

2003-08-01 Thread K Stol
If I understood well, the problem is that subroutines can be saved in variables, right (or registers for that matter)? So, if there is some subroutine "f", you could just do: $I1 = addr _f# get address of subroutine f $P1 = new Sub# create a new Sub PMC $P1 = $I1# store add

RE: imcc's

2003-08-01 Thread Joseph F. Ryan
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 style yet. (but I'm not sure, so don't hold

Set vs. Assign..?

2003-08-01 Thread T.O.G. of Spookware
Hi, all. I've been following Parrot development and been playing with Parrot for a...bout a year and a half, now. First time posting to the list, though, so forgive me if this has already been covered or is stupid in some way :-) Anyway, while playing around with IMCC, this kind of bugged me: P3

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 i

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 tha

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: [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 cor

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, dynclasses/M

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

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: > >$P = $P1 >$P2 = $P Actually, that (sometimes) should be able to be changed to: $P2 = $P1 noop or: noop

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 late

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 willin

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 t

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: 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. C could e.g. return a NULL in case of failure, and we could then throw an exception in F at the opcode-level, so that

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 i

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

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://mem

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 li

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 > declar

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

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 comp