Re: No C op with PMC arguments?

2004-11-04 Thread Leopold Toetsch
Sam Ruby wrote: This omission seems odd. Was this intentional? A single pow_p_p_p op backed by a (non-MMD) vtable entry would make it easier to support code like the following: Well, Python has a pow "vtable" slot. And it should be MMD. Patches welcome, leo

Re: Solicitation of Ideas for Performance Statistics and Graphs

2004-11-04 Thread Leopold Toetsch
Joshua Gatcomb <[EMAIL PROTECTED]> wrote: > If you would like to see any of these ideas > implemented, or you have some of your own - please > respond to this on the list. I've amother one. Parrot has some internal settings and tweakable magic constants, mainly all inside the garbage collector. I

Re: Closures and subs

2004-11-04 Thread Leopold Toetsch
Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: > Hello, > I've been playing with closures and subs but I have a little bit of > trouble with those. newsub $P0, .Closure, _foo $P0(q) newsub $P0, .Closure, _foo $P0(q) Closures have to be distinct. leo

Re: [PATCH] [resend] support of uniline yield/return

2004-11-04 Thread Leopold Toetsch
Stéphane Payrard wrote: My previous mail to [EMAIL PROTECTED] did not seem to make it. So the resend with many recipients. This is the patch to support the uniline yield/return we talked 2 weeks ago. I know that Leo advocate to separate the implementation of PASM and PIR. By retailoring the grammar

Re: [PATCH] dynclass build

2004-11-04 Thread Leopold Toetsch
Sam Ruby <[EMAIL PROTECTED]> wrote: > Attached patch makes building in the dynclass ghetto a bit less > inhospitable... Thanks, applied. leo

Re: No C op with PMC arguments?

2004-11-04 Thread Jeff Clites
On Nov 3, 2004, at 8:09 AM, Dan Sugalski wrote: At 11:04 AM -0500 11/3/04, Sam Ruby wrote: A single pow_p_p_p op backed by a (non-MMD) vtable entry would make it easier to support code like the following: def f(x): return x**3 print f(3), f(2.5) Yeah, it would. I know I'm going to regret ask

Re: Closures and subs

2004-11-04 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: Hello, I've been playing with closures and subs but I have a little bit of trouble with those. newsub $P0, .Closure, _foo $P0(q) newsub $P0, .Closure, _foo $P0(q) Closures have to be distinct. leo Tha

Re: Closures and subs

2004-11-04 Thread Luke Palmer
I haven't written PIR in a while, and I'm not terribly familiar with the new changes, but I'll make some guesses. Klaas-Jan Stol writes: > function main() > >local p = 123; >local q = 345; > >foo(q); >foo(q); > >function foo(a) # nested function, it does have access to

Re: Closures and subs

2004-11-04 Thread Klaas-Jan Stol
I now see I made some errors (I explain below) First, I show the Lua code: function newCounter () local i = 0 return function () -- anonymous function i = i + 1 return i end end c1 = newCounter() print(c1()) --> 1 print(c1()) --> 2 This is the translation (and it works! :-) .sub _

Please, Help on I/O

2004-11-04 Thread Christian Aperghis-Tramoni
I have the folowing program : print "Give me an integer number : ¥n" getstdinP0 readline S1,P0 Its execution gives : 10 Give me an integer number : How is it possible to flush stdout before reading the number. It means the equivalent of the $| in Perl.

Re: Please, Help on I/O

2004-11-04 Thread Marty Pauley
On Thu Nov 4 11:53:45 2004, Christian Aperghis-Tramoni wrote: > > It means the equivalent of the $| in Perl. You can switch off buffering on stdout by doing: getstdout P1 pioctl I0, P1, 3, 0 To switch back to line buffering, do: getstdout P1 pioctl I0, P1, 3, 1 -- Marty

Re: No C op with PMC arguments?

2004-11-04 Thread Sam Ruby
Jeff Clites wrote: On Nov 3, 2004, at 8:09 AM, Dan Sugalski wrote: At 11:04 AM -0500 11/3/04, Sam Ruby wrote: A single pow_p_p_p op backed by a (non-MMD) vtable entry would make it easier to support code like the following: def f(x): return x**3 print f(3), f(2.5) Yeah, it would. I know I'm

Re: [PATCH] dynclass build

2004-11-04 Thread Dan Sugalski
At 10:07 AM +0100 11/4/04, Leopold Toetsch wrote: Sam Ruby <[EMAIL PROTECTED]> wrote: Attached patch makes building in the dynclass ghetto a bit less inhospitable... Thanks, applied. Are we comfortable adding the dynclasses to the default build target? I want to at some point, if only to make re

Re: [PATCH] dynclass build

