Tenko New JavaScript Parser Launched
Written by Kay Ewbank   
Tuesday, 10 March 2020

A new JavaScript parser has been developed that supports parsing for versions from ES6 to ES2020 syntax and language features. The developer describes it as "pixel perfect" and 100 percent spec compliant.

Tenko has been developed by Peter van der Zee, an ex-Facebook developer who worked on Infra JS. He chose the name Tenko for the project because it's an anagram of Token, and in Japanese it's a divine beast  - the heavenly fox.

JSlogo

More practically, Tenko supports anything stage 4 up to ES11 / ES2020, as well as deep Regex syntax. It supports a variety of parsing modes, from strict and module to sloppy / non-strict, as well as web compatible/AnnexB.

comes with optional (but enabled by default) support for abstract syntax trees (AST). The default AST that is enabled is Estree, but there's also support for Acorn and any stage 4 Babel except for comments. Van der Zee says Optional chaining AST works but AST spec seems to be still in flux. The AST supports location data, matching Acorn or Babel for reference.

You can set up a no-AST build that the developer says will validate JavaScript almost as perfectly as the regular build except for certain validation cases where it requires the AST. Specifically, these are a binary op afterarrow with block body; regular expressions on a new line after arrow with block body; an update operator anything that's writable but not a valid var or member expression; and delete with an ident that is wrapped in parentheses. 

Tenko comes with 33,000 input syntax tests, and passes the March 2020 ES test262 suite. It has a web-based REPL that can display the output in the parsing modes mentioned earlier (strict, module, sloppy, web compatible, and ES versions6 to 11. The REPL can only run in browsers that have with native support for ES module loading.

It's worth noting that while Tenko is open source, the developers haven't decided on an open-source license, so couldn't be recommended for any production projects. 

JSlogo

 

More Information

Tenko On GitHub

Related Articles

V8 JavaScript Engine Reduces Heap Size

Babel Adds Ability To Parse F# Like Pipelines

Google JavaScript Engine Speeds JSON Parsing

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook or Linkedin.

Banner


Google Quietly Kills Android Things
23/12/2020

Google is well known for killing projects that we all know, love and rely on, but in the case of Android Things I'm not shedding a tear. An ill-conceived project from the start, but still - so little  [ ... ]



BlocklySQL - Visual SQL Programming
14/01/2021

BlocklySQL is a block-based, visual programming tool like Scratch but for SQL. It is the outcome of academic research at the University of Würzburg on the kind of errors that students who a [ ... ]


More News

{laodposition comment}

Last Updated ( Tuesday, 10 March 2020 )