Re: perlscalar morph code

2005-04-13 Thread Leopold Toetsch
Nicholas Clark [EMAIL PROTECTED] wrote:
 I'm trying to understand how morph works. perlscalar's morph looks like this:

[ broken code ]

 I think that there are 2 bugs here

At least, yes. The better and general morph code is pmc.c:pmc_reuse().

 2: The code isn't thread safe, even though it thinks that it is:

 I see no write barrier. There's no reason why on a dual CPU machine the
 parallel reader doesn't see the writes to memory in the order:

Yep.

 Nicholas Clark

leo


Re: I wish to understand the JIT machine code generator

2005-04-13 Thread Leopold Toetsch
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I have been trying to examine the i386 code generator to see how
 feasible it would be to create an AMD64 code generator.
 Unfortunately, the code is uncommented, and I haven't yet found any
 documentation to explain how it works on Parrot.  So far I've
 determined there's relevant stuff in jit/i386.  I don't understand the
 .jit extension on core.jit.  Is that not actually heavily templated C
 code?

jit/*/jit_emit.h defines basically a bunch of macros that emit opcodes.
There are additionally some interface functions like
Parrot_jit_begin(), Parrot_jit_normal_op and the register move functions
called from src/jit.c to copy registers from Parrot to CPU and back.

i386 has additional code to emit NCI stubs and direct vtable calls,
which all is optional. docs/jit.pod has some more details on the
interface functions.

The format of jit/*/core.jit is also covered by doc/jit.pod. It defines
JITted opcode functions which, when called by the code generator in
src/jit.c, emit code for the function. It makes use of templates to
generate the final code in src/jit_cpu.c and src/exec_cpu.c.

Please have a look at these generated files and the docs. If there are
some more questions, please just ask.

leo


