"even more scary is how lightning fast the exact same program is in javascript... "
@wcandillon
What are the numbers?
Gunther Rademacher's REX parser generator can target several languages including Javascript.
The Javascript output is designed for jrunscript. To see what it expects use the option:
Main program=simple
jrunscript did not work for me, nor did Rhino, probably due to my lack of familiarity with these tools.
I wanted to run using Node.js and this required a few changes to the javascript
The numbers:
@wcandillon
What are the numbers?
Gunther Rademacher's REX parser generator can target several languages including Javascript.
The Javascript output is designed for jrunscript. To see what it expects use the option:
Main program=simple
jrunscript did not work for me, nor did Rhino, probably due to my lack of familiarity with these tools.
I wanted to run using Node.js and this required a few changes to the javascript
- changing the
writeOutput
function to capture the result - setting the module exports
module.exports = xquery30
var Xq=require("./xq3.js");
var out=[];
var parser=new Xq("2+3",out);
parser.parse_XQuery();
console.log(out.join(""));
The numbers:
time node app.js
real 0m0.278s
user 0m0.212s
sys 0m0.020s
No doubt the c++ is faster. Perhaps the winner is EBNF.Github: xqparserperf
No comments:
Post a Comment