binjs-ref
kataw
Our great sponsors
binjs-ref | kataw | |
---|---|---|
1 | 19 | |
424 | 328 | |
0.0% | 0.0% | |
0.0 | 0.0 | |
almost 3 years ago | about 1 year ago | |
Rust | TypeScript | |
GNU General Public License v3.0 or later | ISC License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
binjs-ref
-
Python is in the browser. No idea if this will lead to chaos or harmony...
There was a proposal a little while back for BinAST which gets you some of the same benefits as bytecode, but not all... mainly just reducing the parse time and maybe even allowing more pipelined evaluation. See https://github.com/binast/binjs-ref
kataw
-
We've been lied to: JavaScript is very fast
It then builds on the assumption that all of Javascript performance scales linearly based on the results of that fishy benchmark. Never mind that in C you can stack allocate, or use arena allocators, or use a million of other tricks, where in JS, once you write {}, you got a heap allocation that you don't have any control over (and if you think this doesn't matter, this is one of the reasons why esbuild is so much faster than babel, or heck even kataw, the fastest JS parsing toolkit I'm aware of).
-
Rome will be written in Rust
esbuild is the current darling leading the pack, but there are also various other projects in the space (swc[0] is written in Rust, fjb[1] is written in C, bun[2] is written in zig, leveraging JavascriptCore's engine).
The most significant performance-oriented effort in this space still leveraging JS that I know of is kataw[3], and while that's quite fast compared to babel, it's still within an order of magnitude from babel. Kataw itself is a CST-based implementation that was created to outperform seafox (a AST-based parser by the same developer).
Babel gained popularity due to the crazy amount of churn in grammar over the past few years, but more and more I think the dust is settling, and flexibility is no longer the name of the game, making an AST-based implementation less appealing. The Rome team must be feeling the heat if the data structure design choices are being informed by performance. I highly doubt someone will be able to compete in performance using a JS implementation in today's landscape.
[0] https://github.com/swc-project/swc
[1] https://github.com/sebbekarlsson/fjb
[2] https://bun.sh/
[3] https://github.com/kataw/kataw
-
An 100% spec compliant ES2022 Javascript toolchain
Kataw is a *work in progress* javascript toolchain with high focus on performance, and it's main goal is to unify functionality that has previously been separate tools. It's core is an ECMAScript friendly CST that allows you to parse `ECMAScript® 2022 (ECMA-262 12th Edition) language specification`. Each CST node contains several properties, and the `flags` property contains the CST info. The CST info can be extracted from the CST node through public API methods. Click [here](https://github.com/kataw/kataw/tree/main/src/parser#public-api-methods-to-extract-info-from-cst-nodes) for a complete list over all the public API methods. Many of these APIs have the advantage that they allow you to "retrieve" info that is not otherwise available with a standard AST parser. One example is that you only need to use `kataw.isStatementNode` to find out if the current CST node is a statement node. With an AST parser you must use a `switch statement` with 60 `switch cases`. Another example is how easy it is to find out if a keyword node contains an `escaped keyword`. You only need to use `kataw.hasUnicodeEscape`. You can narrow this down further if you use `kataw.isChildLess`. A keyword doesn't have any child nodes. A third benefit with this CST parser is that it is running in `recovery mode` by `default` and can be used in any editor. A build-in diagnostic system reports diagnostics if an `error handler` have been used. The diagnostics are dynamic. It means all the diagnostics are informative, and they will will change based on the context you are parsing in. The diagnostics have been designed like this so you can quickly understand what the problem is and correct it. These features used together gives you more options to adjust, modify and customize the CST tree compared to a regular AST parser and you can also write fewer code lines and at the same time experience insane performance.
- About An 100% spec compliant ES2022 Javascript toolchain
- Kataw - An 100% spec compliant ES2022 Javascript toolchain
- ECMAScript2022 CST parser with error recovery and types
- JavaScript CST Parser
- ECMAScript2022 CST parser with error recovery
- kataw/kataw An insane fast Javascript toolchain.
What are some alternatives?
dukpy - Simple JavaScript interpreter for Python
esbuild - An extremely fast bundler for the web
esprima - ECMAScript parsing infrastructure for multipurpose analysis
estree - The ESTree Spec
jsonpath - JsonPath engine written in Rust. Webassembly and Javascript support too
swc - Rust-based platform for the Web
hex - A user-friendly re-implementation of existing hex tools in Rust
fjb - fast javascript bundler :package:
pyodide - Pyodide is a Python distribution for the browser and Node.js based on WebAssembly
cli - CLI for swc
Node-Estree - Complete and compliant ESTree spec implementation in TypeScript