JavaScript-QuickJS

 view release on metacpan or  search on metacpan

quickjs/doc/quickjs.texi  view on Meta::CPAN

\input texinfo

@iftex
@afourpaper
@headings double
@end iftex

@titlepage
@afourpaper
@sp 7
@center @titlefont{QuickJS Javascript Engine}
@sp 3
@end titlepage

@setfilename spec.info
@settitle QuickJS Javascript Engine

@contents

@chapter Introduction

QuickJS is a small and embeddable Javascript engine. It supports most of the
ES2023 specification
@footnote{@url{https://tc39.es/ecma262/2023 }}
including modules, asynchronous generators, proxies and BigInt.

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

@section Main Features

@itemize

@item Small and easily embeddable: just a few C files, no external dependency, 210 KiB of x86 code for a simple ``hello world'' program.

@item Fast interpreter with very low startup time: runs the 77000 tests of the ECMAScript Test Suite@footnote{@url{https://github.com/tc39/test262}} in less than 2 minutes on a single core of a desktop PC. The complete life cycle of a runtime instanc...

@item Almost complete ES2023 support including modules, asynchronous
generators and full Annex B support (legacy web compatibility). Some
features from the upcoming ES2024 specification
@footnote{@url{https://tc39.es/ecma262/}} are also supported.

@item Passes nearly 100% of the ECMAScript Test Suite tests when selecting the ES2023 features.

@item Compile Javascript sources to executables with no external dependency.

@item Garbage collection using reference counting (to reduce memory usage and have deterministic behavior) with cycle removal.

@item Mathematical extensions: BigDecimal, BigFloat, operator overloading, bigint mode, math mode.

@item Command line interpreter with contextual colorization and completion implemented in Javascript.

@item Small built-in standard library with C library wrappers.

@end itemize

@chapter Usage

@section Installation

A Makefile is provided to compile the engine on Linux or MacOS/X.  A
preliminary Windows support is available thru cross compilation on a
Linux host with the MingGW tools.

Edit the top of the @code{Makefile} if you wish to select specific
options then run @code{make}.

You can type @code{make install} as root if you wish to install the binaries and support files to
@code{/usr/local} (this is not necessary to use QuickJS).

Note: On some OSes atomic operations are not available or need a
specific library. If you get related errors, you should either add
@code{-latomics} in the Makefile @code{LIBS} variable or disable
@code{CONFIG_ATOMICS} in @file{quickjs.c}.

@section Quick start

@code{qjs} is the command line interpreter (Read-Eval-Print Loop). You can pass
Javascript files and/or expressions as arguments to execute them:

@example
./qjs examples/hello.js
@end example

@code{qjsc} is the command line compiler:

@example
./qjsc -o hello examples/hello.js
./hello
@end example

generates a @code{hello} executable with no external dependency.

@section Command line options

@subsection @code{qjs} interpreter



( run in 2.284 seconds using v1.01-cache-2.11-cpan-acebb50784d )