Re: [perl #19610] [PATCH] New language support: Ook!

2003-01-15 Thread Leopold Toetsch
Jerome Quelin (via RT) wrote:


 - currently I'm just printing on stdout the resulting parrot code, I 
lack an eval instruction in Parrot. Dan, Leo? :-)

$ diff -ub  ~/src/parrot/languages/ook/ook.pasm ook.pasm
--- /home/lt/src/parrot/languages/ook/ook.pasm  Wed Jan  1 01:34:16 2003
+++ ook.pasmWed Jan 15 16:41:00 2003
@@ -101,7 +101,8 @@
 LOOP_END:
 le I1, I0, LOOP
 concat S4, \tend\n
-print S4
+#print S4
+   compile P1, S4, PASM
 end

$ ../imcc/imcc -r ook.pasm hello.ook
Hello World!

$ ../imcc/imcc -r ook.pasm test.ook
1..1
ok 1

(compile does eval here for test purposes)

Have fun!
leo




Re: [perl #19610] [PATCH] New language support: Ook!

2003-01-15 Thread Leopold Toetsch
In perl.perl6.internals, you wrote:
 Leopold Toetsch wrote:
 $ ../imcc/imcc -r ook.pasm hello.ook
 Hello World!

 You don't seem to have checked in the compile thing...

No, its not ready yet.

 About the eval: you said that compile does eval here. In the future, how
 should I eval after compile?

Probably by invoke-ing the created PMC.

 Jerome

leo



Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-31 Thread Daniel Grunblatt
On Monday 30 December 2002 21:30, Leopold Toetsch wrote:
 Jerome Quelin (via RT) wrote:
  # New Ticket Created by  Jerome Quelin
  # Please include the string:  [perl #19610]
  # in the subject line of all future correspondence about this issue.
  # URL: http://rt.perl.org/rt2/Ticket/Display.html?id=19610 
 
   - currently I'm just printing on stdout the resulting parrot code, I
  lack an eval instruction in Parrot. Dan, Leo? :-)

 Here is the solution of our perl6 bootstrapping problem, I'll make an
 Ieval ops ...

May be you can use PDB_eval (If it's still around) 



Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-31 Thread Jerome Quelin
Leopold Toetsch wrote:
   - currently I'm just printing on stdout the resulting parrot code,
  I lack an eval instruction in Parrot. Dan, Leo? :-)
 Here is the solution of our perl6 bootstrapping problem, I'll make an
 Ieval ops ...

Nice to see how dummy languages make the whole stuff advance... :o)


  +Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
  Ook. Ook. Ook. 
  +Ook. Ook. Ook. Ook. Ook! Ook?
 ... and you have only to reimplement P6C - Ook!

Sorry, I didn't get that one. Could you explain please?


Jerome
-- 
[EMAIL PROTECTED]




Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-31 Thread Dan Sugalski
At 6:18 PM +0100 12/31/02, Jerome Quelin wrote:

Leopold Toetsch wrote:

   - currently I'm just printing on stdout the resulting parrot code,
  I lack an eval instruction in Parrot. Dan, Leo? :-)
 Here is the solution of our perl6 bootstrapping problem, I'll make an
 Ieval ops ...


Nice to see how dummy languages make the whole stuff advance... :o)


There should actually be one spec'd in PDD6. Let me check...

No. Hrm. I'll go fix. Back in a bit.
--
Dan

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



Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-31 Thread Simon Cozens
[EMAIL PROTECTED] (Jerome Quelin) writes:
 Thanks to our dear summarizer, I'm now known (from a googlism point of 
 view) as 'one of the let's implement a bunch of languages on parrot 
 crew'. So, in order to prove him right definitely (and also because 
 orang-utans should also benefit from Parrot's speed), here's a new 
 language supported by Parrot: the Ook! language.

Shouldn't this be reworked as a patch to Acme::Ook?

-- 
Masque It's all fun and games until someone loses an eye.
purl Then it's a sport!



Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-31 Thread Dan Sugalski
At 12:49 PM -0500 12/31/02, Dan Sugalski wrote:

At 6:18 PM +0100 12/31/02, Jerome Quelin wrote:

Leopold Toetsch wrote:

   - currently I'm just printing on stdout the resulting parrot code,
  I lack an eval instruction in Parrot. Dan, Leo? :-)
 Here is the solution of our perl6 bootstrapping problem, I'll make an
 Ieval ops ...


Nice to see how dummy languages make the whole stuff advance... :o)


There should actually be one spec'd in PDD6. Let me check...

No. Hrm. I'll go fix. Back in a bit.


Okay, fix to docs partially checked in. The compile and compreg ops 
are defined, and I'll work on the rest of the dynamic bytecode 
generation ops today.

