a curated list of database news from authoritative sources

September 22, 2021

September 21, 2021

Enumerating and analyzing 40+ non-V8 JavaScript implementations

V8 is, I'm sure, the most used implementation of JavaScript today. Used in Chrome, (and by extension) Microsoft Edge, Node.js, etc. Safari's JavaScriptCore and Firefox's SpiderMonkey are also contenders for extremely mainstream implementations.

But what else is out there? What if I want to embed JavaScript in a C program, or a Go program, or a Rust program, or a Java program(, and so on)? Or what if I want to run JavaScript on a microcontroller? Or use it as a base for language research? It turns out there are many high-quality implementations out there.

This post describes a number of them and their implementation choices. I'm not going to cover V8, JavaScriptCore, or SpiderMonkey because they are massive and hide multiple various interpreters and compilers inside. Plus, you already know about them.

I'm going to miss some implementations and get some details wrong. Please Tweet or email me with your corrections! I'd be particularly interested to hear about pure-research; and commercial, closed-source implementations of JavaScript.

Corporate-backed

These are implementations that would make sense to look into for your own commercial, production applications.

On the JVM

  • Oracle's GraalJS: compiles JavaScript to JVM bytecode or GraalVM
    • Support: Full compatibility with latest ECMAScript specification
    • Implementation language: Java
    • Runtime: GraalVM or stock JDK
    • Parser: Hand-written
    • First release: 2019?
    • Notes: Replaced Nashorn as the default JavaScript implementation in JDK.
  • Mozilla's Rhino: interprets and compiles JavaScript to JVM bytecode
  • Oracle's Nashorn: compiles JavaScript to JVM bytecode
    • Support: ES5
    • Implementation language: Java
    • Runtime: compiles to JVM bytecode
    • Parser: Hand-written
    • First release: 2012?
    • Notes: Replaced Rhino as default JavaScript implementation on JVM. Replaced by GraalJS more recently, but remains actively developed.

Embeddable

  • Nginx's njs
  • ChowJS: proprietary AOT compiler based on QuickJS for game developers
    • Support: everything QuickJS does presumably (see further down for QuickJS)
    • Implementation language: C presumably
    • Runtime: QuickJS's bytecode interpreter but also an AOT compiler
    • Parser: QuickJS's presumably
    • First release: 2021
    • Notes: Code is not available so exact analysis on these points is not possible at the moment.
  • Artifex's mujs

Embedded Systems

Other

I don't know whether to put Microsoft's ChakraCore into this list or the next. So I'll put it here but note that as of this year 2021, they are transitioning it to become a community-driven project.

Mature, community-driven

Implementations toward the top are more reliable and proven. Implementations toward the bottom less so.

If you are a looking to get involved in language development, the implementation further down on the list can be a great place to start since they typically need work in documentation, testing, and language features.

These last few are not toys but they are also more experimental or, in AssemblyScript's case, not JavaScript.

Research Implementations

Thanks to @smarr for contributing eJS, Higgs, and b9!

Notable Abandoned

Notable toy implementations

Great for inspiriration if you've never implemented a language before.

  • js-to-c: A JavaScript to C compiler, written in C
  • mjs: AST interpreter for not just ES5 or even ES3 but also ES1
  • gojis: AST interpreter in Go
  • tojs: Bytecode VM in Rust
  • v2: Bytecode VM in Go
  • SparrowJS: AST interpreter in C++
  • jsc: My own experiment compiling JavaScript to C++/libV8

September 17, 2021

September 13, 2021

September 10, 2021

Supabase Beta August 2021

Fundraising, Realtime Security, custom SMS templates, and deployments in South Korea.

September 07, 2021

Examining query plans in MySQL and Vitess

Originally posted at Andres's blog. Traditional query optimizing is mostly about two things: first, in which order and from where to access data, and then how to then combine it. You have probably seen the tree shapes execution plans that are produced from query planning. I’ll use an example from the MySQL docs, using FORMAT=TREE which was introduced in MySQL 8.0: mysql>EXPLAINFORMAT=TREE->SELECT*->FROMt1->JOINt2->ON(t1.c1=t2.c1ANDt1.c2<t2.c2)->JOINt3->ON(t2.c1=t3.c1)\G***************************1.row***************************EXPLAIN:->Innerhashjoin(t3.c1=t1.c1)(cost=1.05rows=1)->Tablescanont3(cost=0.35rows=1)->Hash->Filter:(t1.c2<t2.c2)(cost=0.70rows=1)->Innerhashjoin(t2.c1=t1.c1)(cost=0.70rows=1)->Tablescanont2(cost=0.35rows=1)->Hash->Tablescanont1(cost=0.35rows=1)Here we can see that the MySQL optimizer thinks the best plan is to start reading from t1 using a table scan.

September 02, 2021

MySQL LRU Flushing and I/O Capacity

InnoDB background LRU list flushing is not limited by innodb_io_capcity or innodb_io_capacity_max. I’ll prove it in this blog post, but since MySQL experts disagree (or don’t know for sure), I’d like you to prove me wrong. This is not an intro; you’ll need to know all the InnoDB details wrt page flushing.