Re: [perl #34935] [PATCH] r7818: removing more warnings in src/

2005-04-13 Thread Leopold Toetsch
Jerry Gay [EMAIL PROTECTED] wrote:
 this patch against r7818 should eliminate many more warning messages in
 src/*.c

Thanks, applied as well as #34936

[ except the line reading (size_t) 1.5, which defeats the purpose of
increasing allocation ]

leo


Re: [perl #34933] [PATCH] Handle trailing space in $(LD_OUT)

2005-04-13 Thread Leopold Toetsch
Andy Dougherty [EMAIL PROTECTED] wrote:

 Removing ICU from the build uncovered an odd build bug concerning the
 space after ${ld_out} in config/init/data.pl.  This patch fixes it.

Thanks, applied.
leo


Re: [perl #34910] [PATCH] t/pmc/nci.t failure with MinGW32

2005-04-13 Thread Leopold Toetsch
François PERRAD [EMAIL PROTECTED] wrote:

 Just use gcc with good parameters for build DLL.

Thanks, applied.
leo


Re: perlscalar morph code

2005-04-13 Thread Nick Glencross
Leopold Toetsch wrote:
Nicholas Clark [EMAIL PROTECTED] wrote:
 

I'm trying to understand how morph works. perlscalar's morph looks like this:
   

[ broken code ]
On a semi-related note, there's some broken morph code in scalar. It has 
code like:

   void increment () {
   PMC_int_val(SELF) = DYNSELF.get_integer() + 1;
   }
which is then used by subclasses String, Integer and Float.
In the case of String, the get_integer succeeds, increments it and 
correctly puts it back, hanging off as an integer. However, the PMC's 
not been morphed to an Integer, so the print in the next snippet core 
dumps (as the integer is a union with the string address):

.sub test
   new $P0, .String
   $P0 = 12
   inc $P0
   print $P0
   print_newline
.end
Does this overlap what's being looked at, or shall I provide a patch?
Nick


[perl #34949] [BUG] cmp_p_i_ic

2005-04-13 Thread via RT
# New Ticket Created by  Leopold Toetsch 
# Please include the string:  [perl #34949]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34949 


The following snippet ...

$ cat b.imc
.sub main @MAIN
 .local pmc b
 b = new BigInt
 b = 1e10
 if b  4 goto ok
 print never\n
 end
ok:
 print ok\n
.end

... shows that the implementation of some compare opcodes is wrong:

$ ./parrot b.imc
bigint_get_long: number too big
 in file 'b.imc' near line 4

The Cgt opcode calls VTABLE_get_integer on the PMC which isn't correct 
in that case.

We need either a MMD_CMP_INT functions defined in vtable.tbl or less 
efficiently promote the integer constant to an Integer PMC.

leo



Re: Welcome to the land of Subversion

2005-04-13 Thread Robert Spier
At Wed, 13 Apr 2005 02:07:05 -0400,
Roger Hale wrote:
 
 Robert Spier wrote:
 Could that be added as 4th line?
  Good ideas, all of them.  I've updated the page to add that, and to
  switch to bz2.
  -R
 
 Following Nicholas Clark:
bzcat svk-mirror-dump.bz2 | svnadmin load --ignore-uuid ~/.svk/parrot
 presumably should be
bzcat svk-bootstrap-dump.bz2 | svnadmin load --ignore-uuid ~/.svk/parrot
 (Although parrotcode.org is denying all knowledge of the file presently...)

Thanks Roger...  I really shouldn't update the website while watching
TV.  Distraction and all.

Fixed and fixed.

-R


Re: [perl #34952] [PATCH] SDL unitialised variable

2005-04-13 Thread Nick Glencross
And... here's the patch!
Nick
Index: runtime/parrot/library/SDL/Color.imc
===
--- runtime/parrot/library/SDL/Color.imc(revision 7819)
+++ runtime/parrot/library/SDL/Color.imc(working copy)
@@ -188,6 +188,8 @@
.local int offset
classoffset offset, self, 'SDL::Color'
 
+   color = 0
+
# red
inc offset
getattribute component, self, offset


More registers

2005-04-13 Thread Leopold Toetsch
As of rev 7824 Parrot *should* run with NUM_REGISTERS defined as 64 too. 
Only some stack tests are failing that do half frame push and pop tests.

imcc/t/reg/spill_2 just spills 4 registers instead of 36.
Dan, could you please try that with one of your big subroutines and 
report compile times and functionality.

Thanks,
leo


Re: [perl #34937] [PATCH] Absolute library paths on Win32

2005-04-13 Thread Leopold Toetsch
Philip Taylor [EMAIL PROTECTED] wrote:

 This patch makes Parrot recognise /path/to/file and c:/path/to/file as
 absolute paths on Win32 (so that e.g. 'load_bytecode c:/path/to/file'
 can be used instead of 'load_bytecode c:\\path/to/file')

Thanks, applied.
leo


Re: perlscalar morph code

2005-04-13 Thread Leopold Toetsch
Nick Glencross [EMAIL PROTECTED] wrote:

 On a semi-related note, there's some broken morph code in scalar. It has
 code like:

 void increment () {
 PMC_int_val(SELF) = DYNSELF.get_integer() + 1;
 }

 which is then used by subclasses String, Integer and Float.

Integer and Float have their own implementation. But String inherits
this function, which is wrong, yep.

 In the case of String, the get_integer succeeds,

I'd say that plain String PMCs don't have increment and decrement.

It seems best to just remove scalar.increment and .decrement, which then
would automatically create the default_increment for Strings.

 Nick

leo


Re: [PROPOSAL] calling convention abstraction

2005-04-13 Thread Roger Hale
Bob Rogers wrote:
So it sounds like we are all saying the same thing now?
Well, two of us at least (with me coming from the peanut gallery)... Leo 
has his own say, and it's his proposal.

regards,
 Roger


Re: Welcome to the land of Subversion

2005-04-13 Thread Roger Hale
Robert Spier wrote:
Could that be added as 4th line?

Good ideas, all of them.  I've updated the page to add that, and to
switch to bz2.
-R
Following Nicholas Clark:
  bzcat svk-mirror-dump.bz2 | svnadmin load --ignore-uuid ~/.svk/parrot
presumably should be
  bzcat svk-bootstrap-dump.bz2 | svnadmin load --ignore-uuid ~/.svk/parrot
(Although parrotcode.org is denying all knowledge of the file presently...)
regards,
 Roger


[perl #34950] 'Symbol used before set' warning?

2005-04-13 Thread via RT
# New Ticket Created by  Nick Glencross 
# Please include the string:  [perl #34950]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34950 


If it's straightforward, could we get imcc to emit a warning if a symbol 
is used before being set? I've been chasing down a problem where this 
turning out to be the problem. I know imcc code isn't intended to be 
hand-crafted, and will ultimately be computer generated, but in the long 
run it may well help catch many obscure problems...

[I had a nice example to demonstrate how easily this could happen, but 
the latest version of parrot seems to be allocating registers differently]

Cheers,

Nick


[perl #34952] SDL unitialised variable

2005-04-13 Thread via RT
# New Ticket Created by  Nick Glencross 
# Please include the string:  [perl #34952]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34952 


This patch fixes a problem where setting a pixel in a surface isn't 
always the right colour, due to the color symbol not being initialised. 
You get get some weird and beautiful results as things currently stand.

Nick


Re: perlscalar morph code

2005-04-13 Thread Nick Glencross
Leopold Toetsch wrote:
I'd say that plain String PMCs don't have increment and decrement.
It seems best to just remove scalar.increment and .decrement, which then
would automatically create the default_increment for Strings.
Sounds best, doesn't it? It's a bit 'perlish' to inc/dec a string 
directly. If you know that it's a number, then you'd transfer to a int 
register/pmc before the inc.

I bet that you're already onto it... (if not, let me know, and I'll come 
up with a patch)

Nick


Re: [perl #34950] 'Symbol used before set' warning?

2005-04-13 Thread Leopold Toetsch
Nick Glencross [EMAIL PROTECTED] wrote:

 If it's straightforward, could we get imcc to emit a warning if a symbol
 is used before being set?

Please read imcc/cfg.c:690 ff

The problem is probably that the code doesn't consider incoming
arguments in function calls.

 Cheers,

 Nick

leo


Re: [PROPOSAL] infix MMD operators

2005-04-13 Thread Leopold Toetsch
Leopold Toetsch wrote:
If there are no objections, I'll continue with:
5) infix method signature change:
  METHOD PMC* add( [INTERP, SELF,] PMC* rhs, PMC ´*dest) {
if (!dest)
   dest = pmc_new(INTERP, SELF-vtable-base_type);
...
return dest;
  }
If the destination PMC is passed in, it's used else a new PMC of an 
appropriate type is created.

We need this basically for 4 reasons:
[ ... ]
and
7) separate inplace methods
Opcodes like:
  d += r# add d, r
To simplify the MMD function signature change, dynclasses scalars should 
inherit all identical code from Parrot core scalars.

leo


Re: [perl #34952] [PATCH] SDL unitialised variable

2005-04-13 Thread Leopold Toetsch
Nick Glencross [EMAIL PROTECTED] wrote:

 And... here's the patch!

Thanks, applied.
leo


Re: perlscalar morph code

2005-04-13 Thread Leopold Toetsch
Nick Glencross [EMAIL PROTECTED] wrote:
 Leopold Toetsch wrote:

 I'd say that plain String PMCs don't have increment and decrement.

It seems best to just remove scalar.increment and .decrement, which then
would automatically create the default_increment for Strings.

 Sounds best, doesn't it? It's a bit 'perlish' to inc/dec a string
 directly. If you know that it's a number, then you'd transfer to a int
 register/pmc before the inc.

 I bet that you're already onto it... (if not, let me know, and I'll come
 up with a patch)

No, patches welcome - thanks.

 Nick

leo


Parrot and the web (PHP?)

2005-04-13 Thread BÁRTHÁZI András
Hi!
I don't know, which platform is the best to ask this question, maybe 
this is.

I think that web development will be very important in the life of 
Parrot and Perl 6. One of the most important (at least as a server 
administrator) feature of PHP, is that you can lock the programs into a 
directory by defining open_basedir. If the application try to open a 
file from a directory not defined in it, that there will be an 
exception. It's very useful for a hosting company, that two client's 
program cannot read each other.

After this short introduction, I would like to ask you, that if it will 
be possible with Parrot? Or the language should provide this feature 
creating a wrapper for the I/O layer? Do you have a plan for it?

Bye,
  Andras


Re: [perl #34950] 'Symbol used before set' warning?

2005-04-13 Thread Nick Glencross
Leopold Toetsch via RT wrote:
Nick Glencross [EMAIL PROTECTED] wrote:
 

If it's straightforward, could we get imcc to emit a warning if a symbol
is used before being set?
   

Please read imcc/cfg.c:690 ff
The problem is probably that the code doesn't consider incoming
arguments in function calls.
Darn, I skimmed many of the files in imcc/, but missed that one. I'll 
probably close the call as it's certainly been looked at in the past.

The routine seems to have bitrotted a bit as 'function' no longer 
exists, and hacking it can segfault.

As ever, thanks,
Nick


Re: Takers wanted - a perl job

2005-04-13 Thread Robert Spier
  Doesn't work when svk is used to check out the copy. But in that case
  svk list -R does.
 
 Hmm.  Maybe this should be a commit action and not a test.

It was under CVS.  I'm pretty sure everyone ignored it there :)

-R


Re: Parrot and the web (PHP?)

2005-04-13 Thread Timm Murray
On Wednesday 13 April 2005 08:38 am, BRTHZI Andrs wrote:

 I think that web development will be very important in the life of
 Parrot and Perl 6. One of the most important (at least as a server
 administrator) feature of PHP, is that you can lock the programs into a
 directory by defining open_basedir. If the application try to open a
 file from a directory not defined in it, that there will be an
 exception. It's very useful for a hosting company, that two client's
 program cannot read each other.


I think Parrot is the wrong place to solve this problem.  It's better to be 
handled by the languages themselves.


pgpDgS4MhpGdH.pgp
Description: PGP signature


[perl #34959] config/auto/gmp/gmp.in returns 1 instead of 0

2005-04-13 Thread via RT
# New Ticket Created by  Lambeck 
# Please include the string:  [perl #34959]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34959 


Hi all,
Configure.pl failed to find the GNU Math Lib (GMP) on my system eventhough it 
is installed properly (version 4.1.4) .
I compiled  config/auto/gmp/gmp.in by hand and it returned:
4950 1 but expected was:
4950 0

Everything seems to be right, except that mpz_fits_slong_p(k) returned 1 
instead of 0. Could not find anything usefull to explain what it means.
I am on amd64 running Linux.

Adrian Lambeck



pgpSwxwzWbFa1.pgp
Description: PGP signature


[perl #34960] [PATCH] r7825: remove win32 intermediate files during 'dynclasses/make clean'

2005-04-13 Thread via RT
# New Ticket Created by  jerry gay 
# Please include the string:  [perl #34960]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34960 


This transaction appears to have no contentthe attached patch against r7825 removes win32 intermediate files during 
'dynclasses/make clean'
 ~jerry


dynclasses.in.patch
Description: Binary data


[perl #34963] [PATCH] r7825: suppress stderr output during 'bc' step in configure

2005-04-13 Thread via RT
# New Ticket Created by  jerry gay 
# Please include the string:  [perl #34963]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34963 


This transaction appears to have no contentthe attached patch against r7825 suppresses stderr output during 'bc' step 
in configure
 ~jerry


bc.patch
Description: Binary data


Re: Pugs 6.2.0 released.

2005-04-13 Thread David Storrs
On Wed, Apr 13, 2005 at 03:50:38AM +0800, Autrijus Tang wrote:
 I am delighted to report that the first major milestone of Pugs, version
 6.2.0, has been released to CPAN:

Autrijus and everyone else who has been working on Pugs,

As someone who has been following the Perl6 lists for years, I'd like
to say thank you very much for this work.  You guys are great.

--Dks  (wishing he had the tuits to help :)

-- 
[EMAIL PROTECTED]


Re: Parrot and the web (PHP?)

2005-04-13 Thread Dan Sugalski
At 8:42 AM -0500 4/13/05, Timm Murray wrote:
On Wednesday 13 April 2005 08:38 am, BÁRTHÁZI András wrote:

 I think that web development will be very important in the life of
 Parrot and Perl 6. One of the most important (at least as a server
 administrator) feature of PHP, is that you can lock the programs into a
 directory by defining open_basedir. If the application try to open a
 file from a directory not defined in it, that there will be an
 exception. It's very useful for a hosting company, that two client's
 program cannot read each other.

I think Parrot is the wrong place to solve this problem.  It's better to be
handled by the languages themselves.
Nope, parrot's the right place to solve this 
problem, otherwise the problem's not solved. 
Security needs to be implemented by the platform 
(which, in this case, would be parrot) if you 
want it to work.
--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: More registers

2005-04-13 Thread Dan Sugalski
At 12:05 PM +0200 4/13/05, Leopold Toetsch wrote:
As of rev 7824 Parrot *should* run with NUM_REGISTERS defined as 64 
too. Only some stack tests are failing that do half frame push and 
pop tests.

imcc/t/reg/spill_2 just spills 4 registers instead of 36.
Dan, could you please try that with one of your big subroutines and 
report compile times and functionality.
Sure. I'll sync up and give it a shot.
--
Dan
--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: [perl #34963] [PATCH] r7825: suppress stderr output during 'bc' step in configure

2005-04-13 Thread Andy Dougherty
On Wed, 13 Apr 2005, Jerry Gay wrote:

 the attached patch against r7825 suppresses stderr output during 'bc' 
 step in configure

I was thinking along similar lines, but got stuck wondering:  Why is 
Configure.pl looking for bc in the first place?  It doesn't do anything 
with the result.

The problem is complicated because there are significant differences among 
bc(1) commands.  For example, Solaris has a traditional bc(1) command. It 
does not accept the '-v' option, and Configure.pl currently sets 
has_bc='no'.  The GNU version of bc(1) has many extensions beyond 
traditional bc(1).  It does accept a '-v' option, and Configure.pl 
currently sets has_bc='yes'.

A reasonable Configure.pl plan, then, would be to construct a bc input 
file representative of the sorts of things we actually use bc for, run the 
system bc (if there is one), and check that the output is as it should be.

Since bc isn't used anywhere yet, I wasn't able to construct such a 
typical bc input file.

-- 
Andy Dougherty  [EMAIL PROTECTED]
   


Re: Parrot and the web (PHP?)

2005-04-13 Thread BÁRTHÁZI András
Dan Sugalski wrote:
At 8:42 AM -0500 4/13/05, Timm Murray wrote:
On Wednesday 13 April 2005 08:38 am, BÁRTHÁZI András wrote:

 I think that web development will be very important in the life of
 Parrot and Perl 6. One of the most important (at least as a server
 administrator) feature of PHP, is that you can lock the programs into a
 directory by defining open_basedir. If the application try to open a
 file from a directory not defined in it, that there will be an
 exception. It's very useful for a hosting company, that two client's
 program cannot read each other.

I think Parrot is the wrong place to solve this problem.  It's better 
to be
handled by the languages themselves.
Nope, parrot's the right place to solve this problem, otherwise the 
problem's not solved. Security needs to be implemented by the platform 
(which, in this case, would be parrot) if you want it to work.
I agree, that's why I sent this letter to this mailing list. Anyway, I 
think this feature would be very useful for all the scripting languages 
for CGI scripting and for mod_parrot, too (I'm missing this feature from 
Perl 5), and maybe not just for the web, but for console and other type 
of applications.

Let me mention an other feature related to this topic: disabling 
built-in functions, because limiting file access by I/O is not enough, 
if you can use system(), `` and other things.

An other question is, that how can you tell to the platform, to limit 
these features, maybe non-modifiable environment variables and command 
line parameters can be the ways of it.

Bye,
  Andras


Re: Parrot and the web (PHP?)

2005-04-13 Thread Dan Sugalski
At 8:25 PM +0200 4/13/05, BÁRTHÁZI András wrote:
An other question is, that how can you tell to 
the platform, to limit these features, maybe 
non-modifiable environment variables and command 
line parameters can be the ways of it.
For that you need a full-blown quota and 
privilege system. Luckily there are plans for 
one. :)
--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: [perl #34963] [PATCH] r7825: suppress stderr output during 'bc' step in configure

2005-04-13 Thread jerry gay
On 4/13/05, Andy Dougherty [EMAIL PROTECTED] wrote:

 On Wed, 13 Apr 2005, Jerry Gay wrote:
 
  the attached patch against r7825 suppresses stderr output during 'bc'
  step in configure
 
 I was thinking along similar lines, but got stuck wondering: Why is
 Configure.pl looking for bc in the first place? It doesn't do anything
 with the result.

 bernhard, (r7757), notes:

 r7757 | bernhard | 2005-04-02 03:00:05 -0800 (Sat, 02 Apr 2005) | 4 lines
Changed paths:
M /trunk/MANIFEST
A /trunk/config/auto/bc.pl
M /trunk/config/auto/perldoc.pl
M /trunk/lib/Parrot/Configure/RunSteps.pm

Check for existence of 'bc', the basic calculator, on the system.
When running tests for 'Parrot bc', I'd like to doublecheck
with the standard 'bc'.

so it seems he's using it for testing against parrot. perhaps there's some 
basic functionality that 'bc' shares in its many incarnations, including a 
method of detection that can be used reliably during configure. since i 
can't find 'Parrot bc', i'll wait for bernhard to weigh in.

 Andy Dougherty [EMAIL PROTECTED]

 ~jerry


Re: Parrot and the web (PHP?)

2005-04-13 Thread MrJoltCola
At 02:33 PM 4/13/2005, Dan Sugalski wrote:
At 8:25 PM +0200 4/13/05, BÁRTHÁZI András wrote:
An other question is, that how can you tell to the platform, to limit 
these features, maybe non-modifiable environment variables and command 
line parameters can be the ways of it.
For that you need a full-blown quota and privilege system. Luckily there 
are plans for one. :)
As far as boxing a VM into a sub-directory, etc. UNIX (chroot) and VMS make 
this a breeze since
the mechanisms are builtin to the OS, it is Windows where all the work has 
to be done.

Maybe Windows has matured since the last time I looked at this sort of 
thing, but most
sys admins I know still prefer to run their JVMs, app servers, etc. in a 
UNIX environment
just for this reason.

Solaris 10 just took it to a new level with zones although there have 
been similar patches
out there for BSD and Linux for a long time.

-Melvin


Re: Parrot and the web (PHP?)

2005-04-13 Thread BÁRTHÁZI András
Hi,
An other question is, that how can you tell to the platform, to limit 
these features, maybe non-modifiable environment variables and 
command line parameters can be the ways of it.
For that you need a full-blown quota and privilege system. Luckily 
there are plans for one. :)
As far as boxing a VM into a sub-directory, etc. UNIX (chroot) and VMS 
make this a breeze since
the mechanisms are builtin to the OS, it is Windows where all the work 
has to be done.
I'm not a UNIX guru, but I don't know an easily installable solution for 
the problem. I would like to run just one Apache, and would like to run 
Perl as an Apache module. Chroot I think is not a solution for it. 
Running the script as CGI or running as much Apaches as much client you 
have is not a solution for me and for a lot of people. PHP offer an easy 
way to solve this problem.

Perl was the most famous web development environment some year ago, 
today PHP is that. I think one of the reasons is this. (Anyway, Parrot 
and the Languages should work on all platforms, not just some - a lot of 
people using Windows as development platform).

Bye,
  Andras


Re: Parrot and the web (PHP?)

2005-04-13 Thread Dan Sugalski
At 9:49 PM +0200 4/13/05, BÁRTHÁZI András wrote:
Hi,
An other question is, that how can you tell 
to the platform, to limit these features, 
maybe non-modifiable environment variables 
and command line parameters can be the ways 
of it.
For that you need a full-blown quota and 
privilege system. Luckily there are plans for 
one. :)
As far as boxing a VM into a sub-directory, 
etc. UNIX (chroot) and VMS make this a breeze 
since
the mechanisms are builtin to the OS, it is 
Windows where all the work has to be done.
I'm not a UNIX guru, but I don't know an easily 
installable solution for the problem. I would 
like to run just one Apache, and would like to 
run Perl as an Apache module. Chroot I think is 
not a solution for it. Running the script as CGI 
or running as much Apaches as much client you 
have is not a solution for me and for a lot of 
people. PHP offer an easy way to solve this 
problem.
It's important here to note that when I said 
platform I meant Parrot. (That was in there, 
but it's worth being clear about) That is, the 
platform is Parrot, not the OS parrot is running 
on, and Parrot is responsible for any security 
guarantees it makes. Now, it may make them by 
using facilities the OS provides (which makes the 
job easier) but it doesn't have to -- it can and 
will do it with no OS help if need be.
--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: Takers wanted - a perl job

2005-04-13 Thread Michael G Schwern
On Wed, Apr 13, 2005 at 08:58:19AM -0700, Robert Spier wrote:
   Doesn't work when svk is used to check out the copy. But in that case
   svk list -R does.
  
  Hmm.  Maybe this should be a commit action and not a test.
 
 It was under CVS.  I'm pretty sure everyone ignored it there :)

They wouldn't ignore it if it caused the commit to fail now would they.



Re: Parrot and the web (PHP?)

2005-04-13 Thread Michael G Schwern
On Wed, Apr 13, 2005 at 04:23:01PM -0400, MrJoltCola wrote:
 Perl was the most famous web development environment some year ago, today 
 PHP is that. I think one of
 
 I disagree. How do you support that blanket statement?

I politely request that we not have a Perl vs PHP popularity discussion here.



Re: Takers wanted - a perl job

2005-04-13 Thread Leopold Toetsch
Robert Spier wrote:
Doesn't work when svk is used to check out the copy. But in that case
svk list -R does.
Hmm.  Maybe this should be a commit action and not a test.

It was under CVS.  I'm pretty sure everyone ignored it there :)
Well, it always depends, how responds looks like:
Committed revision 1234
*
ATT MAINFEST ERROR
missing bla.bla ...
*
-R
leo


Re: Parrot and the web (PHP?)

2005-04-13 Thread BÁRTHÁZI András
Hi,
I'm not a UNIX guru, but I don't know an easily installable solution 
for the problem. I would like to run just one Apache, and would like 
to run Perl as an Apache module. Chroot I think is not a solution for 
it. Running the script as CGI or running as much Apaches as much 
client you have is not a solution for me and for a lot of people. PHP 
offer an easy way to solve this problem.
You obviously are talking about a web hosting environment with multiple 
applications and customers.
Yes.
I did not mean that chroot() was the solution, it is however part of the 
solution on the UNIX
environment if you want proper security.
I agree, but it cannot solve the problem (a customer can read the 
other's program), just using a lot of extra resources.

Perl was the most famous web development environment some year ago, 
today PHP is that. I think one of
I disagree. How do you support that blanket statement?
This is my experiment in Hungary about web development. PHP is the most 
famous language, after it Java and .Net comes and Perl is after them. 
Hosting companies have very few Perl clients, and they don't like them.

We had a meeting (workshop, mini-conference) in Hungary a few months 
ago, and we talked about the Perl vs. PHP thing. We think that people 
choose PHP for web development 'cause it can be easily installed and you 
get results in a short time, plus it's hard to setup a Perl environment 
that's secure.

I don't have any customers using PHP, they either use Java (some J2EE 
container, Oracle, BEA, Websphere, Tomcat) or they use Perl (CGI or 
mod-perl), etc.
I have just PHP customers. ;) :(
I agree with your statement if you are talking about small web-site 
hosting. 30 bucks a month
for a website and you host 100 sites on a single shared server. PHP has 
a large share of that market,
but for medium to large complexity apps, specifically commercial 
enterprise apps, PHP has
very little presence. The marketing dollars are all behind Java and .NET.
Totally agree.
I guess it just goes to show we all swim in different ponds.
I think, you are right. ;)
Anyway, I did not mean to start a tangent, I want to see PHP run well on 
Parrot so we can agree on that.
:)
Anyway, I'm not talking about PHP. I'm talking about how I think Parrot 
and Perl 6 can be sucessful in the web development area.

Bye,
  Andras
ps: And I'm finished it. ;)


A sketch of the security model

2005-04-13 Thread Dan Sugalski
So here's what I was thinking of for Parrot's security and quota 
model. (Note that none of this is actually *implemented* yet...)

All security is done on a per-interpreter basis. (really on a 
per-thread basis, but since we're one-thread per interpreter it's 
essentially the same thing)

QUOTAs are limits on the number of resources or operations that an 
interpreter an allocate or perform, either in absolute terms (i.e. 
allocate no more than 10M of memory) or relative terms (i.e. can do 
only 10 IO operations per second). Quotas are tracked by parrot, and 
cover:

   * Number of open files
   * IO operations/sec
   * IO operations total
   * Memory allocated
   * CPU time consumed
   * Threads spawned
   * Sub-processes spawned total
   * Simultaneous sub-processes
PRIVILEGEs are permissions to do certain things. Parrot will have a 
number of privileges it checks before doing dangerous operations, and 
user code may also assign and check privileges.

Normally parrot runs with no quotas and no privilege checking. This 
is the fastest way to run. Code may at any time enable privilege 
and/or quota checking. Once enabled code must have proper privileges 
to disable it again.

Each running thread has two sets of privileges -- the active 
privileges and the enableable privileges. Active privs are what's 
actually in force at the moment, and can be dropped at any time. The 
enableable privs are ones that code can turn on. It's possible to 
have an active priv that's not in the enableable set, in which case 
the current running code is allowed to do something but as soon as 
the privilege is dropped it can't be re-enabled.

Additionally, subroutines may be marked as having privileges, which 
means that as long as control is inside the sub the priv in question 
is enabled. This allows for code that has elevated privs, generally 
system-level code.

Continuations, when taken, capture the current set of active and 
enableable privs, and when invoked those privs are put into place. 
(This is a spot that will require some thought, since there's a 
potential for privilege leaks which worries me here) Non-continuation 
invokables (subs and methods) maintain the current set of privs, plus 
possibly adding the sub-specific privs.

It's actually pretty straightforward, the hard part being the whole 
don't screw up when implementing thing, along with designing the 
base set of privs. Personally I think taking the VMS priv and quota 
system as a base is a good way to go -- it's well-respected and 
well-tested, and so far as I know theoretically sound. Unix's priv 
model's a lot more primitive, and I don't think it's the one to take. 
(We could invent our own, but history shows that people who invent 
their own security system invent ones that suck, so that looks like 
something worth avoiding)

--
Dan
--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: A sketch of the security model

2005-04-13 Thread Aaron Sherman
On Wed, 2005-04-13 at 17:01, Dan Sugalski wrote:
 So here's what I was thinking of for Parrot's security and quota 
 model. (Note that none of this is actually *implemented* yet...)
[...]
 It's actually pretty straightforward, the hard part being the whole 
 don't screw up when implementing thing, along with designing the 
 base set of privs. Personally I think taking the VMS priv and quota 
 system as a base is a good way to go -- it's well-respected and 
 well-tested, and so far as I know theoretically sound. Unix's priv 
 model's a lot more primitive, and I don't think it's the one to take. 
 (We could invent our own, but history shows that people who invent 
 their own security system invent ones that suck, so that looks like 
 something worth avoiding)

VMS at least *is* a priv-based security model, but VMS privs are not
appropriate for parrot on the whole.

That said, it's been 10+ years since I've touched VMS, so pardon as I go
and Google the priv list

Privs that make sense for Parrot without change:

   ALL   Allow all privileges.
   DETACHCreate detached processes.
   EXQUOTA   Exceed resource quotas.
   SETPRVGrant a process any privilege.
   SHMEM Create or delete data structures in shared memory.
   SYSGBLCreate system global sections.
   SYSLCKRequest locks on system resources.

Privs that make no sense at all for Parrot (as far as I can tell):

   ACNT  Create a process for which no accounting is performed.
   BUGCHKMake bugcheck error log entries.
   CMEXECChange mode to Executive.
   CMKRNLChange mode to Kernel.
   DIAGNOSE  Issue diagnostic I/O requests.
   GRPNAMEnter names in the group logical name table.
   GRPPRVAllow access to files in the group and system
 categories.
   MOUNT Issue mount volume I/O requests.
   PHY_IOIssue physical I/O requests.
   PRMCEBCreate permanent common event flag clusters.
   PRMGBLCreate permanent global clusters.
   PSWAPMChange process swap mode.
   SHARE Assign a channel to a device.
   SYSNAMEnter names in the system logical name table.
   TMPMBXCreate temporary mailbox devices.
   VOLPROOverride protection on a volume.
   WORLD Control the execution of any process on the system.

Privs that could make sense, but have different meanings:

   ALLSPOOL  Allocate spooled devices.
This means you can create new handles
   ALTPRIIncrease the base execution priority for any process.
change to: Allow QUOTA modification
   BYPASSAccess resources without regard to UIC protection.
This means ignore my privs and just do it (default)
   GROUP Control execution of other processes in the same group.
This is interp-to-interp control (e.g. kill my sibling)
   LOG_IOIssue logical I/O requests.
if we assume that this means any handle I/O
   NETMBXCreate a network device.
This just means allocate any network resource (e.g. socket)
   OPER  Perform system operator functions.
In VMS this was fuzzy, and referred to any operation
that told the OS that it required OPER (like running
certain tools). I'm not sure what this means for
Parrot that BYPASS does not
   PFNMAPCreate or delete sections mapped by page frame.
Allocate new PMCs
   PRMMBXCreate permanent mailbox devices.
Create special files of any sort (e.g. POSIX fifo)
   SECURITY  Perform security-related functions.
?
   SYSPRVAccess resources as if the process has a system UIC.
?

Privs that do not exist in VMS:

NEWPBC  Execute new Parrot Byte Code at run-time
DEBUG   Perform operations only appropriate for a debugger
GCDOD   Directly manage GC/DOD behavior
NONREL  Create I/O handles from non-relative locaters
(e.g. open a rooted path; possibly applicable to
URI interpretation also)
DLOAD   Dynamically load binary objects
PLOAD   Dynamically load Parrot byte code (bypass NEWPBC)
This allows a PVM to load an existing PBC module and
execute it, but not to create its own PBC at run-time.
More...?

I think it would be easier to start from scratch, personally. I
understand your concerns, but I don't think you run any less risk by
creating a new VM security model out of an OS security model than you do
by creating a new one. They both create many opportunities to make a
mistake.

If you really want to reduce the chances that you'll make a mistake,
swipe the security model from JVM or CLR and start with that. At least
those have been tested in the large, and map closer to what Parrot wants
to do than VMS.

Don't get me wrong. I loved VMS back in the day. It was a pain in the
ass at times, but what isn't. It's just that it's not a VM trying to

[perl #34964] [PATCH] Fix some segfaults due to scalar.pmc/string.pmc

2005-04-13 Thread via RT
# New Ticket Created by  Nick Glencross 
# Please include the string:  [perl #34964]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34964 


This patch fixes a few operations which are badly inherited by string 
from scalar.pmc. increment/decrement have been removed as they aren't 
really required for Strings. 'neg' also also suffered from a similar 
problem, so this patch also stops this example segfaulting:

.sub test
new $P0, .String
$P0 = 12
neg $P0
print $P0
print_newline
.end

You may need to do a make clean or similar to get string.c to be 
properly built...(?)

[My feeling is that scalar should define set_integer_native, 
set_number_native etc. to automatically morph, and then for integer, 
float and string to override these to either not morph (for better 
performance), or just do their own thing (i.e. 
string::set_integer_native to convert the int to a String). That way you 
can't get data being changed without its interpretation.]
Index: classes/scalar.pmc
===
--- classes/scalar.pmc  (revision 7825)
+++ classes/scalar.pmc  (working copy)
@@ -87,7 +87,6 @@
 =item CSTRING *get_string()
 
 
-
 =cut
 
 */
@@ -477,10 +476,7 @@
 */
 
 void neg (PMC* dest) {
-if (dest == SELF)
-PMC_int_val(SELF) = -DYNSELF.get_integer();
-else
-VTABLE_set_integer_native(INTERP, dest, -DYNSELF.get_integer());
+VTABLE_set_integer_native(INTERP, dest, -DYNSELF.get_integer());
 }
 
 /*
@@ -931,36 +927,9 @@
 (UINTVAL)value, NULL) );
 }
 
-/*
 
-=item Cvoid increment()
-
-Increments the scalar.
-
-=cut
-
-*/
-
-void increment () {
-PMC_int_val(SELF) = DYNSELF.get_integer() + 1;
-}
-
 /*
 
-=item Cvoid decrement()
-
-Decrements the scalar.
-
-=cut
-
-*/
-
-void decrement () {
-PMC_int_val(SELF) = DYNSELF.get_integer() - 1;
-}
-
-/*
-
 =item CINTVAL defined()
 
 Always returns true.


[perl #34966] [PATCH] fix about 30 typos

2005-04-13 Thread via RT
# New Ticket Created by  Nick Glencross 
# Please include the string:  [perl #34966]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34966 


This patch against r7825 fixes about 30-odd typos. All are in 
comments/docs, so all changes are just polish.

Regards,

Nick
Index: src/pdb.c
===
--- src/pdb.c   (revision 7825)
+++ src/pdb.c   (working copy)
@@ -200,7 +200,7 @@
 =item * Print the interpreter info.
 
 =item * Make the user interface better (add comands
-history/completition).
+history/completion).
 
 =item * Some other things I don't remember now because it's late.
 
Index: src/tsq.c
===
--- src/tsq.c   (revision 7825)
+++ src/tsq.c   (working copy)
@@ -142,7 +142,7 @@
 =item Cvoid
 unshift_entry(QUEUE *queue, QUEUE_ENTRY *entry)
 
-Does a syncronized insertion of Centry into the head of the queue.
+Does a synchronized insertion of Centry into the head of the queue.
 
 =cut
 
@@ -223,7 +223,7 @@
 =item Cvoid
 insert_entry(QUEUE *queue, QUEUE_ENTRY *entry)
 
-Does a syncronized insert of Centry.
+Does a synchronized insert of Centry.
 
 =cut
 
Index: src/pbc_info.c
===
--- src/pbc_info.c  (revision 7825)
+++ src/pbc_info.c  (working copy)
@@ -32,7 +32,7 @@
 =item Cstatic INTVAL iter(Interp*, struct PackFile_Segment *seg, void 
*user_data)
 
 This function is passed the callback to CPackFile_map_segments() to
-print out the name of each segment in the directoty.
+print out the name of each segment in the directory.
 
 =cut
 
Index: src/hash.c
===
--- src/hash.c  (revision 7825)
+++ src/hash.c  (working copy)
@@ -646,7 +646,7 @@
 hash_comp_fn compare, hash_hash_key_fn keyhash,
 hash_mark_key_fn mark)
 
-Like above but w/o the decribed problems. The passed in Ccontainer PMC gets
+Like above but w/o the described problems. The passed in Ccontainer PMC gets
 stored in the Hash end the newly created Hash is in PMC_struct_val(container).
 
 =cut
@@ -746,7 +746,7 @@
 =item CSTRING *
 hash_get_idx(Interp *interpreter, Hash *hash, PMC * key)
 
-Called by interator.
+Called by iterator.
 
 =cut
 
Index: src/gc_gms.c
===
--- src/gc_gms.c(revision 7825)
+++ src/gc_gms.c(working copy)
@@ -74,7 +74,7 @@
 complete.
 
 But there is of course the possibilty that a young object is
-stored into an aggregate of an older gneration. This case is tracked
+stored into an aggregate of an older generation. This case is tracked
 by the write barrier, which remembers all such operations in the IGP
 (inter generational pointer) list. When now generation 1 is marked,
 the IGP list can be considered as an extension to the root set, so
@@ -137,7 +137,7 @@
  *
  * A scope_enter happens on a subroutine call *and' with new_pad /
  * push_pad opcodes. Each lexical scope must have its distinct register
- * frame, else timely detruction can't work.
+ * frame, else timely destruction can't work.
  * If the frame needs active destruction, the old frame should be
  * converted to the (new-1) generation, the inner frame is the nursery.
  * On scope exit the newest (nursery) generation is collected and the
@@ -1338,7 +1338,7 @@
 }
 else {
 /*
- * successfull lazy DOD run
+ * successful lazy DOD run
  */
 ++arena_base-lazy_dod_runs;
 }
