Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
PIR compilers broken?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Will Coleda  
View profile  
 More options May 22 2005, 9:12 pm
Newsgroups: perl.perl6.internals
From: parrotbug-follo...@parrotcode.org (Will Coleda)
Date: Sun, 22 May 2005 18:12:01 -0700
Local: Sun, May 22 2005 9:12 pm
Subject: [perl #35944] PIR compilers broken?

# New Ticket Created by  Will Coleda
# Please include the string:  [perl #35944]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=35944 >

Leo's recent patches to <compile> seem to have improved the state of affairs, but I'm still having difficulty with tcl's <compile>r. The attached is a simplified version that exhibits the same problems I'm experiencing.

Attached find a test for <compile>rs written in PIR. (very simple compiler. takes a string and prints it out with a trailing newline.)

While I expect it to print "ok 1", it instead prints:

Null PMC access in invoke()
current instr.: 'main' pc 50 (compile.pir:8)

[ compile.pir < 1K ]
.sub main @MAIN
  register_compiler()

  .local pmc compiler, invokable
  compiler = compreg "PUTS"

  invokable = compile compiler, "ok 1"
  invokable()

.end

.sub register_compiler
  $P0 = find_global "puts"
  compreg "PUTS", $P0
.end

.sub puts
  .param string printme

  .local pmc pasm_compiler, retval
  pasm_compiler = compreg "PASM"

  .local string code

  code .= "print \""
  code .= printme
  code .= "\\n\"\n"

  retval = compile pasm_compiler, code

  .return (retval)
.end


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 23 2005, 3:54 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 23 May 2005 09:54:02 +0200
Local: Mon, May 23 2005 3:54 am
Subject: Re: [perl #35944] PIR compilers broken?
Will Coleda (via RT) wrote:

> While I expect it to print "ok 1", it instead prints:

> Null PMC access in invoke()
> current instr.: 'main' pc 50 (compile.pir:8)

W/o testing it I'd say that ...

>   code .= "print \""
>   code .= printme
>   code .= "\\n\"\n"

... a single print statement isn't a subroutine, so it has to fail.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Glencross  
View profile  
 More options May 23 2005, 6:26 am
Newsgroups: perl.perl6.internals
From: ni...@glencros.demon.co.uk (Nick Glencross)
Date: Mon, 23 May 2005 11:26:24 +0100
Local: Mon, May 23 2005 6:26 am
Subject: Re: [perl #35944] PIR compilers broken?

Will Coleda wrote:
>   .local string code

>   code .= "print \""
>   code .= printme
>   code .= "\\n\"\n"

This may be related, but your first .= is acting upon an uninitialised
variable.

Nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Glencross  
View profile  
 More options May 23 2005, 8:11 am
Newsgroups: perl.perl6.internals
From: ni...@glencros.demon.co.uk (Nick Glencross)
Date: Mon, 23 May 2005 13:11:50 +0100
Local: Mon, May 23 2005 8:11 am
Subject: Re: [perl #35944] PIR compilers broken?

Nick Glencross wrote:
> Will Coleda wrote:

>>   .local string code

>>   code .= "print \""
>>   code .= printme
>>   code .= "\\n\"\n"

> This may be related, but your first .= is acting upon an uninitialised
> variable.

Actually, the code dies before this. Worth fixing as you may get hit by
a Heisenbug at some point, as in:

.sub main
         S30 = "Garbage"

         .local string code
         code .= "Hello\n"

         print code
.end

(of course this problem may have only been introduced in the example
snippet that you've created)

Cheers,

Nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will Coleda  
View profile  
 More options May 23 2005, 8:34 am
Newsgroups: perl.perl6.internals
From: w...@coleda.com (Will Coleda)
Date: Mon, 23 May 2005 08:34:38 -0400
Local: Mon, May 23 2005 8:34 am
Subject: Re: PIR compilers broken?

Fixed the uninitialized string error Nick pointed out, but as he noted, it
has no effect on the error.

Leopold Toetsch writes:
> Will Coleda (via RT) wrote:

>> While I expect it to print "ok 1", it instead prints:

>> Null PMC access in invoke()
>> current instr.: 'main' pc 50 (compile.pir:8)

> W/o testing it I'd say that ...

>>   code .= "print \""
>>   code .= printme
>>   code .= "\\n\"\n"

> ... a single print statement isn't a subroutine, so it has to fail.

But this is the PASM compiler, not the PIR compiler - Attached find the
slightly more complicated example using a PIR sub instead of a PASM snippet
which dies in exactly the same fashion. (Which is to say, as the invokable
is invoked with <invokecc>). I even insure that the anonymous sub is not
reused by dynamically creating a .sub name, though for this particular
example it's irrelevant.

(Note: the subject "PIR compilers" was referring to "compilers written in
PIR", as opposed to the compilers written in C. (as opposed to being opposed
to the PASM compiler.))

  compile2.pir
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »