Skip to content

dibashthapa/jasper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Experimental JS-to-WASM Compiler

This is an experimental compiler for translating JavaScript to WebAssembly (WASM). The project is currently a work in progress and achieves less than 5% compatibility with the Test262 test suite at this stage.

Compilation Approaches

There are three potential approaches for compiling JavaScript to WASM:

  1. Compile to core WASM instructions
  2. Compile to the WASM component model
  3. Compile to QuickJS bytecode and convert the bytecode to WASM

Currently, the project focuses on the first approach, which involves direct compilation to core WASM instructions.

Challenges and Progress

Building this compiler has been a challenging yet rewarding experience. It required implementing a custom memory allocator and creating fundamental library functions from scratch.

Features Currently Supported:

  1. Loops
  2. Conditional Statements (if)
  3. Variable Assignments

Goals

  1. Achieve compatibility with at least 50% of Test262 tests
  2. Integrate WASI support for extended functionality
  3. Experiment with the WASM component model and QuickJS bytecode, comparing their performance against the current approach

References

About

AOT Js to WASM Compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published