- 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. |
||
|---|---|---|
| .forgejo/workflows | build: Use Zig's package manager for zig-libgc | |
| patches | build: Add patch to work around SIGILL in libregexp | |
| src | language: Remove extraneous load instructions before jump_conditional | |
| .gitignore | Initial commit | |
| build.zig | build: Use Zig's package manager for zig-libgc | |
| build.zig.zon | build: Use Zig's package manager for zig-libgc | |
| LICENSE | Initial commit | |
| README.md | build: Use Zig's package manager for zig-libgc | |
Kiesel
⚡ A JavaScript engine written in Zig
justforfunnoreally.dev badge License
logoIntroduction
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:
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:
- Kiesel Devlog #1: Now passing 25% of test262!
- Kiesel Devlog #2: Iterators, more math, and a bug in the Zig stdlib
- Kiesel Devlog #3: Accessors, Date/Map/Set, test262 history graph
- Kiesel Devlog #4: The biggest update yet!
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