IMCC build fails again

2003-07-09 Thread Michal Wallace
Hey all, I've been following parrot for a while and finally decided to try it out. Anyway, I ran into a snag. Hopefully this is the right place to report this. Basically, IMCC fails to build on a fresh CVS checkout because of the dates on the imcparser.c and imcparser.h files. Looks like this

Re: Events

2003-07-20 Thread Michal Wallace
On Sun, 20 Jul 2003, Dan Sugalski wrote: > >It would be entirely possible for Parrot (or a Parrot library) to > >use AIO at a low level, without introducing interrupts to the VM layer. > Sure. But what'd be the point? Adding in interrupts allows a number > of high-performance idioms that aren't

approaching python

2003-07-23 Thread Michal Wallace
Hey all, I've been thinking about the "compiling python to parrot" concept. Right now it looks like the approach is to start from scratch, but I'm wondering if it might make more sense to leverage python itself, at least for now? Python has a compiler module (written in python and standard wi

Re: approaching python

2003-07-24 Thread Michal Wallace
On 24 Jul 2003, Luke Palmer wrote: > Klass-Jan Stol writes: > > module, right? I don't know Python, and I've a little experience > > with IMC, but it seems to me only a new code generator module should ...[snip] > Well... sortof. It's definitely going to take writing a whole new > code generato

Re: approaching python

2003-07-24 Thread Michal Wallace
On Thu, 24 Jul 2003, Joseph F. Ryan wrote: > I'm not familiar with the Python bytecode spec (to be a little more > accurate, I'm completely clueless about it), but perhaps something > similar can be done? Also, another thing to consider is that it > might be easier to translate python bytecode d

Re: approaching python

2003-07-28 Thread Michal Wallace
On 28 Jul 2003, Luke Palmer wrote: > Klass-jan wrote: > > Maybe it's not possible to have the eval instruction right away, in the new > > Python->IMC code generator. As long as this command is not used in the code > > for this new code generator, this can just be skipped, and it may be > > impleme

pirate ("py...rrot")

2003-07-30 Thread Michal Wallace
Hey all, Well, I had my first crack at updating amk's parrot-gen.py for use with imcc. I'm kind of approaching it slowly, and going test-first: I started a new file and am only pulling in code a bit at a time to pass the next test. So far all it does is "print" and a single if/else block bas

Re: approaching python

2003-07-30 Thread Michal Wallace
On Sun, 27 Jul 2003, Joseph Ryan wrote: > Benjamin Goldberg wrote: > > >[...] the problem isn't that python uses *more* registers than > >, but rather, that it doesn't use registers at all. Instead, > >it uses a stack. So, for example, python's add instruction might get > >translated into the f

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

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

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

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

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

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 droppe

double checking: in vs on?

2003-08-03 Thread Michal Wallace
Hey all, Python objects can have things "in" them: foo["x"] = "in" ... and it can also have things "on" them: foo.x = "on" I noticed lua treats these as the same thing and got curious about the distinction in IMCC. Coding it this way seems to work, but I'm not sure I really understood t

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 t

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

2003-08-05 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 > > python/perl

repeat() not implemented in PerlInt

2003-08-06 Thread Michal Wallace
After running cvs up -d and then "make", a bunch of my tests broke. Here's the problem boiled down to the simplest case I can find: [~/pirate]: cat bug.imc .sub __main__ $P2 = new PerlInt $P2 = 1 $P3 = new PerlInt $P3 = 1 if $P2 == $P3 goto cmp1 c

Re: why new_pad *INT*?

2003-08-09 Thread Michal Wallace
On Sat, 9 Aug 2003, Sean O'Rourke wrote: > Remember, the pad depth reflects lexical scope nesting, > not dynamic scoping. So if you mean "current_depth" as > "current compile-time depth" above, then you're right, > but the VM would have no way to tell. If you mean > run-time depth, which the com

Re: calling conventions, variable-length parameter lists

