Re: Objects, methods, attributes, properties, and other related frobnitzes

2003-02-21 Thread Benjamin Goldberg
Dan Sugalski wrote: > > At 2:06 PM + 2/19/03, Peter Haworth wrote: > >On Fri, 14 Feb 2003 15:56:25 -0500, Dan Sugalski wrote: > >> I got clarification. The sequence is: > >> > >> 1) Search for method of the matching name in inheritance tree > >> 2) if #1 fails, search for an AUTOLOAD > >>

Re: Objects, methods, attributes, properties, and other related frobnitzes

2003-02-21 Thread Benjamin Goldberg
Andy Wardley wrote: > > Dan Sugalski wrote much sense, including these gems: [snip] > > Code must be able to fetch a handle on a particular method for later > > calling > > By this I presume you mean that the handle would be frozen to the > method as it was when then handle was fetched? If you l

Re: Objects, methods, attributes, properties, and other related frobnitzes

2003-02-21 Thread Benjamin Goldberg
Dan Sugalski wrote: > > At 12:06 AM -0500 2/21/03, Benjamin Goldberg wrote: > >Andy Wardley wrote: > >> > >> Dan Sugalski wrote much sense, including these gems: > >[snip] > >> > Code must be able to fetch a handle on a particular method for &g

Re: Objects, methods, attributes, properties, and other related frobnitzes

2003-02-22 Thread Benjamin Goldberg
Graham Barr wrote: > > On Fri, Feb 21, 2003 at 04:34:42PM -0500, Dan Sugalski wrote: > > If A isa B, we certainly wouldn't want to call A's AUTOLOAD on a > > method before we looked to see if B had a concrete instance of that > > method. > > Right. The best you could probably do is note where you

Re: Objects, methods, attributes, properties, and other related frobnitzes

2003-02-22 Thread Benjamin Goldberg
Dan Sugalski wrote: > Benjamin Goldberg wrote: >> Graham Barr wrote: >>> Dan Sugalski wrote: >>>> If A isa B, we certainly wouldn't want to call A's AUTOLOAD on a >>>> method before we looked to see if B had a concrete instance of that >>&

Re: [RFC] imcc calling conventions

2003-02-22 Thread Benjamin Goldberg
Dan Sugalski wrote: > > At 9:55 AM -0800 2/20/03, Steve Fink wrote: [snip] > >Or, as another stab at the same problem, does Parrot really need 32*4 > >registers? I keep thinking we might be better off with 16 of each > >type. But maybe I'm just grumbling. > > Yeah, 32 is a bunch. I've considered

Re: [RFC] imcc calling conventions

