1
0
Fork
You've already forked kiesel
0
forked from kiesel-js/kiesel
A JavaScript engine written in Zig
  • Zig 100%
Linus Groh c0e6e999e5 language: Remove extraneous load instructions before jump_conditional
This ensures that the correct do-while statement result value is
restored after evaluating the test expression.
2023年10月19日 23:57:56 +01:00
.forgejo/workflows build: Use Zig's package manager for zig-libgc 2023年10月15日 20:25:36 +02:00
patches build: Add patch to work around SIGILL in libregexp 2023年10月09日 07:36:28 +01:00
src language: Remove extraneous load instructions before jump_conditional 2023年10月19日 23:57:56 +01:00
.gitignore Initial commit 2023年04月28日 19:48:13 +01:00
build.zig build: Use Zig's package manager for zig-libgc 2023年10月15日 20:25:36 +02:00
build.zig.zon build: Use Zig's package manager for zig-libgc 2023年10月15日 20:25:36 +02:00
LICENSE Initial commit 2023年04月28日 19:48:13 +01:00
README.md build: Use Zig's package manager for zig-libgc 2023年10月15日 20:25:36 +02:00

Kiesel

A JavaScript engine written in Zig

justforfunnoreally.dev badge License

logo

Introduction

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 aims to implement as much as possible in pure Zig - currently with two exceptions:

  • bdwgc for garbage collected allocations
  • libregexp for regular expressions

A simple CLI (REPL/file interpreter) is available but being easy to embed in other projects is also a goal.

The implementation style is similar to LibJS - the JS engine used in SerenityOS and the Ladybird browser which I worked on before - in various aspects, most notably the desire to stay very close to spec. Development is still at an early stage and the engine's usefulness thus limited. While there are various things that already work well, there's an equal amount of things that don't :^)

Issues are disabled for the time being, if you want to report a bug (not missing feature, many features are missing!), please get in touch with me directly. Pull requests containing small fixes are welcome, if you want to work on features please also get in touch beforehand.

Further reading:

Build

Dependencies managed through build.zig.zon will be installed automatically when building for the first time

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] [file]
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
 --print-gc-warnings Print GC warnings, e.g. OOM
 -p, --print-result Print the evaluated result
 -v, --version Print version information and exit
 -h, --help Print help text and exit