A JavaScript engine written in Zig https://kiesel.dev
Go to file
Linus Groh 837395d66d
Lint / lint (push) Successful in 10s Details
Test / test (push) Successful in 41s Details
Build / build (push) Successful in 5m3s Details
everywhere: Update std.math.{fabs,absInt}/@fabs to new @abs builtin
See: https://github.com/ziglang/zig/pull/17248
2023-09-28 22:12:54 +01:00
.forgejo/workflows
src everywhere: Update std.math.{fabs,absInt}/@fabs to new @abs builtin 2023-09-28 22:12:54 +01:00
vendor
.gitignore
.gitmodules
LICENSE
README.md
build.zig build: Change name of libgc static library to just "gc" 2023-09-27 20:13:38 +01:00
build.zig.zon

README.md

Kiesel

A JavaScript engine written in Zig

justforfunnoreally.dev badge License

logo

What is this?

Kiesel is a JavaScript engine written from scratch for the purpose of me learning the Zig programming language, with the eventual goal of full support for the latest ECMAScript standard. It features a custom bytecode VM and runtime, and uses bdwgc for garbage collected allocations.

A simple CLI/file interpreter is available but it also aims to be easily embeddable into other projects.

The implementation style is similar to LibJS (the JS engine used in SerenityOS and the Ladybird browser which I also work on) in various aspects, most notably the desire to stay very close to spec. Despite these similarities and my involvement in both projects, Kiesel is not intended as a successor to LibJS in any way :^)

Development is still at an early stage and the engine not actually useful at this point. Pull requests and issues are disabled for the time being, if you want to report a bug (not missing feature, most features are missing!), please ping me directly.

Further reading:

Build

Dependencies managed through build.zig.zon will be installed automatically when building for the first time, to fetch vendored dependencies run:

git submodule update --init --recursive

To build and run the Kiesel CLI:

zig build run

NOTE: Kiesel targets the master branch of Zig. This means that the build breaks semi-regularly, which I will usually fix as soon as I notice.

Usage

Usage: kiesel [options] [args]

Options:

  -c, --command             Run the given code as a script
  --disable-gc              Disable garbage collection
  --print-ast               Print the parsed AST
  --print-bytecode          Print the generated bytecode
  -p, --print-result        Print the evaluated result
  -v, --version             Print version information and exit
  -h, --help                Print help text and exit

Arguments:

  file                      The JS file to run, a REPL is started if omitted