Open tshemsedinov opened 8 years ago
On site of one of ast-parsers there is ability to run test which parses JQuery, Angular and React libraries by different libraries. Speed test Triple test results: Test 1 Test 2 Test 3 Esprima, Acorn and Shift are much faster than others. Shift is the fastest. But I have found more links to Esprima in forums for some reason.
Developers answer that that do not want to give API to AST. Answer 1 Answer 2 Main causes about this:
On other hand SpiderMonkey has the parser API: Parser API documentation So it is real and it can be implemented if rewrite V8... But now it is better to use third-party libraries for parsing AST.
For interest of @metarhia/angeli Now we have query language as simple as JavaScript, example:
I also made an example of dynamic prototype building from metadata for positioning array processing as if they were objects in JSTP: https://github.com/metarhia/JSQL/blob/master/Examples/filterArray.js
Usage of this query is quite simple
var res = data.filter(query);
But we need indexing, sharding and distributed execution in GlobalStorage, so I think we need to parse query into AST or get AST from V8 to programmatically analyze query structure before execution to find indexes for example or to separate execution into multiple servers. @DzyubSpirit may prepare some research, maybe @aqrln and @lundibundi or somebody from @metarhia/angeli may help.