jerryscript
Duktape

jerryscript | Duktape | |
---|---|---|
16 | 10 | |
7,130 | 5,995 | |
1.4% | 0.4% | |
8.2 | 6.4 | |
about 2 months ago | 11 months ago | |
C | JavaScript | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
jerryscript
-
State of JavaScript 2024 Results, GitHub Copilot Now Free, EPIC Developer Tools, and more
The State of JavaScript 2024 survey results GitHub Copilot is now Free Tailwind CSS 4 JerryScript 3.0 Transformers.js v3.2 Bun 1.1.39 & 1.1.40 pnpm Update ESLint v9.17.0
-
Hyperlight: Virtual machine-based security for functions at scale
I believe the team has a working build of JerryScript [1] to test out the C bindings, but I’m not sure that will be released.
My understanding is that work on the Wasmtime VM guest is ongoing, which will enable Hyperlight to run the SterlingMonkey engine [2]. This is a WebAssembly build of Firefox’s SpiderMonkey engine which was donated by Fastly to the Bytecode Alliance.
That said though; I agree it would be great to see runtimes like V8 and JSC run directly on Hyperlight. There are good reasons why people might prefer those over StarlingMonkey (compat comes to mind), and it would be neat to see how much faster they could start compared to conventional VM deployments.
[1]: https://jerryscript.net/
-
A list of JavaScript engines, runtimes, interpreters
JerryScript
-
JavaScript Runtime and Code Lifecycle
Some IoT platforms use Duktape and JerryScript as their engines.
-
DeviceScript: TypeScript for Tiny IoT Devices
I've been having a lot of fun with https://kalumajs.org/ recently for silly JS embedded things. It's been great so far, and has a cool little community!
It's a runtime built on top of JerryScript, which has been pretty neat to look into as well: https://jerryscript.net/
-
Good example open source C++ embedded projects
Jerryscript came to mind : https://github.com/jerryscript-project/jerryscript
- Arduino Announces MicroPython Support
-
JavaScript embedded inside Elixir
I personally quite like JerryScript
-
Kaluma - tiny JavaScript runtime for microcontrollers - includes a browser-based IDE that can communicate with a Raspberry Pi Pico and other RP2040 boards via Web Serial API. Write code in the browser (in JavaScript), then copy and run it on the board with a click of a button.
Based on JerryScript, the creators also provide an IDE and serial communication tool on their website. There's also ample documentation and guides. Looking forward to getting more into this.
-
TypeScript is the Only Programming Language you Need: TypeScript Everywhere
I hear you loud and clear.
Duktape
- Roll your own JavaScript runtime, pt. 3
-
How to Create a Modern C Project with CMake and Conan
Im my projects I search for single file libs.(like https://github.com/svaarala/duktape etc...)
-
Is there anyway to bypass the limit of rand()?
Use lrand48(), or better, implement a high-quality RNG like PCG or splitmix64.
-
Libgrapheme: A simple freestanding C99 library for Unicode
You can also refer to the Unicode routines of other small JS engines[1,2], those don’t use ICU either, although the implementations are mercilessly size-optimized (to put it politely) and restricted to what the target JS version requires (e.g. casemapping but no normalization).
[1] https://github.com/bellard/quickjs/blob/master/libunicode.c
[2] https://github.com/svaarala/duktape/blob/master/src-input/du...
- Duktape
- Nan Boxing
-
YouTube-dl has a JavaScript interpreter written in 870 lines of Python
I was expecting this to be about Duktape <https://github.com/svaarala/duktape>, but heh, for sure no. I'd bet $1 there's no way youtube-dl would switch, but I wonder if yt-dlp would?
-
Optimizations Enabled by -ffast-Math
Fast math optimizations can break code like this by breaking isNaN.
I was porting a C++ project to a certain platform - and that platform enabled a -ffast-math equivalent by default in Release (but not Debug) builds! This broke duktape, a JS engine said project embedded, in some nasty and subtle ways. Instead of storing a number/pointer/??? (8 bytes) + type tag (4? bytes) for each dynamically typed JS value, duktape can bit-pack values into a single 8 byte "double" value by storing object/string handles as NaN values - this isn't an uncommon trick for dynamically typed scripting stuff:
https://github.com/svaarala/duktape/blob/c3722054ea4a4e50f48...
Naturally, the -ffast-math equivalent broke isNaN checks, which caused random object/string handles to be mistakenly reinterpreted as "numbers" - but only in Release builds, for this one particular platform, in one rarely taken branch, so neither QA nor CI caught it, leading to hours of manufacturing a repro case, stepping through an absurd amount of code, and then finally looking at the default build rules and facepalming.
Cursing the platform vendor under my breath, I overrode the defaults to align with the defaults of every other config x platform combination we already had: no fast math. If you want those optimizations, use SSE-friendly NaN-avoiding intrinsics - or, if you must use the compiler flags, ensure you do so consistently across build configs and platforms, perhaps limited to a few TUs or modules if possible. This allows you to have a chance at using your Debug builds to debug the resulting "optimizations".
-
Can C++ and JS be used together?
Sure. For example, DukTape is an implementation of Javascript designed to be embedded in other projects. Google's V8 Javascript engine (used in Chrome), can also be embedded, see Node.Js for example.
-
[AskJS] Do you use JavaScript on Microcontrollers? Which engine / interpreter?
- Duktape (4.8k stars)
What are some alternatives?
quickjs - Public repository of the QuickJS Javascript Engine.
V8 - The official mirror of the V8 Git repository
MicroPython - MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
Espruino - The Espruino JavaScript interpreter - Official Repo
V7 - Embedded JavaScript engine for C/C++
just - the only javascript runtime to hit no.1 on techempower :fire:
Lua - Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
quickjspp - Port of QuickJS Javascript Engine.
Wren - The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.
mjs - Embedded JavaScript engine for C/C++
ChakraCore - ChakraCore is an open source Javascript engine with a C API. [Moved to: https://github.com/chakra-core/ChakraCore]