Index: src/gc_ims.c
===
--- src/gc_ims.c(revision 7825)
+++ src/gc_ims.c(working copy)
@@ -26,11 +26,11 @@
 
 =head1 Drawbacks of the current mark and sweep collector.
 
- * can take arbitray time to complete (1s for 1 Meg objects)
+ * can take arbitrary time to complete (1s for 1 Meg objects)
  * can't be used in multi-threaded Parrot
  * works fast for plain (non-aggregate) objects but suffers badly
for nested aggregates or HLL objects
- * the sweep phase takes time proportional to the allocated storeage
+ * the sweep phase takes time proportional to the allocated storage
 
 =head1 INCREMENTAL GARBAGE COLLECTION
 
@@ -205,7 +205,7 @@
 
 =item c) near the end of a DOD cycle
 
-The rest of the root set is scanned i.e. the registers. By defering
+The rest of the root set is scanned i.e. the registers. By deferring
 scanning of registers all temporaries that might have exist somewhen
 just stay unscanned - they will be collected in this DOD cycle, if
 we allocate new objects white or in the next DOD cycle.
@@ -232,7 +232,7 @@
 
 Finally, we might trigger a collect run on string and buffer memory if
 there is an impending shortage of resources. While the copying compactor
-is rather independend of the collector that cleans object headers, its
+is rather 