This doesn't actually *implement* them, but that should come next.
--
Dan

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


Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-31 Thread Nicholas Clark
On Tue, Dec 31, 2002 at 06:18:36PM +0100, Jerome Quelin wrote:
 Nice to see how dummy languages make the whole stuff advance... :o)

Then there's the zcode interpreter...
(dynamic opcode library loading, foreign bytecode translation)

Nicholas Clark



Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-31 Thread Nicholas Clark
On Mon, Dec 30, 2002 at 11:09:07PM +, Jerome Quelin wrote:
 # New Ticket Created by  Jerome Quelin 
 # Please include the string:  [perl #19610]
 # in the subject line of all future correspondence about this issue. 
 # URL: http://rt.perl.org/rt2/Ticket/Display.html?id=19610 
 
 
 Thanks to our dear summarizer, I'm now known (from a googlism point of 
 view) as 'one of the let's implement a bunch of languages on parrot 
 crew'. So, in order to prove him right definitely (and also because 
 orang-utans should also benefit from Parrot's speed), here's a new 
 language supported by Parrot: the Ook! language.

On Tue, Dec 31, 2002 at 06:15:43PM +0100, Jerome Quelin wrote:

 Oh, btw. This patch assumes the first Ook! patch is already commited.

Thanks, both applied

Nicholas Clark



[perl #19610] [PATCH] New language support: Ook!

2002-12-30 Thread via RT
# New Ticket Created by  Jerome Quelin 
# Please include the string:  [perl #19610]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt2/Ticket/Display.html?id=19610 


Thanks to our dear summarizer, I'm now known (from a googlism point of 
view) as 'one of the let's implement a bunch of languages on parrot 
crew'. So, in order to prove him right definitely (and also because 
orang-utans should also benefit from Parrot's speed), here's a new 
language supported by Parrot: the Ook! language.

For the unlucky who don't know it, Ook! is essentially isomorphic to the 
well-known brainfsck language. 
Refer to http://www.dangermouse.net/esoteric/ook.html for more details.

Ok, about this implementation:
 - this is a compiler (and not an interpreter) that spits Parrot 
assembly code (yes, I'm targeting Parrot).
 - it implements every Ook! instruction but the Ook. Ook! one. I'll 
work on it later.
 - currently I'm just printing on stdout the resulting parrot code, I 
lack an eval instruction in Parrot. Dan, Leo? :-)

Disclaimer: it's all of Nicholas Clark's fault. Really. He's the one to 
take the blame for it.

Jerome
-- 
[EMAIL PROTECTED]


-- attachment  1 --
url: http://rt.perl.org/rt2/attach/46602/36599/6c9317/ook_first_draft.patch


diff -urbN parrot.old/config/gen/makefiles/ook.in parrot/config/gen/makefiles/ook.in
--- parrot.old/config/gen/makefiles/ook.in	1970-01-01 01:00:00.0 +0100
+++ parrot/config/gen/makefiles/ook.in	2002-12-30 23:25:20.0 +0100
@@ -0,0 +1,18 @@
+RM_F = ${rm_f}
+PERL = ${perl}
+
+ASSEMBLE=$(PERL) ../../assemble.pl
+PARROT=../../parrot
+
+all: build
+
+test: build
+	$(PARROT) ook.pbc hello.ook  foo.pasm
+	$(ASSEMBLE) foo.pasm  foo.pbc
+	$(PARROT) foo.pbc
+
+build: ook.pasm
+	$(ASSEMBLE) ook.pasm  ook.pbc
+
+clean:
+	$(RM_F) core *.pbc *~ foo.p*
diff -urbN parrot.old/config/gen/makefiles.pl parrot/config/gen/makefiles.pl
--- parrot.old/config/gen/makefiles.pl	2002-12-30 23:43:54.0 +0100
+++ parrot/config/gen/makefiles.pl	2002-12-30 23:25:02.0 +0100
@@ -31,6 +31,8 @@
   commentType = '#');
   genfile('config/gen/makefiles/befunge.in',   'languages/befunge/Makefile',
   commentType = '#');
+  genfile('config/gen/makefiles/ook.in',   'languages/ook/Makefile',
+  commentType = '#');
 }
 
 1;