2003-08-10 Thread Michal Wallace
On Fri, 8 Aug 2003, TOGoS wrote: > I want to be able to have a function with > this kind of signature: > > func ($param1, *$otherparams) > > AFAIK, there is no way to implement this > with the current calling conventions. You > would have to do something with variable > register IDs, which we do

Re: why new_pad *INT*?

2003-08-10 Thread Michal Wallace
On Sat, 9 Aug 2003, Sean O'Rourke wrote: > The problem is that when adder() gets returned, it > needs to remember the enclosing pad. So this needs to > be > > newsub $P1, .Closure, _sub1 > > which (IIRC) will save the lexical environment in which > it was created (see closure.pmc), then res

Re: parrot bug: continuations/multiple return

2003-08-10 Thread Michal Wallace
On Sat, 9 Aug 2003, Leopold Toetsch wrote: > Nice coincidence. S. Togos' bug report too. > Anyway, its already fixed. Gosh you're quick. Thanks! Want another one? :) def g(): return 0 def f(): return g() print f() This prints: 'No more I register frame

pirate guide

2003-08-10 Thread Michal Wallace
Just got the parrot calling conventions working for Py-Pirate. I also wrote a guide that explains how the code is laid out for people who don't know python: http://pirate.versionhost.com/viewcvs.cgi/pirate/GUIDE?rev=1.1 Sincerely, Michal J Wallace Sabren Enterprises, Inc. ---

okay to use iterator?

2003-08-11 Thread Michal Wallace
perlhash.pod says: """ TODO: Steve Fink sayd: And if there were a keys() method, then 'defined' and 'exists' are very different. (And there ought to be, and would be if we weren't all ignoring Leo's iterator proposal.) I need to read that proposal :-) """ Looks like the proposal got acce

parrot bug: continuations/multiple return

2003-08-11 Thread Michal Wallace
Hey all, Sorry for the huge code listing here, but I don't have a simpler case. This is what pirate outputs when it compiles the following program: def f(x): if x: return 1 else: return 0 print f(1), f(0) As far as I can tell,

RE: pirate status / need help with instances

2003-08-12 Thread Michal Wallace
On Mon, 11 Aug 2003, Brent Dax wrote: > Sean O'Rourke: > # >* make parrotclass handle "invoke" > # > this strikes me as the most efficient, > # > but I'm not really confident with C > # > so I'm hesitant to try it > # > # This seems to me like the way to go, except you might >

bug: clear_eh patricide after catch

2003-08-14 Thread Michal Wallace
Here's a new test case for t/pmc/sub.t output_is(<<'CODE', <<'OUTPUT', "set_eh - throw - clear_eh"); print "start\n" newsub P20, .Exception_Handler, _handler set_eh P20 new P30, .Exception throw P30 print "not reached\n" end _handler: clear_eh print "

RE: help raise hell

2003-08-14 Thread Michal Wallace
On Mon, 11 Aug 2003, Joseph F. Ryan wrote: > How are you currently throwing/catching exceptions? I think it > might be much more difficult to create a model that "traps" > exceptions, rather than setting up code that just "figures out" how > to handle an exception when it occurs. Both JVM->PIR a

Re: parrot bug: continuations/multiple return

2003-08-14 Thread Michal Wallace
On Sat, 9 Aug 2003, Benjamin Goldberg wrote: > Michal Wallace wrote: > [snip] > > def f(): > > return g() > [snip] > > # f from line 3 > > .pcc_sub _sub1 non_prototyped > > .local object res1# (vi

pirate status / need help with instances