2004-11-04 Thread Sam Ruby
Dan Sugalski wrote: At 10:07 AM +0100 11/4/04, Leopold Toetsch wrote: Sam Ruby <[EMAIL PROTECTED]> wrote: Attached patch makes building in the dynclass ghetto a bit less inhospitable... Thanks, applied. Are we comfortable adding the dynclasses to the default build target? I want to at some point

Re: No C op with PMC arguments?

2004-11-04 Thread Dan Sugalski
At 1:19 AM -0800 11/4/04, Jeff Clites wrote: On Nov 3, 2004, at 8:09 AM, Dan Sugalski wrote: At 11:04 AM -0500 11/3/04, Sam Ruby wrote: A single pow_p_p_p op backed by a (non-MMD) vtable entry would make it easier to support code like the following: def f(x): return x**3 print f(3), f(2.5) Y

Does Parrot have "True coroutines"?

2004-11-04 Thread Klaas-Jan Stol
Hello, I spoke (through email) with Roberto Ierusalimschy, one of the creators of the Lua programming language, and I said that Parrot has good support for implementing coroutines and closures (heck, they are explicitly there). However, in a reply, Roberto asked: "Are you sure Parrot support "tru

Re: No C op with PMC arguments?

2004-11-04 Thread Leopold Toetsch
Jeff Clites <[EMAIL PROTECTED]> wrote: > I feel like we have op-itis and vtable-itis. I'm for sure the last one that would add an opcode or a vtable, if it's not needed. But in that case it has to be one. The PMC can be any kind of plain scalar and also *complex*. We have different operations wit

Re: [PATCH] dynclass build

2004-11-04 Thread Leopold Toetsch
Dan Sugalski <[EMAIL PROTECTED]> wrote: > Are we comfortable adding the dynclasses to the default build target? I think it can go in. > I want to at some point, if only to make really sure that we don't > break them. (As stuff that gets built and tested by default stays up > to date, while the r

Re: Closures and subs

2004-11-04 Thread Leopold Toetsch
Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: > Thanks for your quick reactions. You are welcome. > Indeed, doing > $P0(q) > works ok. I'm a bit confused by syntax then (but I think it makes sense > now, if IMCC sees the "(", it is expecting args I guess) Yep. Function and method calls as well a

Re: [PATCH] dynclass build

2004-11-04 Thread Dan Sugalski
At 3:51 PM +0100 11/4/04, Leopold Toetsch wrote: Dan Sugalski <[EMAIL PROTECTED]> wrote: Are we comfortable adding the dynclasses to the default build target? I think it can go in. Lets do that then. > I want to at some point, if only to make really sure that we don't break them. (As stuff that

Intermittently Failing Benchmarks

2004-11-04 Thread Joshua Gatcomb
All: In collecting the historical data for the benchmark statistics and graphs, I discovered that there were a few days where I had to play the CVS time game to get a working parrot for that day. I expected this. What I have found interesting though is when individual benchmarks don't work. For

Re: Intermittently Failing Benchmarks

2004-11-04 Thread Matt Diephouse
On Thu, 4 Nov 2004 08:57:28 -0800 (PST), Joshua Gatcomb <[EMAIL PROTECTED]> wrote: > What I have found interesting though is when > individual benchmarks don't work. For instance, from > 10/20 to 10/22, gc_generations and gc_header_reuse > would just hange (still running after 10 minutes). > Last

Re: Intermittently Failing Benchmarks

2004-11-04 Thread Leopold Toetsch
Matt Diephouse <[EMAIL PROTECTED]> wrote: > Maybe the benchmarks should be part of the test suite? They're valid > code, so they should work at all times: if they don't, something's > broken. Seems like a good opportunity for testing to me. Yep. Patches welcome. But please make sure that they do

Re: Does Parrot have "True coroutines"?

2004-11-04 Thread Leopold Toetsch
Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: > Hello, > "Are you sure Parrot support "true" coroutines? Does it integrate > coroutines and closures correctly? (For instance, a single closure may > refer to variables in several different coroutines.)" Well, I don't know how "true" coroutines are defi

Branching off the tree

2004-11-04 Thread Dan Sugalski
Since I'm about to start in on some of the Irrevocable Changes (or something like that) to the string system with the new encoding/charset stuff, I tagged CVS and will be working in a branch (I hope). If you feel like watching or playing along at home, the branch is "pluggable_encodings", assu

Search paths and library routines

2004-11-04 Thread Dan Sugalski
Okay, this has been an ongoing source of annoyance, and I think it's time to address it. We need to get search paths for loading of stuff into parrot, both at the pir/pasm assembly level and at runtime for dynamic library loading. Now, bizarrely enough, I *don't* want to build this into parrot

Shared library question