Re: [perl #34966] [PATCH] fix about 30 typos

2005-04-13 Thread chromatic
On Wed, 2005-04-13 at 12:49 -0700, Nick Glencross wrote:

 This patch against r7825 fixes about 30-odd typos. All are in 
 comments/docs, so all changes are just polish.

Thanks, applied with a few tweaks of my own.

-- c



[RFC] .local, .syn, etc.

2005-04-13 Thread William Coleda
Currently, the following syntax is allowed, and used in examples and code 
throughout the repository:
.local String foo
foo = new String
.sym   String bar
bar = new String
But... this isn't actually enforced. You can do:
.local String foo
foo = new Blorp
Basically, anything that isn't one of the basic types is interpreted as pmc.
After a discussion on #parrot, there are a few options that came up. This is a 
grab bag, and hopefully a basis for discussion:
1) make
.local String foo 

(and .sym) equivalent to:
.local pmc foo
foo = new String
2) make 

.local String foo
(and .syn) a compile time error: just allow pmc. [1]
3) Allow an initializer as part of the declaration:
.local string foo = ascii:foo
which would be equivalent to
.local string foo
foo = ascii:foo
4) Have .sym and .local take on different possible syntaxes.
5) eliminate one of .sym or .local
6) avoid using .local to mean something different based on context (macro or 
not)
7) Add .lexical No firm syntax was discussed for this, but something like:
.lexical pmc foo # with optional quotes for hard-to-parse variable names
would be equivalent to todays:
.local pmc foo
foo = find_lex -1, foo
And give the ability to provide something other than the default -1 there.
8) add .global... Similar to #7.