2003-08-14 Thread Michal Wallace
Just wrapping up an all-night coding spree... Py-pirate can now handle: - functions (closures, recursion, etc) - global variables - tuples (but they turn into lists) - dictionaries (create, setitem, getitem, print) - list comprehensions - raise (strings only) - try...except (

Re: why ~ for xor?

2003-08-14 Thread Michal Wallace
On Mon, 11 Aug 2003, Thomas Vesper wrote: > Michal Wallace wrote: > > Out of curiosity, why does ~ map to both > > unary bitwise-not and binary bitwise-xor > > in imcc? > > > > I was expecting xor to be ^ and ^^ > > See Apocalypse 3 for this. > ^ was re

why ~ for xor?

2003-08-14 Thread Michal Wallace
Out of curiosity, why does ~ map to both unary bitwise-not and binary bitwise-xor in imcc? I was expecting xor to be ^ and ^^ Sincerely, Michal J Wallace Sabren Enterprises, Inc. - contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ my site: http:

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 installi

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

2003-08-14 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 g

Re: parrot bug: continuations/multiple return

2003-08-14 Thread Michal Wallace
On Sat, 9 Aug 2003, Leopold Toetsch wrote: > As calling conventions clearly state, that the caller has to save > everything, its probably up to imcc/pcc.c to insert above statements, if > another sub gets called from a sub. I'll fix that in a minute ;-) I just synced up with cvs and now everyth

Re: This Week's Perl 6 Summary

2003-08-14 Thread Michal Wallace
On Tue, 5 Aug 2003, Piers Cawley wrote: > Approaching Python > Discussions (and coding) of the Parrot implementation of Python > continued this week. Michal Wallace is working on taking a preexisting > (but incomplete, it's a proof of concept only) python parse tr

Re: bug: clear_eh patricide after catch

2003-08-14 Thread Michal Wallace
On Mon, 11 Aug 2003, Leopold Toetsch wrote: > No, the exception object isn't around anymore in the handler, so you > don't C there. > > This could of course be just my wrong implementation. No, it makes sense. You wouldn't want an exception in the catch: block to trigger an infinite loop. But i

serializing functions?

2003-08-14 Thread Michal Wallace
This is just a question I've been wondering about, that I think could be a huge PR sell for parrot in the python world if the answer is "yes". Could you serialize a parrot function? In other words, if you interactively define a function at the prompt, could you save it to disk? (not the source

Re: pirate status / need help with instances

2003-08-14 Thread Michal Wallace
On Tue, 12 Aug 2003, Leopold Toetsch wrote: > > ... So I'm trying to decide between two > > approaches: > > 3) wait until classes and objects are done ;-) 4) simulate an object system with closures :) I wound up getting a couple C books today. I'm trying to see what I can do about wrapping PyO

Re: IMCC hangs

2003-08-14 Thread Michal Wallace
On Sun, 10 Aug 2003, Vladimir Lipskiy wrote: > > Seems to be related with the multiple freeing reported by Michael. > > I thought his name was Michal (:>8 yes, I was born without an e. :) Sincerely, Michal J Wallace Sabren Enterprises, Inc. - contact: [EMAI

why new_pad *INT*?

2003-08-14 Thread Michal Wallace
Hey all, I'm just starting to get into using pads, and I'm not sure I understand new_pad. Specifically, why does it take an int? It seems to me, that 9 times out of 10, you're going to want to create a new pad at the next lower depth than the one before. So, two questions: 1. Should there b

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

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

Re: calling conventions, variable-length parameter lists

2003-08-14 Thread Michal Wallace
On Fri, 8 Aug 2003, TOGoS wrote: > Unprototyped :-) I guess I didn't make that quite > clear, enough. Nah, you did. I just didn't think about it... :) I think I see the problem now. > maybe this kind of unprototyped function is expected > to be uncommon enough that we can put up with having

Re: pirate status / need help with instances

2003-08-14 Thread Michal Wallace
On Tue, 12 Aug 2003, Michal Wallace wrote: > I wound up getting a couple C books today. I'm > trying to see what I can do about wrapping > PyObject as a PMC... What's the secret to making parrot recognize a new PMC? I've got my .pmc file but I'm not sure what to do n

help raise hell

2003-08-14 Thread Michal Wallace
Here is how I usually trigger a generic exception in python: >>> raise hell Traceback (most recent call last): File "", line 1, in ? NameError: name 'hell' is not defined Unfortunately, I can't seem to trap that in parrot, because a find_lex failure isn't an exception. Or am I

Re: parrot bug: continuations/multiple return

2003-08-14 Thread Michal Wallace
On Sun, 10 Aug 2003, Leopold Toetsch wrote: > Piers Cawley <[EMAIL PROTECTED]> wrote: > > Leopold Toetsch <[EMAIL PROTECTED]> writes: > >> As calling conventions clearly state, that the caller has to save > >> everything, its probably up to imcc/pcc.c to insert above > >> statements, if another su

bug: two segfaults

2003-08-14 Thread Michal Wallace
The following code segfaults immediately. If you uncomment the second line (print "") it works. However, if you then uncomment the #non_prototyped keyword in _depth1, it segfaults immediately again. When I say it segfaults immediately, I mean that the initial 0 is not printed. (Should I be rep

thanks and pow / div ops

2003-08-15 Thread Michal Wallace
"raise hell" is working great with the new find_lex exceptions. Thanks! :) Any plans to to add pow for PMC's? What about separate ops for floor/true division? http://www.python.org/doc/2.2.1/whatsnew/node7.html Sincerely, Michal J Wallace Sabren Enterprises, Inc.

