All Projects → napi-bindings → quickjs-build

napi-bindings / quickjs-build

Licence: other
Build for QuickJS JavaScript Engine

Programming Languages

c
50402 projects - #5 most used programming language
javascript
184084 projects - #8 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to quickjs-build

Quickjs
QuickJS是一个小型并且可嵌入的Javascript引擎,它支持ES2020规范,包括模块,异步生成器和代理器。
Stars: ✭ 2,199 (+8696%)
Mutual labels:  vm, javascript-engine, es2020, quickjs
Quickjs
The official repo is at bellard/quickjs.
Stars: ✭ 1,429 (+5616%)
Mutual labels:  vm, interpreter, runtime, javascript-engine
Chakracore
ChakraCore is an open source Javascript engine with a C API.
Stars: ✭ 8,600 (+34300%)
Mutual labels:  vm, runtime, javascript-engine
Zetavm
Multi-Language Platform for Dynamic Programming Languages
Stars: ✭ 592 (+2268%)
Mutual labels:  vm, interpreter
Awesome Wasm Runtimes
A list of webassemby runtimes
Stars: ✭ 490 (+1860%)
Mutual labels:  vm, engine
Q3vm
Q3VM - Single file (vm.c) bytecode virtual machine/interpreter for C-language input
Stars: ✭ 585 (+2240%)
Mutual labels:  vm, interpreter
RISVM
A low overhead, embeddable bytecode virtual machine in C++
Stars: ✭ 21 (-16%)
Mutual labels:  vm, interpreter
Lunatic
Lunatic is an Erlang-inspired runtime for WebAssembly
Stars: ✭ 2,074 (+8196%)
Mutual labels:  vm, runtime
Redtamarin
AS3 running on the command line / server side
Stars: ✭ 105 (+320%)
Mutual labels:  vm, runtime
Javo
🚀 A sandboxed VM any Java developer can afford
Stars: ✭ 144 (+476%)
Mutual labels:  vm, interpreter
Alchemyvm
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 176 (+604%)
Mutual labels:  vm, interpreter
clox
A virtual machine and a tree-walk interpreter for the Lox programming language in C89 🌀
Stars: ✭ 38 (+52%)
Mutual labels:  vm, interpreter
Vm.js
Javascript 解释器. Javascript Interpreter
Stars: ✭ 343 (+1272%)
Mutual labels:  vm, interpreter
Passerine
A small extensible programming language designed for concise expression with little code.
Stars: ✭ 341 (+1264%)
Mutual labels:  vm, interpreter
Eval5
A JavaScript interpreter written in TypeScript - Support ES5
Stars: ✭ 281 (+1024%)
Mutual labels:  vm, interpreter
pocketlang
A lightweight, fast embeddable scripting language.
Stars: ✭ 1,412 (+5548%)
Mutual labels:  vm, interpreter
interp
Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
Stars: ✭ 32 (+28%)
Mutual labels:  vm, interpreter
SandboxJS
Safe eval runtime
Stars: ✭ 18 (-28%)
Mutual labels:  vm, interpreter
Janet
A dynamic language and bytecode vm
Stars: ✭ 2,216 (+8764%)
Mutual labels:  vm, interpreter
Tagha
Minimal, low-level, fast, and self-contained register-based bytecode virtual machine/runtime environment.
Stars: ✭ 101 (+304%)
Mutual labels:  vm, interpreter

QuickJS JavaScript Engine

QuickJS Build Matrix

Version 2021-03-27

Introduction

QuickJS is a small and embeddable Javascript engine. It supports the ES2020 specification including modules, asynchronous generators, proxies and BigInt.

It optionally supports mathematical extensions such as big decimal floating point numbers (BigDecimal), big binary floating point numbers (BigFloat) and operator overloading.

Main Features:

  • Small and easily embeddable: just a few C files, no external dependency, 210 KiB of x86 code for a simple hello world program.
  • Fast interpreter with very low startup time: runs the 69000 tests of the ECMAScript Test Suite in about 95 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
  • Almost complete ES2020 support including modules, asynchronous generators and full Annex B support (legacy web compatibility).
  • Passes nearly 100% of the ECMAScript Test Suite tests when selecting the ES2020 features.
  • Can compile Javascript sources to executables with no external dependency.
  • Garbage collection using reference counting (to reduce memory usage and have deterministic behavior) with cycle removal.
  • Mathematical extensions: BigDecimal, BigFloat, operator overloading, bigint mode, math mode.
  • Command line interpreter with contextual colorization implemented in Javascript.
  • Small built-in standard library with C library wrappers.

This reposistory is a mrirror of the original work that you can find here.

Building

The main purpose of this reposistory is to build QuickJS static library that you could include on your C / C++ project. On release you can find the build for the following operating systems:

  • Windows
  • Ubuntu 20.04
  • Ubuntu 18.04
  • Linux arm64
  • macOS

If you want to build the QuickJS library on your own the first step is to clone this repository:

> git clone https://github.com/napi-bindings/quickjs-build.git

Building on Windows

You will need to install GCC for Windows and CMake.

Install GCC compiler

  • Download the mingw from this link.
  • Be sure that gcc in in your path of execution.

Install CMake

  • Download the right version for your system from this link.
  • Be sure that cmake is in your path of execution.

Configure and build

Open your shell and execute the commands reported below:

mkdir ./build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-G "MinGW Makefiles" \
-S ./ \
-B ./build
cmake --build ./build

-DCMAKE_BUILD_TYPE could be set with one of the following two values:

  • Release
  • Debug

Building on Unix-like platform

You will need to install C / C++ compiler and CMake.

Prerequisistes to build on Linux

These steps were tested on:

  • Ubuntu 18.04
  • Ubuntu 20.04

First, you will need to install dependencies:

sudo apt-get update
sudo apt-get install build-essential -y
sudo apt-get install cmake -y

Prerequisites to build on macOS

These steps were tested on macOS Catalina (10.15).

First, you will need to install dependencies:

  • Install Xcode
    • You also need to install the XCode Command Line Tools by running xcode-select --install. Alternatively, if you already have the full Xcode installed, you can find them under the menu Xcode -> Open Developer Tool -> More Developer Tools.... This step will install clang, clang++, and make.
  • Install Homebrew
  • Install and cmake running the following command:
brew install cmake

Configure and build

Open your shell and execute the commands reported below:

mkdir ./build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-G "Unix Makefiles" \
-S ./ \
-B ./build
cmake --build ./build

-DCMAKE_BUILD_TYPE could be set with one of the following two values:

  • Release
  • Debug

References

Team

Nicola Del Gobbo

https://github.com/NickNaso/

https://www.npmjs.com/~nicknaso

https://twitter.com/NickNaso

Acknowledgements

Thank you to all people that encourage me every day.

License

Licensed under Apache license V2

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].