2003-02-25 Thread Benjamin Goldberg
Piers Cawley wrote: [snip] > Um... no. tail call optimization implies being able to replace *any* > tail call, not just a recursive one with a simple goto. [snip] In perl5, doing a tail call optimization can be done with just a simple goto... well, 'goto &subname', anyway. (Well, first you'd assi

Re: [RFC] imcc calling conventions

2003-02-26 Thread Benjamin Goldberg
Piers Cawley wrote: > > Benjamin Goldberg <[EMAIL PROTECTED]> writes: > > > Piers Cawley wrote: > > [snip] > >> Um... no. tail call optimization implies being able to replace *any* > >> tail call, not just a recursive one with a simple goto. &

Re: Parrot 0.0.10 freeze

2003-02-26 Thread Benjamin Goldberg
Jerome Quelin wrote: > > Steve Fink wrote: > > I'm assuming this will be 0.0.10 > > codename? > > > I could be persuaded to call it 0.1.0 > > codename? African Grey, Brotogeris, Parakeet, Budgerigar, Budgie, Cockatiel, Cockatoo, Conure, Eclectus, Kakapo, Lory, Lorikeet, Lovebird, Macaw, Parrot

Re: [RFC] imcc calling conventions

2003-02-27 Thread Benjamin Goldberg
Dan Sugalski wrote: > > At 10:03 PM -0500 2/26/03, Benjamin Goldberg wrote: > >I would not have suggested such a thing. Tail call optomization in > >parrot should be about the same logical semantics as perl5's goto > >&subname (except maybe being faster)

Re: [RFC] imcc calling conventions

2003-03-03 Thread Benjamin Goldberg
Dan Sugalski wrote: > Benjamin Goldberg wrote: >> Jason Gloudon wrote: >>> Piers Cawley wrote: >>> >>>>> I think you're overlooking the "restoreall" done just before >>>>> the jump-no-save-returnaddress operation... I see tw

Re: [RFC] imcc calling conventions

2003-03-03 Thread Benjamin Goldberg
Jason Gloudon wrote: > > On Mon, Mar 03, 2003 at 01:07:36PM +, Piers Cawley wrote: > > > > I think you're overlooking the "restoreall" done just before the > > > jump-no-save-returnaddress operation... I see two "saveall"s and > > > two "restoreall"s. > > > > But with proper tail call optimi

Re: Object spec, try 2

2003-03-03 Thread Benjamin Goldberg
Brent Dax wrote: > > Dan Sugalski: > # Okay, here's another shot at the semantics for objects. If folks, > # especially non-perl folks, would look this over and chime in, I'd > # much appreciate it. [snip] > I honestly don't care much about such languages, but how is Parrot > going to support clas

Re: Object spec, try 2 [x-adr][x-bayes]

2003-03-03 Thread Benjamin Goldberg
Erik Bågfors wrote: > Garrett Goebel wrote: >> Erik Bågfors wrote: >>> Dan Sugalski wrote: Okay, here's another shot at the semantics for objects. If folks, especially non-perl folks, would look this over and chime in, I'd much appreciate it. Objects have (all optional): >>

Re: Object spec, try 2

2003-03-02 Thread Benjamin Goldberg
Dan Sugalski wrote: [snip] > All of these--method lookup, property lookup, attribute lookup--may > be intercepted, and all may have a fallback method that's called if > the 'proper' lookup fails. > > I think this about covers it. If there's missing semantics, and I > expect I missed something, let

Parrot for windows?

2003-03-10 Thread Benjamin Goldberg
Does anyone have a precompiled parrot binary for Win32, on an ftp or web site somewhere? I'm practicing writing parrot assembler, and I'd like to be able to test my evil creations on my own machine, without having to go through the rigmarole of uploading my file to my sourceforge account, then ss

Re: Parrot extensions, or PMC versatility

2003-03-14 Thread Benjamin Goldberg
Darren Duncan wrote: [snip] > I decided that I shouldn't waste my time with the Perl 5 XS system and > go straight to using the corresponding Parrot extension mechanism > instead. Partly this is because the latter should be more mature by > the time I am ready to write the C, and also because it s

Re: [perl #21600] [PATCH] Enable buffer io in PIO

2003-03-17 Thread Benjamin Goldberg
"JüRgen BöMmels" wrote: [snip] > void > PIO_unix_flush(theINTERP, ParrotIOLayer *layer, ParrotIO *io) > { > -# if 0 > fsync(io->fd); > -# endif > } AFAIK, for disk files, fsync has (should have) no visible effect from the point of view of any user program -- all it does is tell the OS t

Speed question: save/restore vs push/pop

2003-03-16 Thread Benjamin Goldberg
The answer to this question varies from platform to platform, and I've only go windows to test on... If I do 32 "save"s in a row, this will certainly be slower than doing a single "push". If I do 1 "save", this will (hopefully) be faster than 1 "push". How many "save"s does it take to be to be

Re: Speed question: save/restore vs push/pop

2003-03-17 Thread Benjamin Goldberg
Steve Fink wrote: > > On Mar-17, Benjamin Goldberg wrote: > > > > The answer to this question varies from platform to platform, and > > I've only go windows to test on... > > > > If I do 32 "save"s in a row, this will certainly be slower than

Re: 99... (hint: not red baloons)

2003-03-19 Thread Benjamin Goldberg
Douglas Hunter wrote: [snip] > branch ONE_BOTTLE # 'bout time for a liver transplant > > ONE_BOTTLE: # it's been fun The ONE_BOTTLE label isn't gone to by anything else in the program, and the one instruction which does go to it, is immediately before it. So, what's the reason for it?

Re: some comments on pdd 14 Big Numbers

2003-03-19 Thread Benjamin Goldberg
Perhaps this might sound like a foolish suggestion, but... Wouldn't it be better (for some definition of better) to design our BigInt type so that we can replace the math engine with a different math engine? Eg, so we could plug in GMP, or PARI, or Miracl, etc.? (With a fallback to our own math

Re: [perl #21656] [PATCH] read buffering in i/o

2003-03-22 Thread Benjamin Goldberg
"JüRgen BöMmels" wrote: [snip] > is(, <, < char buf[1024]; [snip] > len = PIO_read(interpreter, io, buf, sizeof(buf)); [snip] > buf[len] = '\0'; This, almost certainly, should be: buf[MIN(len, 1023)] = '\0'; After all, 'len' could concievably be 1024, if you decide to change you

Re: [perl #21668] APL doesn't use sigils

2003-03-24 Thread Benjamin Goldberg
And what happens if a programmer wants to have two different variables, of two different types, with the same name, such as @data and %data? Without sigils, it cannot be done. -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL P

Re: [perl #21668] APL doesn't use sigils

2003-03-25 Thread Benjamin Goldberg
Adam Turoff wrote: > > On Mon, Mar 24, 2003 at 08:21:51PM -0500, Benjamin Goldberg wrote: > > And what happens if a programmer wants to have two different > > variables, of two different types, with the same name, such as @data > > and %data? > > > > Without

Re: [perl #21668] APL doesn't use sigils

2003-03-25 Thread Benjamin Goldberg
Adam Turoff wrote: > Benjamin Goldberg wrote: >> Adam Turoff wrote: >>> On Mon, Mar 24, 2003 at 08:21:51PM -0500, Benjamin Goldberg wrote: >>>> And what happens if a programmer wants to have two different >>>> variables, of two different types, with t

Re: [perl #21668] APL doesn't use sigils

2003-03-26 Thread Benjamin Goldberg
Stéphane Payrard wrote: [snip] > Non alphabetic characters are very conspicuous, so redundancy should > be avoided. But Sigil _and_square/curly bracket are redundant. Not quite... In Perl5, the dereference operator (->) is optional between pairs of subscript operators, so $foo[$x]->[$y] can be wr

Re: getopt.macro

2003-03-27 Thread Benjamin Goldberg
Jonathan Scott Duff wrote: > > I'm fiddling around with parrot and created a getopt macro (inspired > by the arg processing in Leon Brocard's uniq.pasm :-). This is my > first attempt at something semi-useful in parrot. > > Anyway, here it is and looking for comments, [snip] > # Note: Both P15

Parrot regex engine

2003-04-03 Thread Benjamin Goldberg
I've been looking over the rx.ops, and am amazed at how cool it is :) I'm wondering, however -- was this based on something else? That is, does there exist some utility which translates regexen into C (or assembly) code, similar to how we translate regexen into parrot code? I've been searching,

Re: Parrot regex engine

2003-04-03 Thread Benjamin Goldberg
Steve Fink wrote: > > On Apr-03, Benjamin Goldberg wrote: > > > > I've been looking over the rx.ops, and am amazed at how cool it is :) > > > > I'm wondering, however -- was this based on something else? > > I believe Brent cooked it up more

Timely object destruction

2003-06-03 Thread Benjamin Goldberg
Piers Cawley wrote: > > The Perl 6 Summary for the week ending 20030601 > Another Monday, another Perl 6 Summary. Does this man never take a > holiday? (Yes, but only to go to Perl conferences this year, how did > that happen?) > > We start with the internals list as usual. > >

Re: Timely object destruction

2003-06-05 Thread Benjamin Goldberg
Matt Fowles wrote: > > Benjamin Goldberg wrote: > >>For more complex cases timely destruction will not be assured. > > > > Which is not-so-good. We'd like timely destruction *always* > > > > However, given that your suggestion can be implement

Re: [perl #22549] [PATCH] rename invoke to call, and more

2003-06-05 Thread Benjamin Goldberg
Jonathan Sillito wrote: [snip] > -inline op invoke(in PMC) { +inline op call(in PMC) { >opcode_t *dest; > - PMC * p = $1; > - > - dest = (opcode_t *)p->vtable->invoke(interpreter, p, expr NEXT()); > - > + PMC * sub = $1; > + dest = (opcode_t *)p->vtable->invoke(interpreter, sub, expr NEXT()

Re: [perl #22549] [PATCH] rename invoke to call, and more

2003-06-05 Thread Benjamin Goldberg
Jonathan Sillito wrote: [snip] > -inline op invoke(in PMC) { +inline op call(in PMC) { >opcode_t *dest; > - PMC * p = $1; > - > - dest = (opcode_t *)p->vtable->invoke(interpreter, p, expr NEXT()); > - > + PMC * sub = $1; > + dest = (opcode_t *)p->vtable->invoke(interpreter, sub, expr NEXT()

cancel <3EDE69AB.C63D61A6@hotpop.com>

2003-06-05 Thread Benjamin Goldberg
This message was cancelled from within Mozilla.

Re: How do I write a language debugger?

2003-06-12 Thread Benjamin Goldberg
"Clinton A. Pierce" wrote: [snip] > DEBUGGER: > if one-stepping, DEBUG > # Loop over break list > if current statement is on global break list, DEBUG > # End loop > ret No comment on your *particular* problem, but might I suggest that you keep your b

Re: [PATCH] cmp ops

2003-06-08 Thread Benjamin Goldberg
Luke Palmer wrote: > > Here's some much-needed cmp ops. [snip] > +=item B(out INT, in NUM, in NUM) [snip] > +inline op cmp(out INT, in NUM, in INT) { s/in INT/in NUM/; -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED

save[insp]/restore[insp]

2003-05-30 Thread Benjamin Goldberg
Looking over the code for these ops, ISTM that the stack_push and stack_pop functions which implements them is too bloated. How often, in practice, is the Stack_cleanup_method cleanup thing needed? On those occasions when it is needed, is it ever with a Num, Int, or Str? Or is it only with PMCs

Re: Timely object destruction

2003-06-04 Thread Benjamin Goldberg
Leopold Toetsch wrote: > Benjamin Goldberg wrote: > >> I'd like to reiterate (and clarify) my idea, of a hybrid scheme >> combining refcounting and DoD. > > I'll try to translate this to parrot speak. I hope that I fully > understand your scheme, but lets

Re: Timely object destruction

2003-06-04 Thread Benjamin Goldberg
Miko O'Sullivan wrote: > > On Mon, 2 Jun 2003, Benjamin Goldberg wrote: > > > All values needing timely destruction would inherit from a class > > RefCounted. > > I like this concept a lot, but maybe we can take it a little further > and make it transpare

Re: Timely object destruction

2003-06-04 Thread Benjamin Goldberg
After reading Leopold Toetsch's post, I'm going to simplify part of my proposal slightly. Benjamin Goldberg wrote: [snip] > To avoid premature cleanup, any time that the contents of a > refcounted variable is assigned to a non-refcounted variable, an > opcode to set

Re: Timely object destruction

2003-06-04 Thread Benjamin Goldberg
Matt Fowles wrote: > > All~ > > I have been following the whole GC/timely destruction thing for a > while and have a few questions/observations. > > Most of the ref counting systems provide for very simple ref counting > containers and, essentially, provide timely destruction for the simple > ca

Re: Exceptions

2003-06-26 Thread Benjamin Goldberg
Dan Sugalski wrote: > Piers Cawley wrote: >> Dan Sugalski <[EMAIL PROTECTED]> writes: >> >>> Okay, now that we're well on our way to getting >>> sub/method/whatever calling down and working, I want to point us >>> towards what I'm thinking of for exceptions. >>> >>> Exception handlers really strike

Re: multi stack question/grumble

2003-06-30 Thread Benjamin Goldberg
Dave Whipp wrote: > Matt Fowles >> Were this C++ I would say that we could write a single general >> purpose stack and use template meta-programming to avoid the >> overhead. Is there a similar solution available in C? >> >> My instincts tell me that this solution will be dirty to the tune of >> m

Re: Exceptions

2003-06-30 Thread Benjamin Goldberg
Brent Dax wrote: > > Benjamin Goldberg: > # Concievably, we could then examine the exception, and maybe decide > # that it was nonfatal, and resume execution from just after the place > # it was thrown from. > > The problem with that is that some exceptions are unresu

Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-02 Thread Benjamin Goldberg
Andy Dougherty wrote: > > On Tue, 1 Jul 2003, Leopold Toetsch wrote: > > > Andy Dougherty <[EMAIL PROTECTED]> wrote: > > > On Mon, 30 Jun 2003, Leopold Toetsch wrote: > > > > >> Attached is a minimum patch to build imcc as the parrot executable > > > > >languages/imcc/*.o > > >

Re: [perl #22864] [PATCH] Move ParrotIO to PMCs

2003-07-03 Thread Benjamin Goldberg
Leopold Toetsch wrote: > > Andy Dougherty <[EMAIL PROTECTED]> wrote: > > On Thu, 3 Jul 2003, Juergen Boemmels wrote: > > >> more errors like this: t/op/interp_1.pasm and t/op/gc_1.t are the ones > >> I know of. We will have much fun with bugs like this. > > > This might be another one -- t/op/

Re: Lazy Arrays

2003-07-03 Thread Benjamin Goldberg
Luke Palmer wrote: > > I'd like to go about implementing [Perl]?LazyArray and LazySequence > pmcs, possibly with a TiedArray (and Infinity) in the interim. I have > a few semantic questions, but first, here's what I have in mind: > > LazySequence: Manages individual lazy sequences like 1..I

Re: wxWindows Support / Interfacing libraries with Parrot

2003-07-10 Thread Benjamin Goldberg
Leopold Toetsch wrote: > > Tupshin Harper wrote: > > > > > I'm not a "GCC person", but I do have an interest in this working. I > > did some exploratory work (mostly getting familiar with the GCC > > backend mechanism and with PASM), and quickly ran into what appeared > > to be fundamental roadbl

Re: Perl* Abstraction

2003-07-11 Thread Benjamin Goldberg
Leopold Toetsch wrote: > Nick Glencross wrote: > > > Having read up in the past on Perl5 internals, it seems to be > > capable of keeping more than one representation of a Scalar active > > at a time. > > > > Anyone know if there are plans to do this kind of optimisation? > > I don't think, this

Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-11 Thread Benjamin Goldberg
Leopold Toetsch wrote: [snip] > - When will we check, it there are events in the event queue? If we check too often (between each two ops), it will slow things down. If we don't check often enough, the code might manage to avoid checking for events entirely. I would suggest that every flow contr

Re: [perl #22922] Parrot threading!

2003-07-12 Thread Benjamin Goldberg
"Graciliano M . P ." wrote: > > # New Ticket Created by Graciliano M. P. > # Please include the string: [perl #22922] > # in the subject line of all future correspondence about this issue. > # http://rt.perl.org/rt2/Ticket/Display.html?id=22922 > > > There is some plan of how threading will w

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-17 Thread Benjamin Goldberg
Sean O'Rourke wrote: > > On Thu, 17 Jul 2003, Leopold Toetsch wrote: > > PC = ((op_func_t*) (*PC)) (PC, INTERP); // prederef functions > > > > To be able to switch function tables, this then should become: > > > > PC = ((op_func_t*) (func_table + *PC)) (PC, INTERP); > > > > Thus prederefernc

Re: Events

2003-07-18 Thread Benjamin Goldberg
Damien Neil wrote: [snip] > Also, given that asynchronous IO is a fairly unpopular programming > technique these days (non-blocking event-loop IO and blocking > threaded IO are far more common), I would think long and hard before > placing support for it as a core design goal of the VM. If there >

Re: Aliasing an array slice

2003-07-18 Thread Benjamin Goldberg
David Storrs wrote: > > Thinking about it, I'd rather see lvalue slices become a nicer version > of C. > > my @start = (0..5); > my @a = @start; > > @a[1..3] = qw/ a b c d e /; > print @a; # 0 a b c d e 4 5 What would happen if I used 1,2,3 instead of 1..3? Would it do

Re: Aliasing an array slice

2003-07-18 Thread Benjamin Goldberg
Luke Palmer wrote: > > > David Storrs wrote: > > > > > > Thinking about it, I'd rather see lvalue slices become a nicer version > > > of C. > > > > > > my @start = (0..5); > > > my @a = @start; > > > > > > @a[1..3] = qw/ a b c d e /; > > > print @a; # 0 a b c d e 4 5 > > >

Re: Aliasing an array slice

2003-07-18 Thread Benjamin Goldberg
Dave Whipp wrote: > "Luke Palmer" wrote: > > Benjamin Goldberg wrote: > > > David Storrs wrote: > > > > @a[1..3] = qw/ a b c d e /; > > > > print @a; # 0 a b c d e 4 5 > > > > > > What would happen if I used 1,2,3

Re: [WIP PATCH] core.ops split-up

2003-07-18 Thread Benjamin Goldberg
With this increase in the number of files, I'm going to ask for something I've thought of for a while, but not had the guts to ask for. Could we try and clean up the parrot/ directory? Specifically, I'd like all of the source code itself moved into a single subdirectory, leaving at the toplevel

Aren't we supposed to be using VTABLE_ macros?

2003-07-18 Thread Benjamin Goldberg
Maybe someone should write a script like this: #!/usr/local/bin/perl -wlpi.bak s/ (\$?\w+) \s* -> \s* vtable \s* -> \s* (\w+) \s* \( \s* (interp\w*) \s* , \s* \1 \s*, /VTABLE_$2($3, $1,/xg; __END__ [untested] Then run it on all the code, except that which actually define

Re: Small perl task for the interested

2003-07-19 Thread Benjamin Goldberg
Josh Wilmes wrote: > > At 12:48 on 07/14/2003 +0200, Lars Balker Rasmussen <[EMAIL PROTECTED]> wrote: > > > I've taken this very simple approach to the problem. A perl-wrapper > > for the CC lines in makefiles/root.in > > > > .c$(O) : > > $(PERL) tools/dev/cc_flags.pl $(CC) $(CFLAGS)

Re: Events

2003-07-23 Thread Benjamin Goldberg
Dan Sugalski wrote: [snip] > Here's what we *are* doing. > > We are going to do all I/O under the hood asynchronously. Completed > async IO puts an event in the event queue. > > We are going to have a single unified event queue. All IO, timer, > signal, and UI events go in it. All of 'em. We aren

Re: The Perl 6 Summary -- preprocessors

2003-07-23 Thread Benjamin Goldberg
Luke Palmer wrote: > > > grammar Grammars::Languages::C::Preprocessor { > > rule CompilationUnit { > > ( | )* > > } > > > > rule Directive { > > ( Include > >| Line > >| Conditional > >| Define > > ) * > > } > > > > rule Hash { /^\s*#\s*

Re: [perl #23025] [PATCH] env.t doesn't test the env ops on solaris (and others)

2003-07-23 Thread Benjamin Goldberg
Lars Balker Rasmussen wrote: > > # New Ticket Created by Lars Balker Rasmussen > # Please include the string: [perl #23025] > # in the subject line of all future correspondence about this issue. > # http://rt.perl.org/rt2/Ticket/Display.html?id=23025 > > > There's no reason to test for the pr

Re: Protocols

2003-07-24 Thread Benjamin Goldberg
Chromatic wrote: [snip] > > I think you want to declare "I comply with ruleset X" at the callee > > object level. That enables the compiler to (1) check that you're not > > lying; and (2) optimize based on (1). > > At least one of us is using "caller/callee" in the X11 sense. What I > mean and wh

Slightly foolish question... :)

2003-07-24 Thread Benjamin Goldberg
What kind of semantics do we want for perl6, if we have: my $fh1 = fdopen( $n ); do { my $fh2 = fdopen( $n ); }; # is $fh1 valid or not at this point? For that matter, what about: for(1..2) { my $fh = fdopen( $n ); # does this succed the second time? } Should thes

Re: approaching python

2003-07-24 Thread Benjamin Goldberg
K Stol wrote: > > - Original Message - > From: "Michal Wallace" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 23, 2003 4:48 PM > Subject: approaching python > > > > > Hey all, > > > > I've been thinking about the "compiling python to > > parrot" concept. Right now

Re: approaching python

2003-07-27 Thread Benjamin Goldberg
K Stol wrote: > > - Original Message - > From: "Michal Wallace" <[EMAIL PROTECTED]> > To: "Luke Palmer" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Thursday, July 24, 2003 12:01 PM > Subject: Re: approaching python > > > > > On 24 Jul 2003, Luke Palmer wro

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

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 = $

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 >

string.c questions

2003-08-02 Thread Benjamin Goldberg
Actually, these are mostly questions about the string_str_index function. I've some questions about bufstart, strstart, bufused, strlen and encoding->characters? I *think* that ->characters is a fuction which gets passed a pointer to the start of a buffer, and the number of bytes in the buffer,

rx.ops

2003-08-02 Thread Benjamin Goldberg
Since I don't see anything to save/restore the instack on subroutine calls, I am wondering what happens if a regex has a (?{ CODE }), and that CODE calls a regex. Are we garunteed that after a regex completes (either succeeds or fails) that the intstack is in the same state it started? If not (a

Re: Macro arguments themselves

2003-08-02 Thread Benjamin Goldberg
Larry Wall wrote: [snip] > Nope. $x and $p are syntax trees. Macros are passed syntax trees as arguments, but return coderefs? That's... odd. I would expect that a macro would be expected to *return* a syntax tree... which could then undergo (more) macro-expansion. Sortof like how in lisp, a

Re: string.c questions

2003-08-03 Thread Benjamin Goldberg
Luke Palmer wrote: > > Benjamin Golberg writes: > > Actually, these are mostly questions about the string_str_index > > function. > > Uh oh... > > > I've some questions about bufstart, strstart, bufused, strlen and > > encoding->characters? > > > > In string_str_index_multibyte, the lastmatch

Re: string.c questions

2003-08-03 Thread Benjamin Goldberg
Leopold Toetsch wrote: > > Benjamin Goldberg <[EMAIL PROTECTED]> wrote: > > > Also, although we're told at the top of string.c to not look at > > s->bufstart or s->buflen, I'd like to know if we are allowed to > > assume/assert that for all stri

Ultra bootstrapping :)

2003-08-03 Thread Benjamin Goldberg
Considering that parrot is now emitting an executable (on some platforms)... and IIRC, C will be one of the languages we plan to have parrot support for... will parrot be able to compile itself? :) -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6

Infant mortality

2003-08-03 Thread Benjamin Goldberg
I was recently reading the following: http://www.parrotcode.org/docs/dev/infant.dev.html It's missing some things. One of which is the (currently used?) way of preventing infant mortality: anchor right away, or else turn off DoD until the new object isn't needed. This document doesn't mentio

Re: "As soon as she walked through my door..."

2003-08-03 Thread Benjamin Goldberg
Miko O Sullivan wrote: > > Congratulations to Damian on a great opening in Ex 6. Anybody can spoof > the classic detective novel setup, but it takes real talent to have it > actually make sense in the context of a technical document. How long till Ex 6 is online, for those of us who weren't ther

Re: Infant mortality

2003-08-04 Thread Benjamin Goldberg
Juergen Boemmels wrote: > > Benjamin Goldberg <[EMAIL PROTECTED]> writes: > > > I was recently reading the following: > > > >http://www.parrotcode.org/docs/dev/infant.dev.html > > > > It's missing some things. One of which is the (curre

Re: Infant mortality

2003-08-04 Thread Benjamin Goldberg
Having applied a bit more thought, having the generation field as part of the PMC isn't all that great -- it makes PMCs larger, but it's really only needed for new/neonate pmcs. Instead of attatching the generation directly to the pmc, have a global (per-interpreter) stack of neonate pmcs. Each

Re: Infant mortality

2003-08-07 Thread Benjamin Goldberg
Juergen Boemmels wrote: > > Benjamin Goldberg <[EMAIL PROTECTED]> writes: [snip] > > Except that generational_dod_helper is much simpler and faster -- it > > doesn't mark anything as alive or free, it only adjusts the generation > > of those pmcs that were c

Re: Set vs. Assign..?

2003-08-09 Thread Benjamin Goldberg
Leopold Toetsch wrote: > > Benjamin Goldberg <[EMAIL PROTECTED]> wrote: > > > I would suggest the opnames/categories "mutate," "alias," and > > "create." > > IMHO, we could leave PASM syntax as it is and create opcode aliases &g

Re: assign opcodes

2003-08-09 Thread Benjamin Goldberg
Togos wrote: > > > Anyway: > > > > assign Px, {Iy,Sy,Ny} > > > > are not needed IMHO, these end up as > > set__native and are identical > > to set Px, {Iy,Sy,Ny}. > > Yes, but as we were discussing in the > Set vs. Assign thread, it makes more sense > to call them 'assign', as it morphs the > e

Re: assign opcodes

2003-08-09 Thread Benjamin Goldberg
Leopold Toetsch wrote: > > I hopefully got the semantics of assign Px,Py right now. The LHS gets > the value of RHS, eventually morphing itself to the source type. > > Anyway: > >assign Px, {Iy,Sy,Ny} > > are not needed IMHO, these end up as set__native and are identical > to set Px, {Iy,

set_pmc vs clone?

2003-08-09 Thread Benjamin Goldberg
What's the difference between VTABLE_set_pmc and VTABLE_clone? -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED] ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

Re: parrot bug: continuations/multiple return

2003-08-10 Thread Benjamin Goldberg
Michal Wallace wrote: [snip] > def f(): > return g() [snip] > # f from line 3 > .pcc_sub _sub1 non_prototyped > .local object res1# (visitReturn:528) > find_lex $P2, 'g' # (callingExpression:325) > newsub $P3, .Continuation, ret0# (callingExpressi

Re: parrot bug: continuations/multiple return

2003-08-10 Thread Benjamin Goldberg
Michal Wallace wrote: > Benjamin Goldberg wrote: > > Michal Wallace wrote: [snip] > > Also... why is $P2 merely an imcc temporary, without a real name? > > That is, why not do: > > > > .pcc_sub _sub1 non_prototyped > > .local object sub1 > &

Re: assign opcodes

2003-08-11 Thread Benjamin Goldberg
Brent Dax wrote: > > TOGoS: > # Personally, I would like "=" to mean 'set', and > # maybe "<-" do 'assign'. > > I usually think of registers as variables with fixed names, so the Perl > 6 part of my brain suggests: > > $P0 = $P1 #assign > $P0 := $P1 #set Which is wh

perlnum.pmc

2003-08-14 Thread Benjamin Goldberg
Shouldn't the get_number() method use string_from_num, instead of calling sprintf/snprintf? -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED] ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

Re: Packfile stuff

2003-08-14 Thread Benjamin Goldberg
Luke Palmer wrote: > > Leopold Toetsch writes: > > Juergen Boemmels <[EMAIL PROTECTED]> wrote: > > > what still fails is pbc2c.pl (This needs Parrot::Packfile, which can > > > only read format 0 (old assemble.pl) bytecodes). > > > > This is obsoleted by Daniel's exec patches. > > Sadly. I mean

pmc.c ([constant_]pmc_new_noinit)

2003-08-14 Thread Benjamin Goldberg
In pmc_new_noinit, I see a switch() which decides whether or not to do add_pmc_ext. Why not have that information (whether or not an ext is needed) defined in each of the .pmc files, and stuck in the vtable? That would allow other cache-only pmcs to avoid getting an unnecessary chunk of bytes al

Re: What the heck is: timely destruction

2003-08-18 Thread Benjamin Goldberg
Michael G Schwern wrote: [snip stuff, including a mention of refcounting and it's (dis)advantages] > So Parrot is going with something else. Don't ask me what it is, I > don't know. Parrot will do it like Java -- a mark-and-sweep garbage collector -- with the difference that garbage collection wi

Re: Perl 6's for() signature

2003-08-14 Thread Benjamin Goldberg
Jonadab The Unsightly One wrote: > > John Siracusa <[EMAIL PROTECTED]> writes: > > > Did this ever get resolved to anyone's satisfaction? While reading > > EX6, I found myself wonder exactly what for() would look like in > > Perl 6 code... > > A for loop[1] is basically syntax sugar for a whi

Re: Timely Destruction: An efficient, complete solution

2003-08-20 Thread Benjamin Goldberg
Dave Mitchell wrote: > > On Sun, Aug 17, 2003 at 05:48:14AM -0600, Luke Palmer wrote: > > Here comes that ever-reincarnating thread again, sorry. > > > > This is a proposal for an efficient solution to the timely destruction > > problem, which doesn't use refcounting, and fits in to the current

Re: String API

2003-08-20 Thread Benjamin Goldberg
Leopold Toetsch wrote: > > Benjamin Goldberg <[EMAIL PROTECTED]> wrote: > > Leopold Toetsch wrote: > >> > >> Benjamin Goldberg <[EMAIL PROTECTED]> wrote: > >> > There are a number of shortcomings in the API, which I'd like to >

Re: Timely Destruction: An efficient, complete solution

2003-08-20 Thread Benjamin Goldberg
Dave Mitchell wrote: > > On Wed, Aug 20, 2003 at 06:40:51PM -0400, Benjamin Goldberg wrote: > > Dave Mitchell wrote: > > > > > > On Sun, Aug 17, 2003 at 05:48:14AM -0600, Luke Palmer wrote: > > > > Here comes that ever-reincarnating thread again, sorry.

Re: Set vs. Assign..?

2003-08-14 Thread Benjamin Goldberg
Having read this thread, I think that the real problem is not just that there are multiple assignment semantics -- it's that the names "set" and "assign" are not really meaningful -- that is, they *look* to english speakers as if they are synonyms... their names alone aren't enough info to know wh

Re: String API

2003-08-21 Thread Benjamin Goldberg
Nicholas Clark wrote: > > On Wed, Aug 20, 2003 at 07:19:42PM -0400, Benjamin Goldberg wrote: > > > Leopold Toetsch wrote: > > > > But these could be converted to utf32 as soon as they are seen. > > > > For a long string, that could be quite a bit o

Re: String API

2003-08-21 Thread Benjamin Goldberg
Leopold Toetsch wrote: > > Benjamin Goldberg wrote: > > > > > Leopold Toetsch wrote: > > Not having an INTERP argument severely limits us, even in other ways. > > The INTERP argument is fine. The user defined encoding is/was my > problem. As in, you

Re: Should I target Parrot?

2003-08-21 Thread Benjamin Goldberg
Tom Locke wrote: > > OK, here's what I'm hoping Parrot can provide for the language I'm building. > > My big requirement is for lightweight microthreads (hopefully *very* > lightweight - I'm considering one scheduler that can handle *millions* > of threads on a single machine). Hmm, I can envi

  1   2   >