Re: A certain 4 letter word (was Re: Parrot and STDOUT/STDERR)

2003-08-15 Thread Michal Wallace
On Fri, 15 Aug 2003, Leopold Toetsch wrote: > When we have more classes like a Python hierarchy, we will see, how and > how far the functionality does match. If we find some, we can put in an > intermediate ParrotScalar. I was thinking about this earlier today. Once dynamic PMCs are working, Perl

Re: thanks and pow / div ops

2003-08-16 Thread Michal Wallace
On Fri, 15 Aug 2003, Leopold Toetsch wrote: > PS: have a look at the rather new C opcode in PIR ;-) Cool! :) Sincerely, Michal J Wallace Sabren Enterprises, Inc. - contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ my site: http://www.withoutane.

there's no undef!

2003-08-16 Thread Michal Wallace
Uh-oh. I just went to implement "del x" and there's no op to remove a variable from a lexical pad! :) Sincerely, Michal J Wallace Sabren Enterprises, Inc. - contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ my site: http://www.withoutane.com/ ---

save/restore on yield?

2003-08-16 Thread Michal Wallace
Just tried out Kenneth Grave's yield stuff -- it works great! But shouldn't .pcc_begin_yield and .pcc_end_yield do "saveall" and "restoreall", respectively? Is there a case where we wouldn't want this? Sincerely, Michal J Wallace Sabren Enterprises, Inc.

Re: save/restore on yield?

2003-08-16 Thread Michal Wallace
I said: > But shouldn't .pcc_begin_yield and .pcc_end_yield > do "saveall" and "restoreall", respectively? > > Is there a case where we wouldn't want this? Yes, because for python anyway, I also need to put pop_pad in there: saveall pop_pad .pcc_begin_yield .return whatever .pcc_en

try/catch bug with coroutines

2003-08-16 Thread Michal Wallace
It seems that exception handlers get tied to subroutines when they're created, not when they're actually used. For example: ## this works: try: f = make_function() f.die() # raise some error except: pass ## this does not work: f = make_function()

Re: there's no undef!

2003-08-16 Thread Michal Wallace
On Sat, 16 Aug 2003, Leopold Toetsch wrote: > I have put in scratchpad_delete > > peek_pad P0 > delete P0["foo"] > > deletes names only. Thanks! works great! Sincerely, Michal J Wallace Sabren Enterprises, Inc. - contact: [EMAIL PROTECTED] hosting:

getprop and find_lex?