2004-11-04 Thread Sam Ruby
Background: Pmc2c.pm emits code which references Parrot_PMC_typenum. This code is present in libparrot.so, which currently is not referenced as a library by the link step for dynclasses. Options include: 1) eliminating this dependency, as it is the only one 2) directly including extend.o int

Re: Shared library question

2004-11-04 Thread Dan Sugalski
At 3:49 PM -0500 11/4/04, Sam Ruby wrote: Background: Pmc2c.pm emits code which references Parrot_PMC_typenum. This code is present in libparrot.so, which currently is not referenced as a library by the link step for dynclasses. Options include: 1) eliminating this dependency, as it is the onl

Re: Does Parrot have "True coroutines"?

2004-11-04 Thread Klaas-Jan Stol
Well, I don't know how "true" coroutines are defined, but Parrot, as it's CPS based, has no problems with coroutines and there are no restrictions to coroutines, AFAIK. To be honest, I hadn't thought of this, either (this "true"-ness of coroutines), but then again, I'm no expert on these thing

Re: Are we done with big changes?

2004-11-04 Thread Matt Diephouse
On Tue, 2 Nov 2004 13:35:09 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote: > What, think this warrants a 0.1.2 release? I'm not so sure about > that. It's not that big a deal... In the past week, Parrot has seen a dramatic speedup. We're in about the best shape we've been in in the past 4 months:

Re: Are we done with big changes?

2004-11-04 Thread Dan Sugalski
At 4:38 PM -0500 11/4/04, Matt Diephouse wrote: On Tue, 2 Nov 2004 13:35:09 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote: What, think this warrants a 0.1.2 release? I'm not so sure about that. It's not that big a deal... In the past week, Parrot has seen a dramatic speedup. We're in about the be

Re: Does Parrot have "True coroutines"?

2004-11-04 Thread Michael Walter
I sense confusion between "closure", "continuation" and "coroutine". http://c2.com/cgi/wiki?ContinuationExplanation http://c2.com/cgi/wiki?ContinuationsAndCoroutines http://c2.com/cgi/wiki?CoRoutine http://c2.com/cgi/wiki?LexicalClosure Cheers, Michael On Thu, 04 Nov 2004 22:11:07 +0100, Klaas-

Re: Closures and subs

2004-11-04 Thread Piers Cawley
Leopold Toetsch <[EMAIL PROTECTED]> writes: > Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: >> Hello, > >> I've been playing with closures and subs but I have a little bit of >> trouble with those. > > newsub $P0, .Closure, _foo > $P0(q) > newsub $P0, .Closure, _foo >

Re: Does Parrot have "True coroutines"?

2004-11-04 Thread Stéphane Payrard
On Thu, Nov 04, 2004 at 10:11:07PM +0100, Klaas-Jan Stol wrote: > > I hadn't seen ".yield(x)" > Is >.yield(x) > > the same as: > >.pcc_begin_yield >.return x >.pcc_end_yield > ? > Yes. This alternative syntax has been checked in yesterday and is documented in the updated callin

Re: Search paths and library routines

2004-11-04 Thread Brent 'Dax' Royal-Gordon
Dan Sugalski <[EMAIL PROTECTED]> wrote: > To make this actually work we need some standards, and the ability to > embed bytecode segments into an executable (like, say, parrot :) so > they're always at hand. The attached patch implements one (evil) way to do this. (Even if we don't end up using t

Re: No C op with PMC arguments?

2004-11-04 Thread Brent 'Dax' Royal-Gordon
Jeff Clites <[EMAIL PROTECTED]> wrote: > I.e., PMCs don't inherently exponentiate--numbers do, and you can > exponentiate PMCs by numberizing them, exponentiating, and creating a > PMC with the result. This is true. But how do you define a number? Do you include floating-point? Fixed-point? Bi

Re: No C op with PMC arguments?

2004-11-04 Thread Jeff Clites
On Nov 4, 2004, at 8:29 PM, Brent 'Dax' Royal-Gordon wrote: Jeff Clites <[EMAIL PROTECTED]> wrote: I.e., PMCs don't inherently exponentiate--numbers do, and you can exponentiate PMCs by numberizing them, exponentiating, and creating a PMC with the result. This is true. But how do you define a numb

Re: No C op with PMC arguments?

2004-11-04 Thread Brent 'Dax' Royal-Gordon
On Thu, 4 Nov 2004 21:46:19 -0800, Jeff Clites <[EMAIL PROTECTED]> wrote: > On Nov 4, 2004, at 8:29 PM, Brent 'Dax' Royal-Gordon wrote: > > This is true. But how do you define a number? Do you include > > floating-point? Fixed-point? Bignum? Bigrat? Complex? Surreal? > > Matrix? N registers