← Blog

Cruft Alpha Released

The first release of Cruft is here. Cruft is a JavaScript ecosystem stack: a highly conformant engine, a runtime that runs roughly 90% of npm in a tiny footprint, and a fully owned internal stack, all in a binary of about fifty megabytes.

We are very excited to release the first version of Cruft.

Cruft is a JavaScript ecosystem stack. What does that mean? Quite a few things, and it would be difficult to explain all of them in a single blog post, so this one will not try. What is safe to say is this.

Cruft is, at once, a JavaScript engine. At the time of this writing, it is the most conformant JavaScript engine in the world as measured against test262. Cruft passes over 99% of the test262 suite, and the tests it does fail, it fails largely because the engine is currently slow rather than because it is wrong. Try it for yourself. (More on that later.)

Cruft also includes a host layer (this is usually called a runtime). That runtime does a great deal of work, and it does it in a remarkably small size. In our internal testing, the Cruft host layer runs roughly 90% of all npm packages, a figure that includes the great majority of the two thousand most popular packages on npm. (More on that later.)

Cruft also implements its entire internal stack. Rather than reaching for the third-party libraries that most runtimes depend on, it ships first-party implementations of TLS, HTTP/1 and HTTP/2, a SQL engine, WebCrypto, X.509 certificates, compression, and the Unicode tables, among others. This means Cruft is unburdened by the dependencies that are normative for a project of this scale. It also makes Cruft unusually small on disk. The whole binary is about fifty megabytes, and that fifty megabytes includes the JavaScript engine, the JavaScript runtime, working implementations of SQLite and PostgreSQL, and a sound typed language called CruftScript. (More on that later.)

Getting started

Installing Cruft is a single command, with no toolchain to set up:

npm install -g cruftjs

Where Cruft stands

Cruft is currently in alpha, and it should not be used in production, though this site runs on Cruft without any issue. (Do as we say, not as we do? ¯\_(ツ)_/¯) APIs will move, and releases will be frequent. This release is version 0.0.10. The first publish, 0.0.9, shipped with a packaging defect that broke the binary's file permissions on install, so it has been deprecated in favor of 0.0.10. Because the two share the same engine binary, cruft --version still reports 0.0.9 on a correct 0.0.10 install; your copy is current if npm ls -g cruftjs reports 0.0.10. The full history lives on the releases page.

There is a great deal more to say about each of these pieces, and we will say it, one post at a time.