2003-08-16 Thread Michal Wallace
I expected getprop to behave like find_lex and throw an exception if the property doesn't exist, but it doesn't: .sub _main .local object Class .local object setv .local object getv Class = new ParrotClass setv = new PerlString setv = "value\n" setprop Class, "name", setv #

Re: getprop and find_lex?

2003-08-16 Thread Michal Wallace
On Sat, 16 Aug 2003, Sean O'Rourke wrote: > Michal Wallace <[EMAIL PROTECTED]> writes: > > I expected getprop to behave like find_lex > > and throw an exception if the property doesn't > > exist, but it doesn't: > > Are you sure that propert

pirate 0.01 ALPHA!

2003-08-16 Thread Michal Wallace
Tadaa! Okay. I've done (almost) everything I can do for python without jumping into C. So here's a release! http://pirate.tangentcode.com/ Check out the generator-based microthreads demo. :) It's horribly slow, but it works! And note the PARROT_INLINE function - a nice little touch, I thou

Re: pirate 0.01 ALPHA!

2003-08-16 Thread Michal Wallace
On Sat, 16 Aug 2003, Sean O'Rourke wrote: > Michal Wallace <[EMAIL PROTECTED]> writes: > > > Tadaa! > > /me blinks at the list comprehensions. :) > Cool stuff. test_microthreads failed for > some reason I still need to look into, but > there's a

bug with parrot -O2

2003-08-17 Thread Michal Wallace
I haven't looked into this at ALL, but I was curious about the IMCC optimization flags: [~/pirate]: ./pirate.py -d weightless.py > weightless.imc [~/pirate]: parrot weightless.imc ended with: L 450 total time: 23 [~/pirate]: parrot -O=1 weightless.imc ended with: L 450 total time: 22 [~/

Re: there's no undef!

2003-08-17 Thread Michal Wallace
On Sun, 17 Aug 2003, Benjamin Goldberg wrote: > Michal Wallace wrote: > > > Uh-oh. I just went to implement "del x" > > and there's no op to remove a variable > > from a lexical pad! :) > > Why would you want to remove a variable from a lexical pad?

Re: set vs. assign, continued: 'add' vs. 'add!'

2003-08-17 Thread Michal Wallace
On Sun, 17 Aug 2003, Luke Palmer wrote: > Benjamin Goldberg writes: > > Hmm... I just thought of something. Since 'set' semantics can be easily > > simulated when we have only ops for 'assign' semantics, maybe imcc > > itself could do this for us. > > > > That is, by default, > >$P0 = $P1 +

Re: there's no undef!

2003-08-17 Thread Michal Wallace
On Mon, 18 Aug 2003, Benjamin Goldberg wrote: > > Hmm. Do you mean > > > > if for stmt in block: > > if stmt.type == undef: > > flag_as_going_to_delet(stmt.varname) > > > > So I can create a new pad when it's assigned? > > Right. You'd create a new pad just before the "for", and

Re: Should I target Parrot?

2003-08-21 Thread Michal Wallace
On Wed, 20 Aug 2003, Tom Locke wrote: > I am currently embarking on a project to create a new language. Right now > I'm in the process of selecting the platform that's going to give me the > best starting point. > > My first choice is whether to go for a VM, or a C-Python style > implementation.

Re: Should I target Parrot?

