APM: Brain popups (Perl 6 from last time)

Thomas L. Shinnick tshinnic at io.com
Mon Feb 16 18:58:13 PST 2009


Re: the Parrot register-based architecture...

Since I'm currently interested in things Javascript I noticed a 
mention of Opera working on their Javascript engine...
   Opera revs JavaScript engine of the future
   http://www.theregister.co.uk/2009/02/05/new_opera_java_script_engine/

Of course, nowadays everyone's working on faster JS engines, Mozilla, 
Google, Opera, and probably even Microsoft, but these paragraphs 
caught my eye:
Opera's core-technology team has overhauled their JavaScript - er, 
ECMAScript - engine in three distinct ways. For one, they've switched 
from a stack-based bytecode instruction set to a register-based set. 
Rather than using a single stack of values, Carakan stores values in 
fixed registers accessible by any instruction.
Since there's no need to copy values to and from the top of a stack, 
fewer instructions are executed and less data is copied, Bolstad explains.
And that prompted me to think about the other groups' extensive work 
towards moving to native code.  That necessarily means they get 
registers... and indeed that is a major differentiation (at least in 
their minds) between Mozilla and Google - how well they manage their slots.



Re: :dba

People looking at the Perl 6 regular expressions in Std.pm noticed 
the strange annotations embedded in the rules, e.g.
      :dba('yadayada')
I found the explanation while reading the "Regexes and Rules" 
synopsis 5, http://perlcabal.org/syn/S05.html  :
By default the error message uses the name of the current rule as an 
indicator of the abstract goal of the parser at that point. However, 
often this is not terribly informative, especially when rules are 
named according to an internal scheme that will not make sense to the 
user. The :dba("doing business as") adverb may be used to set up a 
more informative name for what the following code is trying to parse:

     token postfix:sym<[ ]> {

         :dba('array subscript')

         '[' ~ ']' <expression>

     }

Then instead of getting a message like:

     Unable to parse expression in postfix:sym<[ ]>; couldn't find final ']'

you'll get a message like:

     Unable to parse expression in array subscript; couldn't find final ']'

(The :dba adverb may also be used to give names to alternations and 
alternatives, which helps the lexer give better error messages.)

So once again the beauty and purity of code is polluted through 
catering to users....  as if they weren't so ungrateful anyway!  ;-)

Tom


-- 
I'm a pessimist about probabilities; I'm an optimist about possibilities.
     Lewis Mumford  (1895-1990)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/austin/attachments/20090216/06d27cd5/attachment.html>


More information about the Austin mailing list