LLMpediaThe first transparent, open encyclopedia generated by LLMs

Duktape

Generated by DeepSeek V3.2
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: JavaScript Hop 4
Expansion Funnel Raw 76 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted76
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Duktape
NameDuktape
DeveloperSami Vaarala
Released0 2013
Latest release version2.7.0
Latest release date14 October 2023
Operating systemCross-platform
GenreJavaScript engine
LicenseMIT License

Duktape. Duktape is an embeddable, portable JavaScript engine written in C, designed for environments with limited resources such as ROM and RAM. It is known for its small footprint, ease of integration, and compliance with the ECMAScript specification. The engine is widely used in embedded systems, IoT devices, and as a scripting layer within larger C/C++ applications.

Overview

Duktape was created by Finnish programmer Sami Vaarala, with its first public release in 2013, aiming to provide a compact and versatile scripting solution. It implements the ECMAScript E5.1 standard and includes some features from later versions like ES6 and ES2015. Unlike larger engines such as V8 or SpiderMonkey, Duktape is designed to be easily portable to exotic platforms, including those without an operating system or C standard library. Its design philosophy emphasizes minimalism and embeddability, making it a popular choice for extending the functionality of firmware and low-level software.

Features

Key features of the engine include a small footprint, often under 200 KB for the core library, and support for coroutines via the `Duktape.Coroutine` API. It provides a comprehensive C API for binding JavaScript functions to native code, enabling seamless interaction with host applications. The engine supports CommonJS-style modules, regular expressions, and a property descriptor system compliant with the ECMAScript specification. Additional utilities include a built-in debugger protocol, a bytecode dump/load facility, and optional features like Date and JSON support that can be excluded to reduce size further for constrained targets like microcontrollers.

Architecture

The architecture is centered around a value stack exposed through the C API, where all JavaScript values, including objects, strings, and numbers, are manipulated. It uses a tagged union representation for values and employs a mark-and-sweep garbage collector for automatic memory management. The engine compiles JavaScript source code to bytecode for a register-based virtual machine, optimizing for both speed and memory usage. Its internal components, such as the lexer, parser, and compiler, are designed for simplicity and portability, avoiding dependencies on specific hardware features or system libraries.

Usage and applications

Duktape is commonly embedded in embedded Linux systems, RTOS environments like FreeRTOS and Zephyr, and game engines for adding scripting capabilities. It serves as the scripting backbone for projects such as the Node-RED runtime on resource-constrained devices and various IoT platforms from companies like Samsung and ARM. The engine is also integrated into desktop applications, including Adobe Photoshop plugins and Audacity extensions, to provide user-configurable automation. In the security domain, it is utilized within malware analysis tools and firmware of networking equipment from vendors like Cisco.

Development and community

Primary development is led by Sami Vaarala, with contributions from a global community of developers focused on embedded software and scripting languages. The project is hosted on GitHub, where issues are tracked and pull requests are managed, following a transparent development model. Discussions occur on platforms like Stack Overflow and a dedicated IRC channel, fostering collaboration on porting to new CPU architectures such as ARM, MIPS, and RISC-V. The community maintains bindings for languages including Python, Lua, and Rust, expanding its ecosystem.

License and distribution

Duktape is distributed under the permissive MIT License, allowing unrestricted use, modification, and distribution in both open-source and proprietary projects. The source code is available from the official GitHub repository and can be downloaded as a single C file and a corresponding header file for easy integration. This licensing model has facilitated its adoption by major corporations like Microsoft in the ChakraCore project and Sony in products within the PlayStation ecosystem. Binary distributions are also provided for common platforms, including Windows, Linux, and macOS.

Category:JavaScript engines Category:Embedded systems Category:Free software programmed in C Category:Software using the MIT license Category:2013 software