2003-08-22 Thread Michal Wallace
On Thu, 21 Aug 2003, Tom Locke wrote: (not sure who you're quoting here... dan I think) > > > But Parrot has continuations. Doesn't this gives me (cooperative) > > > microthreads? (with a little work on my part). > > > > Sure... > > So these would be real cheap right? Time and space overheads si

Re: Should I target Parrot?

2003-08-22 Thread Michal Wallace
On Thu, 21 Aug 2003, Benjamin Goldberg wrote: > I hope you aren't planning on serializing just a single isolated > microthread... that wouldn't work well with what I've got in mind due to > how much stuff comes along when you serialize a continuation -- you'd > get almost the whole interpreter ser

Re: Should I target Parrot?

2003-08-24 Thread Michal Wallace
On Fri, 22 Aug 2003, Benjamin Goldberg wrote: > Michal Wallace wrote: > > > > On Thu, 21 Aug 2003, Benjamin Goldberg wrote: > > > > > If you want, instead, to serialize interpreter->microthreads, > > > however... well, you'd *still* get almost the

Re: Method call parameters

2003-08-24 Thread Michal Wallace
On Sun, 24 Aug 2003, Benjamin Goldberg wrote: > Togos wrote: > > > > What's the reasoning behind putting the object a > > method is being called on in P2 instead of in the > > first parameter of the method? I have a feeling that > > putting it as the first parameter of the method would > > make t

Re: [CVS ci] PackFile-15: print warning location

2003-08-24 Thread Michal Wallace
On Sun, 24 Aug 2003, Leopold Toetsch wrote: > We have two kinds of file/line information: Parrot source and HLL > source. So the C<.currentline> macro needs duplication or an argument > specifying, which source it should denote. And when parrot throws an error and complains about line 5, which o

Re: Of AST and YAL

2003-09-07 Thread Michal Wallace
On Sun, 7 Sep 2003, Leopold Toetsch wrote: > I'm currently investigating the AST (abstract syntax tree) interface > for Parrot. For getting a feeling, how this could look like, I've > implemented (some parts) of Yet Another Language (YAL). I like it. What is this written in? C or Perl or what? If

Re: attaching debuggers

2003-09-19 Thread Michal Wallace
On Fri, 19 Sep 2003, Nicholas Clark wrote: [talking about dynamically intering the debugger] > > Can anyone see a sane way to do it? > > Better still, can anyone see a viable way to do it on perl5? Python does this. There's basically a hook after every statement, and you can put whatever you wan

setline?

2003-09-25 Thread Michal Wallace
Sorry, I've been following this list with one eye tied behind my back... What happened to setline? Should I emit something else instead? Sincerely, Michal J Wallace Sabren Enterprises, Inc. - contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ m

Re: Languages status (attention compiler maintainers)

2003-10-08 Thread Michal Wallace
On Mon, 6 Oct 2003, Melvin Smith wrote: > In an attempt to get a handle on what the status is of all the > language compilers we have (in various states) I added > a file called LANGUAGES.STATUS under parrot/languages > > Just read the file and it explains itself. Please, if you are > the author

Re: More object stuff

2003-12-03 Thread Michal Wallace
On Wed, 3 Dec 2003, Leopold Toetsch wrote: > Dan Sugalski <[EMAIL PROTECTED]> wrote: > > At 12:17 PM +0100 12/3/03, Leopold Toetsch wrote: > > >>Create an Exception class hierarchy? > > > I'm not 100% sure I want to go with a real OO style of exceptions, > > but that might just be the neo-luddit

feature request: line numbers in errors?

2003-12-03 Thread Michal Wallace
Is it possible to print out the line number of the bad instruction when parrot encounters an error and fails? I'm trying to get my generated code to work with the latest version of pirate and I'm having to rely on "GOT THIS FAR" print statements to find the lines that are giving me errors. I

python exceptions broken

2003-12-03 Thread Michal Wallace
Looking more at exceptions here... I used to be able to put arbitrary stuff in the _message slot of a ParrotException... Now we can only use strings. Is that permanent? PythonException will need to be able to hold an arbitrary python object. I'm faking it by stuffing my PMC into a string regis

how do I instantiate? -- was: Objects!

2004-01-07 Thread Michal Wallace
On Tue, 2 Dec 2003, Dan Sugalski wrote: > *) Creating new objects involves calling the ->init vtable entry *on > the class*. Because of this each class gets a custom vtable where the > init method has been swapped out for one (from objects.c) that > creates a new object instead. Well, cool! How d

Re: how do I instantiate? -- was: Objects!

