Re: Parrot is very (intentionally) broken

2002-02-10 Thread Jeff G
Jeff G wrote: > > Simon Cozens wrote: > > > > I've just committed some changes after which Parrot will not compile. > > This is quite deliberate. Basically, I'm trying to get the keyed stuff > > working the way we want, and that requires some painful

Re: Parrot is very (intentionally) broken

2002-02-08 Thread Jeff G
Simon Cozens wrote: > > I've just committed some changes after which Parrot will not compile. > This is quite deliberate. Basically, I'm trying to get the keyed stuff > working the way we want, and that requires some painful changes to the > source. The upshot is: > > All the vtable function

[COMMIT] Changing vtable.tbl format...

2002-02-04 Thread Jeff G
The new format looks much more C-like, as opposed to the old tab-delimited type. The format now looks roughly like this: init() # Assumes both 'void' type and 'unique' class. INTVAL get_integer (INTVAL value) # C-like prototyping mechanism void logical_or (PMC * value, PMC * dest) # 'unique' assu

[COMMIT] Changed aggregate PMCs to use the internal SELF->data cache

2002-02-01 Thread Jeff G
This is the first step of three major changes coming over the weekend. The only change visible to the assembler will be the syntax 'set P0[3],7' and 'set P5["foo"],P30[7]' for accessing array and hash aggregates. The changes should also allow us to implement multidimensional arrays. -- Jeff <[EMAI

[COMMIT] PerlArray fixes

2002-01-29 Thread Jeff G
PerlArray was previously unable to use negative indices to do anything but access integer values. This has now been fixed to let you use negative indices to access all basic types and alter basic types. The next step is threefold: 1 - Unify (get_integer_index, get_number_index, get_string_index)

[COMMIT] Array type

2002-01-28 Thread Jeff G
I've just added a new 'Array' type alongside the current PerlArray. Some target languages may not like to use Perl's array style, so they now can use the basic Array type. As the test (t/op/pmc_array.t) indicates, no preallocation is done. I probably need to support exceptions at some future date,

[COMMIT] IntQueue added...

2002-01-13 Thread Jeff G
This is strictly a teaching tool for an upcoming perl.com article. I've put it into CVS rather than have to explain to newbies what the code may have looked like at one time. -- Jeff <[EMAIL PROTECTED]>

Re: Problem with key.c?

2002-01-08 Thread Jeff G
Simon Glover wrote: > > In amongst all the unused parameter warnings, gcc throws up these two for > key.c: > > key.c: In function `key_element_value_s': > key.c:275: warning: passing arg 2 of `find_bucket' from incompatible >pointer type > > key.c: In function `key_set_element_value

[COMMIT] PerlHash buckets

2002-01-07 Thread Jeff G
The implementation is pretty straightforward, and doesn't yet match perl5's implementation. Inserting a key: 1) Hash the key to a number, and fold it to between 0 and NUM_BUCKETS. 2) Create a new bucket, and save both the value and key in it. 3) Tack the bucket onto the appropriate hash index.

[COMMIT] PerlHash class added.

2002-01-04 Thread Jeff G
Sample: new P0,PerlHash set P0,-6,"foo" # Store the value -6 in key 'foo' of the hash P0 set I0,P0,"foo" # Recover the value at "foo" No work has yet been done on hash collision, and behavior for undefined hash keys is not yet decided upon. -- Jeff <[EMAIL PROTECTED]>

Note on PMC.pod...

2002-01-02 Thread Jeff G
I have come down off the mountain, and bear a partially-written article for perl.com on how to roll your own PMCs and what this means. Should hit perl.com sometime within the next two months, with any luck. It needs the final bit written, and as I've just spent the better part of a week at almost

[COMMIT] PerlArray type

2001-12-17 Thread Jeff G
Note the three-parameter set() ops, specifically. A little lacking in documentation, but they do indeed work. new P0,PerlArray # Initializes a new PerlArray set P0,N0,I0 sets index I0 of array P0 to the number in register N0 get S0,P0,I0 sets S0 to the string in index I0 of P0 Does the current P

[COMMIT] miniperl has been somewhat busy...

2001-12-16 Thread Jeff G
I've restructured the output from the miniperl parser to make things a little less confusing than having HoLoHoLo... monstrosities floating around, and added a rather large and hopefully somewhat comprehensive test suite into Miniperl/t. The code generator now handles expressions fairly cleanly, u

[COMMIT] Optimizer

2001-12-13 Thread Jeff G
Doesn't do much beyond strength reduction and constant folding, but it's there. Also, if you look at the parsing routines I've created a fairly simple data structure to hold lines of a post-macro-processed assembler program. The output routine preserves comments and whitespace within reason. -- J