[1]
This discussion arose because I was curious if a patch that implemented #2 (and 
fixed all the resulting errors) would be accepted.


Re: A sketch of the security model

2005-04-13 Thread Michael Walter
Dan,

On 4/13/05, Dan Sugalski [EMAIL PROTECTED] wrote:
 All security is done on a per-interpreter basis. (really on a
 per-thread basis, but since we're one-thread per interpreter it's
 essentially the same thing)
Just to get me back on track: Does this mean that when you spawn a
thread, a separate interpreter runs in/manages that thread, or
something else?

 Each running thread has two sets of privileges -- the active
 privileges and the enableable privileges. Active privs are what's
 actually in force at the moment, and can be dropped at any time. The
 enableable privs are ones that code can turn on. It's possible to
 have an active priv that's not in the enableable set, in which case
 the current running code is allowed to do something but as soon as
 the privilege is dropped it can't be re-enabled.

How can dropping a privilege for the duration of a (dynamic) scope be
implemented? Does this need to be implemented via a parrot intrinsic,
such as:

  without_privs(list_of_privs, code_to_be_run_without_these_privs);

..or is it possible to do so with the primitives you sketched out above?

 Additionally, subroutines may be marked as having privileges, which
 means that as long as control is inside the sub the priv in question
 is enabled. This allows for code that has elevated privs, generally
 system-level code.