2004-01-07 Thread Michal Wallace
On Wed, 7 Jan 2004, Luke Palmer wrote: > Should go something like this: > > .sub _main > .local object Cat > .local object felix > newclass Cat, "Cat" > find_type $I0, "Cat" > felix = new $I0 > # ... > .end Thanks, but that doesn't work eit

RESOLVED: how do I instantiate?

2004-01-08 Thread Michal Wallace
On Wed, 7 Jan 2004, Luke Palmer wrote: > Er, sorry, that's IMCC's fault. This works: > > new felix, $I0 Yep! Thanks! Here's a short example of the final script: .sub _main .local object Cat .local object felix newclass Cat, "Cat" find_type $I0, "Cat" new felix, $I0 $P0 =

Re: how do I instantiate? -- was: Objects!

2004-01-08 Thread Michal Wallace
On Thu, 8 Jan 2004, Leopold Toetsch wrote: > Michal Wallace <[EMAIL PROTECTED]> wrote: > > > I'm not even trying to get objects working yet. I just > > need something that'll let me run setprop on it > > You can attach properties to all PMCs. And WRT obj

Re: how do I instantiate? -- was: Objects!

2004-01-08 Thread Michal Wallace
On Thu, 8 Jan 2004, Leopold Toetsch wrote: > Michal Wallace <[EMAIL PROTECTED]> wrote: > > > What exactly is the difference between an > > attribute and a property? > > $ perldoc docs/pdds/pdd15_objects.pod > /TRANSLATION AND GLOSSARY Thanks. Don't mind me.

re: [PATCH] Continuations now close over register stacks

2004-01-08 Thread Michal Wallace
Luke Palmer wrote: > This patch re-implements the register backing stacks as PObjs (so > they can be garbage-collected), honors their COW flags, and adds > them to the interpreter context (where they should be, honest!). > > As a healthy side-effect, it encapsulates their behavior nicely into >

weird bug w/new imcc syntax

2004-01-08 Thread Michal Wallace
I love the new syntax for calling functions! Thanks Melvin!!! And... here's a weird bug. :) The following code fails with the message "No Entries on UserStack!" But, if you delete either/both of the empty comment lines and it works fine. :) .sub _main $P0 = new PerlString $P0 = "hello

BUG: coroutine + exception = stack_height segfault

2004-01-08 Thread Michal Wallace
#!/bin/env parrot # # yieldbug.imc # # This program should print dots forever. # Instead it prints a few dots and then segfaults. # # parrot -t shows this bug: # #parrot: src/stacks.c:95: stack_height: #Assertion `height == (top->n_chunks - 1) * 256 + top->used' failed. #Aborted # # It

Re: [PATCH] Continuations now close over register stacks

2004-01-08 Thread Michal Wallace
On Thu, 8 Jan 2004, Luke Palmer wrote: > @pcc_sub_call_4: > set P0, P17 > set P1, P16 > set I0, 0 > set I1, 0 > set I2, 0 > set I3, -2 > updatecc > savetop > invoke > done: > restoretop > set P16, P5 > > When t

yield op?

2004-01-09 Thread Michal Wallace
Hey all, When you invoke a Coroutine, it calls swap_context() from src/sub.c ... There's an else clause in there that either swaps or restores theinterpreter stack, but as far as I can tell, swap_context() is ONLY called when entering a coroutine - not when we're suspending it. That means all so

Re: BUG: coroutine + exception = stack_height segfault

2004-01-09 Thread Michal Wallace
On Fri, 9 Jan 2004, Jeff Clites wrote: > On Jan 9, 2004, at 12:24 AM, Leopold Toetsch wrote: > > > Michal Wallace <[EMAIL PROTECTED]> wrote: > >> #!/bin/env parrot > >> # > >> # yieldbug.imc > >> # > >> # This program should p

Re: [PATCH] Continuations now close over register stacks

