diff --git a/_includes/header.html b/_includes/header.html index 56274cf2..30c51dbd 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -66,7 +66,9 @@
+ About | Benchmarks | + Conformance | Playground | Docs
diff --git a/_posts/2021-01-14-boa-release-11.md b/_posts/2021-01-14-boa-release-11.md new file mode 100644 index 00000000..1a3556f1 --- /dev/null +++ b/_posts/2021-01-14-boa-release-11.md @@ -0,0 +1,86 @@ +--- +layout: post +title: "Boa release v0.11" +author: Boa Developers +--- + +Boa has reached a new release. v0.11, our biggest one yet! + +Since v0.10 we've closed 77 issues and merged 129 pull requests. The engine has been faster and more compliant to the spec. Below are some of the highlights but please see the [changelog](https://github.com/boa-dev/boa/blob/master/CHANGELOG.md#0110-2021-01-14) for more information. + +What is Boa? See the [About](/about) page for more info. + +## Test 262 + +Test262 is the implementation conformance test suite maintained by TC39. It's used by nearly all engines to measure how conformant they are to the specification. Boa pulls the tests in-tree and runs them against all PRs. You can find more about Test262 [here](https://github.com/tc39/test262). + +Since v0.10 we have almost doubled on spec conformance, and reduced panics. A year ago Boa didn't even track itself against Test262 so it was difficult to know how compliant we were to the spec, today not only do we track all changes against Test262 but we can see progress on a PR to PR basis. + + + + +Previously many tests failed to run as the test-runner was still being worked on. Those issues have been fixed and our tests jumped from 38k to 78K which is why the graph flips up above. Boa should never panic, however we've had many tests reveal areas where panics happen, this has helped us identify and apply correct fixes, to the point where our panics have gone from hundreds to under 50 (the graph above shows the dark red diminishing). + +For live tracking of conformance tests you can check [here](https://boa-dev.github.io/boa/test262/). Below is a snapshot of the previous version and today. + +
+

v0.10:

  • Total tests: 38,706
  • Passed tests: 6,960
  • Ignored tests: 5,748
  • Failed tests: 25,998
  • Conformance: 17.98%
+

v0.11:

  • Total tests: 78,497
  • Passed tests: 24,550
  • Ignored tests: 15,585
  • Failed tests: 38,362 (24 ⚠)
  • Conformance: 31.28%
+ +
+ +## Regress + +In this release Boa switched from its own implementation (wrapping `regex`) to the [`regress`](https://github.com/ridiculousfish/regress) engine for regular expressions. Regress is a crate aiming to implement ECMAScript compliant regular expressions and Boa makes use of (and contributes back to) that. + +While Regress is not 100% spec compliant this is something which is being worked on, also the switch gave us quite a performance boost in our [benchmarks](https://boa-dev.github.io/boa/dev/bench/) we're seeing almost 6X faster execution. + + + + +The above image shows a big drop in the middle of the graph, above `fb1b8d5` is where we switched over. Conformance went from 19.01% to 18.99% and introduced some panics, however many of those have since been fixed. + +## Iterating over bytes + +Previously the lexer iterated over unicode chars (u32 code points), this wasn't strictly neccesary for Boa and we have instead changed the lexer to work over bytes (u8). Iterating over bytes rather than chars is inherently much faster, non-ascii UTF8 bytes are all >=128, and we might only really care about those being correct when parsing idents. This is standard practise amongs lexical analyzers and even browsers read source code byte-by-byte, using the rules of the language's syntax to convert the source text into tokens. + +This was worked on by @jevancc and his [changes](https://github.com/boa-dev/boa/pull/915/files) have improved performance overall. + +## Embedding examples + +We are still working on what the public API should look like, some of these decisions are driven by feedback and the ever-changing way which Boa works. +Not only you can run Boa against javascript today you can also embed your own objects and classes into the engine before it's ran. + +We've offered an [example](https://github.com/boa-dev/boa/blob/master/boa/examples/classes.rs) to show how a class can be constructed in Rust then added to the environment before executing your scripts. +This should offer a great insight into how you can interop Rust with JavaScript by using Boa. + +Below are some of the more recent functions available from the Context object for you to add your own functionality. + +```rs +// Rust implementation of a function injected into the environment +Context::register_global_function(), +// Rust implementation of a class injected into the environment +Context::register_global_class(), +// Rust implementation of a property injected into the environment +Context::register_global_property() +``` + +If there are any examples you would like added, please raise an issue on the main repository. + +## Generating bytecode + +Today Boa walks the tree of the AST, although easy to implement it's not ideal for performance. +We are loooking to do code generation which can then be interpreted. This gradual process may happen over many releases until at some point we can switch implementations under the hood. Our steps are: + +- ~~Experiment with VM Path on isolated branch~~ +- ~~Experiment with generating more simpler instructions~~ +- Build up parity with current implementation +- Run test suite over VM path including conformance tests +- Switch over once performance is steady +- Optimize code generation and intreperter + +## Thank You + +Everything in this release has been such a huge effort, we want to thank all the [contributors](https://github.com/boa-dev/boa/graphs/contributors?from=2020-10-02&to=2021-01-12&type=c) in this release, whether it was features, fixes or raising bugs. + +If you're interested in contributing to Boa, we have some ["good first issues"](https://github.com/boa-dev/boa/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and ["issues where help is wanted"](https://github.com/boa-dev/boa/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). diff --git a/_sass/_layout.scss b/_sass/_layout.scss index 3afbb14b..536b0357 100644 --- a/_sass/_layout.scss +++ b/_sass/_layout.scss @@ -11,6 +11,13 @@ position: relative; } + img.dark { + display: none; + } + img.light { + display: block; + } + #site-logo { width: 48px; height: 48px; @@ -383,6 +390,13 @@ position: relative; } + img.light { + display: none; + } + img.dark { + display: block; + } + #site-logo { width: 48px; height: 48px; diff --git a/about.html b/about.html new file mode 100644 index 00000000..5e060dea --- /dev/null +++ b/about.html @@ -0,0 +1,18 @@ +--- +layout: default +--- + +
+

About

+

+ Boa is an experimental Javascript lexer, parser and compiler written in Rust. Currently, it has support for some of the language. It can be embedded in Rust projects fairly easily and also used from the command line. +Boa also exists to serve as a Rust implementation of the EcmaScript specification, there will be areas where we can utilise Rust and its fantastic ecosystem to make a fast, concurrent and safe engine. +

+ +

Boa was introduced at JSConf EU 2019 by Jason Williams

+

You can learn more in the video below

+ + +

subscribe via RSS

+ +
diff --git a/images/2021-01-14/conformance_dark.png b/images/2021-01-14/conformance_dark.png new file mode 100644 index 00000000..09213bb7 Binary files /dev/null and b/images/2021-01-14/conformance_dark.png differ diff --git a/images/2021-01-14/conformance_light.png b/images/2021-01-14/conformance_light.png new file mode 100644 index 00000000..8d15bf48 Binary files /dev/null and b/images/2021-01-14/conformance_light.png differ diff --git a/images/2021-01-14/regex-bench-dark.png b/images/2021-01-14/regex-bench-dark.png new file mode 100644 index 00000000..757d50fc Binary files /dev/null and b/images/2021-01-14/regex-bench-dark.png differ diff --git a/images/2021-01-14/regex-bench-white.png b/images/2021-01-14/regex-bench-white.png new file mode 100644 index 00000000..10680f2e Binary files /dev/null and b/images/2021-01-14/regex-bench-white.png differ