SkillAgentSearch skills...

Escargot

Escargot is a lightweight JavaScript engine designed specifically for resource-constrained environments.

Install / Use

/learn @Samsung/Escargot
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Escargot

License GitHub release (latestSemVer) Actions Status Coverity Scan Build Status codecov

Escargot is a lightweight JavaScript engine developed by Samsung, designed specifically for resource-constrained environments. It is optimized for performance and low memory usage, making it ideal for use in embedded systems, IoT devices, and other applications where resources are limited.

Key features of Escargot include:

  • ECMAScript Compliance: Escargot supports a significant portion of the latest ECMAScript version (ECMAScript 2025), ensuring compatibility with modern JavaScript standards while maintaining a lightweight footprint.
  • Memory Efficiency: The engine is designed with memory constraints in mind, making it suitable for devices with limited RAM and storage.
  • Performance Optimization: Escargot implements various optimization techniques to ensure fast execution of JavaScript code, even on low-power devices.
  • Extensibility: The engine can be customized and extended to meet the specific needs of different applications, providing flexibility for developers.

Escargot is an open-source project that allows developers to contribute to its development or use it in their own projects, while also powering several services in Samsung products. The engine's design prioritizes simplicity and efficiency, making it an excellent choice for developers working in embedded or resource-limited environments.

Contents 📋

Building 🛠️

Supported Platforms and Architectures

| OS | Architecture | |-|-| | Linux(Ubuntu) | x86/x64/arm/aarch64 | | macOS | x64/aarch64 | | Windows | Win32/x64 | | Android | x86/x64/arm/aarch64 |

Build Options

The following build options are supported when generating build rules using cmake.

| Option | Description | Flag | Value | Default | |-|-|-|-|-| | HOST | Choose target platform | -DESCARGOT_HOST | linux/darwin/android/windows | | | ARCH | Choose target architecture | -DESCARGOT_ARCH | x64/x86/arm/aarch64 | | | MODE | Choose release/debug mode | -DESCARGOT_MODE | release/debug | release | | OUTPUT | Choose build output type | -DESCARGOT_OUTPUT | shared_lib/static_lib/shell/cctest | shell | | LIBICU | Include libicu library | -DESCARGOT_LIBICU_SUPPORT | ON/OFF | ON | | WASM | Enable WebAssembly support | -DESCARGOT_WASM | ON/OFF | OFF | | CODE_CACHE | Enable code cache | -DESCARGOT_CODE_CACHE | ON/OFF | OFF | | TCO | Enable tail call optimization | -DESCARGOT_TCO | ON/OFF | OFF | | THREADING | Enable threading features (e.g. Atomics, SharedArrayBuffer) | -DESCARGOT_THREADING | ON/OFF | ON | | TLS_ADDRESS_OFFSET | Enable thread local storge access optimization(offset) | -DESCARGOT_TLS_ACCESS_BY_ADDRESS | ON/OFF | OFF | | TLS_PTHREAD_KEY | Enable thread local storge access optimization(pthread_key) | -DESCARGOT_TLS_ACCESS_BY_PTHREAD_KEY | ON/OFF | OFF | | TEMPORAL | Enable Temporal support | -ESCARGOT_TEMPORAL | ON/OFF | OFF | | SHADOWREALM | Enable ShadowRealm support | -ESCARGOT_SHADOWREALM | ON/OFF | OFF | | SMALL_CONFIG | Enable aggressive memory optimizations for tiny devices | -DESCARGOT_SMALL_CONFIG | ON/OFF | OFF | | TEST | Enable additional features used only for testing | -DESCARGOT_TEST | ON/OFF | OFF | | DEBUGGER | Enable Debug server | -DESCARGOT_DEBUGGER | ON/OFF | OFF |

Linux

General build prerequisites:

sudo apt-get install autoconf automake cmake libtool libicu-dev ninja-build pkg-config

Prerequisites for x86-64-to-x86 compilation:

sudo apt-get install gcc-multilib g++-multilib
sudo apt-get install libicu-dev:i386

Build Escargot:

git submodule update --init third_party # update submodules
cmake -DESCARGOT_MODE=release -DESCARGOT_OUTPUT=shell -GNinja
ninja

macOS

General build prerequisites:

