|
| 1 | +# Differences with bellard/quickjs |
| 2 | + |
| 3 | +This project aims to be a drop-in replacement for those already using QuickJS. |
| 4 | +Minimal API changes might be necessary. |
| 5 | + |
| 6 | +## Community development |
| 7 | + |
| 8 | +NG is developed in the open, interacting with the wider community and through |
| 9 | +these interactions many improvements have already been made, including the incorporation |
| 10 | +of patches previously maintained in other forks. |
| 11 | + |
| 12 | +Each PR is reviewed, iterated on, and merged in GitHub. |
| 13 | + |
| 14 | +To date, NG has had over 40 distinct contributors and over 400 PRs. |
| 15 | + |
| 16 | +## Consistent release cadence |
| 17 | + |
| 18 | +As the project moves forward, a steady cadence of releases has been maintained, with an |
| 19 | +average of a new release every 2 months. |
| 20 | + |
| 21 | +## Testing |
| 22 | + |
| 23 | +Since its inception testing has been a focus. Each PR is tested in over 50 configurations, |
| 24 | +involving different operating systems, build types and sanitizers. |
| 25 | + |
| 26 | +The `test262` suite is also ran for every change. |
| 27 | + |
| 28 | +## Cross-platform support |
| 29 | + |
| 30 | +In order to better support other platforms such as Windows the build system was |
| 31 | +changed to use [CMake]. |
| 32 | + |
| 33 | +In addition, Windows is treated as a first class citizen, with the addition of support |
| 34 | +for the MSVC compiler. |
| 35 | + |
| 36 | +[CMake]: https://cmake.org/ |
| 37 | + |
| 38 | +## Performance |
| 39 | + |
| 40 | +While being an interpreter limits the performance in comparison with other engines which |
| 41 | +use a JIT, several significant performance improvements have been made: |
| 42 | + |
| 43 | +- Opcode fusion |
| 44 | +- Polymorphic inline caching |
| 45 | +- Memory allocation improvements |
| 46 | +- Improved parse speeds |
| 47 | + |
| 48 | +## New ECMAScript APIs |
| 49 | + |
| 50 | +The main focus of NG is to deliver state-of-the-art JavaScript features. Typically once they |
| 51 | +are stable (stage 4) but sometimes even at earlier stages. Here is a non-exhaustive list |
| 52 | +of ES features present in NG: |
| 53 | + |
| 54 | +- Resizable ArrayBuffer |
| 55 | +- Float16Array |
| 56 | +- WeakRef |
| 57 | +- FinalizationRegistry |
| 58 | +- Iterator Helpers |
| 59 | +- Promise.try |
| 60 | +- Error.isError |
| 61 | +- Set operations |
| 62 | + |
| 63 | +Some non-standard but widely used APIs have also been added: |
| 64 | + |
| 65 | +- V8's `Error.prepareStackTrace` and `Error.stackTraceLimit` |
0 commit comments