Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

An Epiphony

by Logicus
on Jul 31, 2011 at 22:43 UTC ( #917733=offtopicroot: print w/ replies, xml ) Need Help??

This posting has been designated as off-topic for the PerlMonks web site. Please do not respond to it.

I've had an epiphony.

I am one lazy son of a b****, and I've been relying on the sheer amount of processing power available and some dodgy excuses about a particular problem to avoid doing what I ought to be doing with aXML.

And no, I don't mean scrapping it...

Right, heres what I'm going to do, (well what I've already started doing tbh),

First off, aXML cannot encode anything which is not also encodable with standard XML, using extra verbosity. Well that is not entirely true but it's nearly true, I can think of a particular case of valid aXML which cannot be encoded in XML, but for the purposes of making aXML work with the stone-age classical computers we are still working with I'm going to just let that one slide... for now.

I'm reminded of the days when we used to draw polygons line by line, using word writes instead of single bytes because it doubled the rendering speed, calculating the shading values using fixed point maths to avoid using floats which were too slow... moores law eventually gave us the ability to draw millions of polygons with 64bit accuracy, and it will eventually deliver processors which will run the the full standard of aXML rather than the slightly cut down version aXML2 will be using.

But I digress...

Basically I'm planning on writing a compiler which takes aXML files, translates them to XML, slurps that XML up using something like XML::Simple, then dumps the structure out into a code generated module file, thus saving that step next time. Couple that with a system which takes the simple module logic and also writes out a perl module wrapper, and then the actions and the plugins will all be compiled leaving only the small overhead of processing the saved structure at runtime.

Combined with ModPerl::Registry, and using non-OO, code for instance my QD module (which is about 2x faster than CGI ->param as it stands) and aXML2 is going to be fasssst.

How fast I don't know yet, but I'm hoping to have a working version available quite soon. (I'm a devil of a coder when I have an idea I'm excited about).

It's just a shame there is no way to compile this (the special case):

<<a>b</a>>c</<a>b</a>>

Or maybe there is, but I can't think of one!

Comment on An Epiphony
Download Code
Re: An Epiphony
by dreadpiratepeter (Priest) on Aug 01, 2011 at 00:33 UTC
    Apparently your "epiphony" wasn't how to correctly spell epiphany


    -pete
    "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."
      I didn't expect you'd have anything cordial or useful to say, infact the moment I saw your name on the link I braced myself for another load of your, how shall we call it, sweet nothings?

      I bet it's not a misspelling. See phony.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

      You!! it's you that's been trolling me... well your existence as a distinct entity separate from the crowd is well and truly noted now my little pirate friend.
Re: An Epiphony
by Anonymous Monk on Aug 01, 2011 at 00:37 UTC

    It's just a shame there is no way to compile this (the special case)

    Nice try, no-one is falling for it again

      No one fell for anything last time... that construct is a real pain in the arse, but useful in certain circumstances... It has a meaning and it is valid aXML, but I just can't quite find a way to express it's structure in either standard XML, perl hashrefs/tables or any other existing structure that I am aware of.

      I guess you could term it something like an anonymous node, as in you cannot know prior to runtime what the name of the node is, only that it exists and is defined by the result of computing its constituent nodes, and that really screws up every method I have tried on the problem so far.

        I don't get why you have an intermediate XML phase; seems like it offers nothing beyond what a custom parse tree would except a lot of pain and headache. FWIW, Template Toolkit has had good success with "compiling" templates to perl subs, then caching those subs (in memory, not on disk).
        --
        A math joke: r = | |csc(θ)|+|sec(θ)|-||csc(θ)|-|sec(θ)|| |
        Online Fortune Cookie Search

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-10-01 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (40 votes), past polls