2004-01-09 Thread Michal Wallace
On Fri, 9 Jan 2004, Leopold Toetsch wrote: > Michal Wallace <[EMAIL PROTECTED]> wrote: > > > newsub $P1, .Continuation, done > > For returning just use a .RetContinuation. Or still better, just omit > $P1 totally here: > > > .pcc_call $P0, $P1 Aha

Re: [PATCH] Continuations now close over register stacks

2004-01-09 Thread Michal Wallace
On Fri, 9 Jan 2004, Luke Palmer wrote: > Very rarely would you not savetop before creating a *real* continuation. > But again, very rarely would you actually create a *real* continuation > (depending on your language). RetContinuations are almost always a > better choice for traditional languages

Re: yield op?

2004-01-09 Thread Michal Wallace
On Fri, 9 Jan 2004, Leopold Toetsch wrote: > Michal Wallace <[EMAIL PROTECTED]> wrote: > > > Hey all, > > > When you invoke a Coroutine, it calls swap_context() > > Can you have a look at imcc/t/syn/pcc.t, there is an coroutine > iterator test. Yep, it h

Re: yield op?

2004-01-11 Thread Michal Wallace
On Sun, 11 Jan 2004, Leopold Toetsch wrote: > Michal Wallace <[EMAIL PROTECTED]> wrote: > > When you invoke a Coroutine, it calls swap_context() > > from src/sub.c ... There's an else clause in there > > that either swaps or restores theinterpreter sta

Re: [PATCH] new_noinit and init ops

2004-01-12 Thread Michal Wallace
On Mon, 12 Jan 2004, Luke Palmer wrote: > I have somewhat a predicament. I want to create a continuation, and > have that continuation stored in the register stack that it closes > over (this is how I'm implementing a loop with continuations). > Unless I'm having a major braino, I don't think thi

Re: [PATCH] new_noinit and init ops

2004-01-12 Thread Michal Wallace
On Mon, 12 Jan 2004, Luke Palmer wrote: > Michal Wallace writes: > > On Mon, 12 Jan 2004, Luke Palmer wrote: > > > > > I have somewhat a predicament. I want to create a continuation, and > > > have that continuation stored in the register stack that it c

Mr Parrot's Neighborhood

2004-01-12 Thread Michal Wallace
On Mon, 12 Jan 2004, Luke Palmer wrote: > > Well... A Coroutine is a pausable, resumable continuation, right? > > Or basically a closure with a continuation inside it. > > Both of those sentences seem wildly redundant to me. I think we might > be stuck on vocabulary. We're surely both understand

Re: Events and JIT

2004-01-16 Thread Michal Wallace
On Fri, 16 Jan 2004, Dan Sugalski wrote: > 2) Those that explicitly check for events ... > Ops like spin_in_event_loop (or whatever we call it) or checkevent is > in category two. They check events because, well, that's what they're > supposed to do. Compilers should emit these with some frequen

Re: Events and JIT

2004-01-16 Thread Michal Wallace
On Fri, 16 Jan 2004, Dan Sugalski wrote: > >I don't understand that part. Why the compiler? > > Because we don't have the sort of control of the async environment > that hardware does to deal with interrupts. > > And, realistically, all code has to deal with the possibility of > interrupts. Even

how to subclass dynamic PMCs?

2004-01-21 Thread Michal Wallace
Hi all, I'm hoping this is just a simple linker option, but I've been reading "ld" manuals for the past few hours and I just don't get it. :) I'm trying to make a dynamically loaded PMC that subclasses another dynamically loaded PMC. I made two files in parrot/dynclasses/ : // file 1: pisequen

Re: how to subclass dynamic PMCs?

2004-01-22 Thread Michal Wallace
On Thu, 22 Jan 2004, Leopold Toetsch wrote: > Michal Wallace <[EMAIL PROTECTED]> wrote: > > > I'm trying to make a dynamically loaded PMC that > > subclasses another dynamically loaded PMC. > > Its a linker problem, but not too simple. Your analysis is c

  1   2   >