Re: Nmake is stupid.

2001-12-12 Thread Jeff G
Dan Sugalski wrote: > > At 05:40 PM 12/12/2001 -0800, Robert Spier wrote: > >| patches integrated in soon, and a longer-term solution (i.e. a perl make) > >| should be ready not too long after that. > > > >bool query { > > Dan, you've been unclear. Is a perl5 based make system > >where you wa

[COMMIT] Added a nascent make.pl implementation...

2001-12-12 Thread Jeff G
Caveats from the commit mail are roughly as follows: Nearly-complete 'make' replacement in perl. Non-compliant bits - Takes absolutely -NO- special flags... - Dies on undefined macros such as $(PDISASM) in current make - Dies on recursive macro expansions

[COMMIT] languages/miniperl

2001-12-12 Thread Jeff G
Now that PMCs are perl-like, it's about time to start language development. Currently it's sophisticated enough to be able to compile and run the following perl{56} code: my ($a,$b); $b="foo"; $a=-71.5; print $a; print $b; But that will change soon. There aren't any tests currently, awaiting a

[COMMIT] Key aggregate code committed.

2001-12-10 Thread Jeff G
Added files: key.c include/parrot/key.h t/op/key.t Altered files: MANIFEST Makefile.in include/parrot/parrot.h core.ops Implements generic aggregate support in the Sn registers. t/op/key.t has quick samples of its use. It does have fairly rigorous internal tests, but the memory all

Re: Key stuff for aggregates

2001-12-06 Thread Jeff G
Tests passed... ---cut here--- new_key S0 clone_key S1,S0 size_key S1,5 key_size I0,S1 print "I0 (3) " print I0 print "\n" toss_key S0 #ke_type I1,S1,1 ke_set_value S1,0,5 ke_value I0,S1,0 ke_type I1,S1,0 print "I0 (5) I1 (0): " print I0 print " " print I

Re: Key stuff for aggregates

2001-12-06 Thread Jeff G
Dan Sugalski wrote: > > At 12:52 AM 12/5/2001 -0500, Jeff G wrote: > >The fact that the S registers are in fact generic struct registers is > >not evident from outside the internal code. For those of us implementing > >instructions, it might be useful to explicitly cast

Re: Key stuff for aggregates

2001-12-04 Thread Jeff G
Dan Sugalski wrote: > > 'Kay, here's the preliminary assembly-level docs for keys, which is how > we're going to be accessing entries in aggregates. > > --Snip here--- > =head2 Key operations > > Keys are used to get access to individual elements of an aggregate > variab

[PATCH] Very small, very crude implementation of PerlArray

2001-12-02 Thread Jeff G
Because of the problems I've had sending diffs to the list, I'm just putting this onto my webserver at . This is a *VERY* crude implementation of a very limited array in Parrot. In addition to the PerlArray class, it also adds two new instructions to th

Re: Thoughts on vtables...

2001-12-02 Thread Jeff G
Simon Cozens wrote: > > On Sun, Dec 02, 2001 at 02:21:38AM -0500, Jeff G wrote: > > Currently vtable.h is dynamically constructed from what would appear > > to be a union of all possible operators on {int,num,string}. Now, this > > is certainly handy (especially after

Thoughts on vtables...

2001-12-01 Thread Jeff G
Now I'll be the first to admit that I'm probably not the most coherent in the world at (looks at the clock) 1:19 A.M. but I'm sitting here trying to get something like a PerlInt_Array ready for compilation and noticing some problems. It's also entirely possible that I'm looking at this in the wron

[COMMIT] Makefile changes

2001-12-01 Thread Jeff G
classes/ now has a real Makefile.in Configure.pl now dynamically builds classes/Makefile, and no longer passes in -I./include as an expanded parameter. Makefile.in has the classes/perl*.o targets removed, replaced with a 'cd classes; make' target. This is done in anticipation of being able to dec

RE: [PATCH] Don't count on snprintf

2001-12-01 Thread Jeff G
Applied Andy's patch just to keep the tree sane while the actual issue gets worked out. I'll probably pull out perl5's snprintf function and add it to the vtables. One other issue I can see in the vtable stuff is that there's no easy way to add a library of vtable operations (such as, in this case

[COMMIT] Final PMC additions

2001-11-29 Thread Jeff G
concat, set, {add,sub,mul,div} implemented. The following instructions will now work as in perl5... set P0,3 set P1,"foo" concat P0,P0,P1 # "3foo" set P0,3 add P0,P0,P1 # 3 set P0,-13.3 set P1,"13.3" add P0,P0,P1 # 0 (even though P1 is a string) The code for add/sub/mul/div has to be able to be

Re: Silly question...

2001-11-29 Thread Jeff G
Jeff G wrote: > > Shouldn't we be placing set_p_i and the like in vtable.ops? Of course, I meant vtable.tbl... Based on this confusion I'm now wondering if it wouldn't be better to let a human create the vtable.ops file and leave vtable.tbl as an auxiliary file that&#

Silly question...

2001-11-29 Thread Jeff G
Shouldn't we be placing set_p_i and the like in vtable.ops? -Jeff Radio Shack: You've got questions, we've got blank stares!

[COMMIT] Fixes to PMC integer, number, started PMC strings

2001-11-28 Thread Jeff G
Pretty much says it all.

[COMMIT] PMC numeric operations, patching PMC integer to support

2001-11-25 Thread Jeff G
Allows the following operations to work: new P0,0 new P1,0 set P0,3 set P1,-3.65 add P1,P0,P1 print P1 end I'll add appropriate string conversions some time this week. Numeric operations are finicky enough that it's probably not worth attempting to do down-conversion from numeric back t

Re: [COMMIT] Added basic integer PMC ops

2001-11-25 Thread Jeff G
Simon Cozens wrote: > > On Sun, Nov 25, 2001 at 12:57:19AM -0500, Jeff G wrote: > > Along with testing in t/op/pmc.t > > Wait! This is all bogus. Not only do we need overflow checking, but > we also need to deal with the contingency that in, say, > > add P1, P2,

[COMMIT] Added basic integer PMC ops

2001-11-24 Thread Jeff G
Along with testing in t/op/pmc.t -Jeff <[EMAIL PROTECTED]>

Re: [PMC] Patch to combine core.ops and vtable.ops > all.ops

2001-11-24 Thread Jeff G
"Gregor N. Purdy" wrote: > > Jeff --- > > > Rather wordy, I know, but it also points out how many places depend upon > > the name 'core' in the current code. > > > > I'm also posting a different version shortly that combines core.ops and > > vtable.ops into one core_ops.{c,h,pm}. > > Are the vt

[PMC] Patch to combine core.ops and vtable.ops into core_ops.{c,h,pm}

2001-11-22 Thread Jeff G
Slightly cleaner patch than the crude method of cat'ing the ops files into one .ops file. Also doesn't require patching all the places dependent upon 'core'. -Jeff <[EMAIL PROTECTED]> ---cut here--- diff -ru parrot_orig/Makefile.in parrot/Makefile.in --- parrot_orig/Makefile.in Thu Nov 22 16

[PMC] Patch to combine core.ops and vtable.ops > all.ops

2001-11-22 Thread Jeff G
Rather wordy, I know, but it also points out how many places depend upon the name 'core' in the current code. I'm also posting a different version shortly that combines core.ops and vtable.ops into one core_ops.{c,h,pm}. -Jeff <[EMAIL PROTECTED]> --- cut here --- diff -ru parrot_orig/Configure.

Re: [PMC] Test suite (Inline this time...)

2001-11-22 Thread Jeff G
All right, inserting the file *inline* this time... *grumble*grumble*Netscape*grumble*firewall*grumble* In any case, the file is now known to be below these comments. As noted previously, many of these tests should actually return something (an error string, or maybe an actual numeric value or s

[PMC] Test suite - Third time's the charm...

2001-11-21 Thread Jeff G
Previous comments apply here. I'm also making the necessary modifications to link in vtable_ops locally. -Jeff <[EMAIL PROTECTED]>

Re: [PMC] Test Suite

2001-11-21 Thread Jeff G
Jeff G wrote: Erps, forgot to attach file apparently. File now attached. > The attached file is a proposed PMC test suite. > > Now, of course, PMCs aren't implemented yet, but this will give us a > test suite to validate PMCs against behavior once it's been fully > spe

[PMC] Test Suite

2001-11-21 Thread Jeff G
The attached file is a proposed PMC test suite. Now, of course, PMCs aren't implemented yet, but this will give us a test suite to validate PMCs against behavior once it's been fully specified. The enclosed file tests set/get of PMC variables and the basic operations in almost all combinations. F

[PATCH] Makefile cleans out .pasm, .pbc, .out files from t/op directory

2001-11-20 Thread Jeff G
Presence of old .pasm &c files can cause tests to fail because they blindly attempt to write to string17.pasm or whatever. -Jeff <[EMAIL PROTECTED]>

[PATCHES] Quoting fixes

2001-11-18 Thread Jeff G
(This might be a duplicate, if so, my apologies) Allows the following quoting styles: print 'foo' print "foo \"bar\" baz" -Jeff <[EMAIL PROTECTED]>