Does the code marking a subroutines must have any other privilege than
the one it is marking the subroutine with?

 ... Non-continuation
 invokables (subs and methods) maintain the current set of privs, plus
 possibly adding the sub-specific privs.

Same for closures?

Regards,
Michael


Help compile parrot on arm-linux

2005-04-13 Thread
Hello!
  I'm new to parrot, sorry for my pool english first.
 
  I downloaded parrot-0.1.2 to my debian-arm box ---
its cpu(arm920t) is s3c2410 of Samsung.

  first , I run perl Configure.pl --cc=gcc --cxx=g++
--link=gcc to config parrot. The config successly
finished and generated the Makefile , but there are
wrong in the config process:
Determining architecture, OS and JIT capability..
pc : [00011000]lr : [8a08]Not tainted
sp : bd74  ip : 401f8160  fp : bda4
r10: 4024e628  r9 : 88f8  r8 : 4024fac8
r7 : 0002  r6 : 8a54  r5 : 4001c2e0  r4 :
bdd4
r3 : 00011000  r2 : 0001  r1 : 1000  r0 :

Flags: nZCv  IRQs on  FIQs on  Mode USER_32  Segment
user
Control: C000317F  Table: 32B8  DAC: 0015
pc : [00011000]lr : [8a08]Not tainted
sp : bd74  ip : 401f8160  fp : bda4
r10: 4024e628  r9 : 88f8  r8 : 4024fac8
r7 : 0002  r6 : 8a54  r5 : 4001c2e0  r4 :
bdd4
r3 : 00011000  r2 : 0005  r1 : 1000  r0 :

