This is a tutorial on how to implement a TC39 proposal Array Grouping in the SpiderMonkey JavaScript engine. We explain here how to read the proposal specification and create the implementation which is compliant to the specification. The implementation will be mostly written in self-hosted JavaScript, with a tiny bit of C++.
This tutorial presents an implementation of the proposal as of October 2021. Though somewhat significant changes have been made to the proposal since then, the ideas and concepts presented in the current tutorial are still valid, and can be applied to implement other JavaScript proposals which deal with (simple) API changes.
This tutorial will give an introduction on how to:
- read the ECMA-262 language specification
- implement a TC39 proposal in SpiderMonkey
- test a TC39 proposal with the Test262 test suite
8. Test262
This tutorial can be taught as a university course. More details coming soon.
This tutorial is a result of a project originally implemented in Fall 2021 by Rolf Martin Glomsrud and Sigurd Setså within a project course at the University of Bergen, Norway, supervised by Yulia Startsev (Mozilla), Mikhail Barash (University of Bergen), and Noeska Smit (University of Bergen).
In Fall 2022, Rolf Martin Glomsrud (University of Bergen), together with Mikhail Barash (University of Bergen), have written this tutorial, and Daniel Liland (University of Bergen) has followed the tutorial to implement the feature and provided feedback on the tutorial structure and contents.
The tutorial can be cited as:
R. M. Glomsrud, D. Liland, M. Barash. Implementing a JavaScript feature in SpiderMonkey (a tutorial). 2022.
Do not hesitate to contact us, or leave a pull request, if you have any feedback, corrections, or other comments.