brew install autoconf automake cmake icu4c libtool ninja pkg-config

# add icu path to pkg_config_path (x64)
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
# add icu path to pkg_config_path (arm64)
export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"

Build Escargot:

git submodule update --init third_party # update submodules
cmake -DESCARGOT_MODE=release -DESCARGOT_OUTPUT=shell -GNinja
ninja

Android

Build prerequisites on Ubuntu:

sudo apt install openjdk-17-jdk # require java 17

Build Escargot using gradle:

git submodule update --init third_party # update submodules
export ANDROID_SDK_ROOT=.... # set your android SDK root first
cd build/android/
./gradlew bundleReleaseAar # build escargot AAR
./gradlew bundleHostJar # bundle jar for host
./gradlew javadocJar # create java doc
./gradlew sourcesJar # create sources jar

./gradlew assembleDebug # build debug test shell
./gradlew :escargot:connectedDebugAndroidTest # run escargot-jni tests on android device
./gradlew :escargot:testDebugUnitTest # run escargot-jni tests on host

Windows

Install VS2022 with cmake and ninja. Open [ x86 Native Tools Command Prompt for VS 2022 | x64 Native Tools Command Prompt for VS 2022 ]

git submodule update --init third_party # update submodules

CMake -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=[ Windows | WindowsStore ] -DCMAKE_SYSTEM_VERSION:STRING="10.0"  -DCMAKE_SYSTEM_PROCESSOR=[ x86 | x64 ] -DCMAKE_GENERATOR_PLATFORM=[ Win32 | x64 ],version=10.0.18362.0 -DESCARGOT_ARCH=[ x86 | x64 ] -DESCARGOT_MODE=release -Bout -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_THREADING=ON
cd out
msbuild ESCARGOT.sln /property:Configuration=Release /p:platform=[ Win32 | x64 ]

Debugger

Make sure Escargot is built with the -DESCARGOT_DEBUGGER=1 flag (off by default) enabled; then start Escargot with the --start-debug-server option.

Connect using a debugger client

  • Escargot python debugger
    • run ./tools/debugger/debugger.py; It will automatically connect to a debug server on the default port 6501
    • run ./tools/debugger/debugger.py --help for a list of options
  • Visual Studio Code extension
  • Chrome Devtools ⚠️ Early in development ⚠️
    • Initial setup:
      • Navigate to chrome://inspect
      • Make sure Discover network targets is enabled; click configure
      • Add localhost:6501 as a target; click Done
    • Usage:
      • The started debug server will be listed in the Remote Target list (If it is not, the page may need to be reloaded using the browser reload button)
      • Click inspect
      • A new window with the Chrome Devtools debugger UI will open

Testing ✅

Escargot supports various benchmark sets, which can be run using the tools/run-tests.py script.

| Benchmark | flag | | --- | --- | | SunSpider 1.0.2 | sunspider | | Octane 2.0 | octane | | test262 | test262 | | Web Tooling Benchmark | web-tooling-benchmark | | SpiderMonkey (vendor-made) | spidermonkey | | ChakraCore (vendor-made) | chakracore | | V8 (vendor-made) | v8 |

Run each benchmark separately or all together as shown below:

tools/run-tests.py --engine=./out/linux/x64/release/escargot web-tooling-benchmark
tools/run-tests.py --engine=./out/linux/x64/release/escargot spidermonkey test262 v8

Contributing 💡

Escargot welcomes contributions from developers in any form, wheter it's code, documentation, bug reports, or suggestions. By contributing to the project, you agree to license your contributions under the LGPL-2.1 license.

❗ Vulnerability Reporting

⚠️ If you identify any vulnerabilities, please report them through the Issues page. Reports sent via other channels may not be considered or may be processed with delays. Please note that our project assumes the execution of valid JavaScript source code only. Handling of invalid source code is not within the main scope of this project and might not be addressed.

Research Papers 📝

License 📜

Escargot is open-source software primarily licensed under LGPL-2.1, with some components covered by other licenses. Complete license and copyright information can be found in the source code.

View on GitHub
GitHub Stars347
CategoryProduct
Updated23h ago
Forks56

Languages

C++

Security Score

95/100

Audited on Mar 28, 2026

No findings