Flags: nZCv  IRQs on  FIQs on  Mode USER_32  Segment
user
Control: C000317F  Table: 32B8  DAC: 0015
.done.

What's wrong with it ?  Any suggestion is appreciated!




_
Do You Yahoo!?
150MP3
http://cn.rd.yahoo.com/mail_cn/tag/yisou/music/*http://music.yisou.com/

http://cn.rd.yahoo.com/mail_cn/tag/yisou/image/*http://image.yisou.com
1G1000
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/


Re: [RFC] .local, .syn, etc.

2005-04-13 Thread Matt Diephouse
William Coleda [EMAIL PROTECTED] wrote:
 But... this isn't actually enforced. You can do:
 
 .local String foo
 foo = new Blorp
 
 Basically, anything that isn't one of the basic types is interpreted as pmc.

I think this is misleading.

 1) make
 
 .local String foo
 
 (and .sym) equivalent to:
 
 .local pmc foo
 foo = new String

That is how I would expect .local to work.

 2) make
 
 .local String foo
 
 (and .syn) a compile time error: just allow pmc. [1]

Failing 1), I would support this.

 3) Allow an initializer as part of the declaration:
 
 .local string foo = ascii:foo
 
 which would be equivalent to
 
 .local string foo
 foo = ascii:foo