diff -urbN parrot.old/languages/ook/Changes parrot/languages/ook/Changes
--- parrot.old/languages/ook/Changes	1970-01-01 01:00:00.0 +0100
+++ parrot/languages/ook/Changes	2002-12-30 23:55:01.0 +0100
@@ -0,0 +1,9 @@
+Revision history for a Ook! compiler written in Parrot and targeting Parrot.
+
+0.0.1 Mon Dec 30 23:46:32 CET 2002
+- thanks to a silly idea of Nicholas Clark, first draft of this
+  Ook! compiler written in Parrot.
+	- every Ook! instruction is implemented but the Ook. Ook!
+  one.
+- currently spitting Parrot assembly on stdout.
+
diff -urbN parrot.old/languages/ook/hello.ook parrot/languages/ook/hello.ook
--- parrot.old/languages/ook/hello.ook	1970-01-01 01:00:00.0 +0100
+++ parrot/languages/ook/hello.ook	2002-12-30 23:46:46.0 +0100
@@ -0,0 +1,20 @@
+Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
+Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
+Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
+Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
+Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
+Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
+Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook. Ook! Ook? Ook! Ook! Ook? Ook!
+Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook! Ook.
diff -urbN parrot.old/languages/ook/ook.pasm parrot/languages/ook/ook.pasm
--- parrot.old/languages/ook/ook.pasm	1970-01-01 01:00:00.0 +0100
+++ parrot/languages/ook/ook.pasm	

Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-30 Thread Nicholas Clark
On Mon, Dec 30, 2002 at 11:09:07PM +, Jerome Quelin wrote:
 Ok, about this implementation:
  - this is a compiler (and not an interpreter) that spits Parrot 
 assembly code (yes, I'm targeting Parrot).
  - it implements every Ook! instruction but the Ook. Ook! one. I'll 
 work on it later.
  - currently I'm just printing on stdout the resulting parrot code, I 
 lack an eval instruction in Parrot. Dan, Leo? :-)

Because what I said I'd really like (apart from moon on a stick,
a new apocalypse (and a pony, which Jerome had to remind me about))
would be a compiler that reads in Ook!, creates parrot bytecode on the fly,
and then calls it, without using temporary files.

 Disclaimer: it's all of Nicholas Clark's fault. Really. He's the one to 
 take the blame for it.

Indeed. However, when I tried compiling my Ook! test program:

Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook? Ook. Ook? Ook.
Ook! Ook! Ook? Ook! Ook. Ook? Ook! Ook? Ook. Ook? Ook! Ook? Ook. Ook?
Ook. Ook. Ook. Ook? Ook. Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook!
Ook. Ook? Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook!
Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook?
Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook? Ook.
Ook! Ook! Ook? Ook! Ook. Ook? Ook! Ook! Ook! Ook! Ook! Ook! Ook? Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook. Ook. Ook? Ook. Ook? Ook! Ook. Ook! Ook. Ook? Ook. Ook? Ook.
Ook! Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook! Ook? Ook. Ook?
Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook? Ook. Ook? Ook.
Ook! Ook! Ook? Ook! Ook. Ook? Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook?
Ook. Ook? Ook. Ook? Ook! Ook! Ook! Ook? Ook? Ook. Ook. Ook. Ook? Ook.
Ook? Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook! Ook? Ook!
Ook? Ook. Ook! Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook.
Ook. Ook. Ook? Ook. Ook? Ook. Ook! Ook? Ook. Ook? Ook! Ook? Ook. Ook?
Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook? Ook. Ook? Ook.
Ook! Ook! Ook? Ook! Ook. Ook? Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook?
Ook. Ook? Ook. Ook? Ook! Ook? Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook? Ook.
Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook! Ook. Ook? Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook.

I got this:

Label KOO1_2 already exists at ../../assemble.pl line 557.

(admittedly from a pre-built parrot that is about 2 weeks old)

Nicholas Clark



Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-30 Thread Nicholas Clark
On Mon, Dec 30, 2002 at 11:45:19PM +, Nicholas Clark wrote:

 Indeed. However, when I tried compiling my Ook! test program:

 I got this:
 
 Label KOO1_2 already exists at ../../assemble.pl line 557.
 
 (admittedly from a pre-built parrot that is about 2 weeks old)

Also on a clean checkout I've just built

Admittedly my program may not be portable Ook! as it does assume that
cells wrap round from 255 to 0
The original brainfuck version worked fine on Leon's interpreter.
(I find Ook! too hard - I'm just another brainfuck monkey)

Nicholas Clark



Re: [perl #19610] [PATCH] New language support: Ook!

2002-12-30 Thread Leopold Toetsch
Jerome Quelin (via RT) wrote:


# New Ticket Created by  Jerome Quelin 
# Please include the string:  [perl #19610]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt2/Ticket/Display.html?id=19610 


 - currently I'm just printing on stdout the resulting parrot code, I 
lack an eval instruction in Parrot. Dan, Leo? :-)


Here is the solution of our perl6 bootstrapping problem, I'll make an Ieval ops ...



+Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
+Ook. Ook. Ook. Ook. Ook! Ook? 


... and you have only to reimplement P6C - Ook!

leo - is it 1:30 here or do I have already 5 beers or both ;-)