Pretty please?

 4) Have .sym and .local take on different possible syntaxes.

I'll vote no.

 5) eliminate one of .sym or .local

Definitely. I think we should drop one (.sym). As Will noted the other
day on IRC, we're only a 0.1 release, so we don't need to worry about
backwards compatibility yet. It's best to get this stuff out while we
still can.

 6) avoid using .local to mean something different based on context (macro 
 or not)

I'm not sure what you mean.

 7) Add .lexical No firm syntax was discussed for this, but something 
 like:

Sounds good to me.

 8) add .global... Similar to #7.

Same here.

-- 
matt diephouse
http://matt.diephouse.com


Re: I wish to understand the JIT machine code generator

2005-04-13 Thread rocko
Quoting Leopold Toetsch [EMAIL PROTECTED]:
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I have been trying to examine the i386 code generator to see how
feasible it would be to create an AMD64 code generator.
Unfortunately, the code is uncommented, and I haven't yet found any
documentation to explain how it works on Parrot.  So far I've
determined there's relevant stuff in jit/i386.  I don't understand the
.jit extension on core.jit.  Is that not actually heavily templated C
code?
jit/*/jit_emit.h defines basically a bunch of macros that emit opcodes.
There are additionally some interface functions like
Parrot_jit_begin(), Parrot_jit_normal_op and the register move functions
called from src/jit.c to copy registers from Parrot to CPU and back.
i386 has additional code to emit NCI stubs and direct vtable calls,
which all is optional. docs/jit.pod has some more details on the
interface functions.
The format of jit/*/core.jit is also covered by doc/jit.pod. It defines
JITted opcode functions which, when called by the code generator in
src/jit.c, emit code for the function. It makes use of templates to
generate the final code in src/jit_cpu.c and src/exec_cpu.c.
Please have a look at these generated files and the docs. If there are
some more questions, please just ask.
leo
Thank you.  The POD is a little thick, and I'll be printing it out so I can
follow along.  I'm going to copy the i386 path to an a64 path and have at it.
I'm hoping it won't be much of a stretch to get 64-bit code generated --
although REASONABLE 64-bit code is another problem.  But first I want 
to ask if
anybody else is doing this already.  I don't know what I'm getting 
myself into,
other than at least modifying ~5,000 lines of code.