Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: implement an asm.js code generator #14

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Aug 6, 2024

The code generator takes a subset of the L0 language as input and translates it
to asm.js. It's currently more a proof-of-concept, based on pass0, but it
largely works already, in that it produces valid asm.js code for most of the
L0 subset it supports.

Compared to L0, the subset:

  • has no exception support (CheckedCall, Raise, Except, etc.)
  • has no subroutine support
  • has no range Choice or float-value Select support
  • has no 64-bit integer support
  • has no checked integer arithmetic support

A grammar for the new intermediate language is missing, as well as a pass to
lower L0 into said language.

For the sake of simplicity, the code generator currently formats the final code
in-place, but first emitting a PackedTree that is then turned into text would be
cleaner (and possibly more efficient).

The code generator / pass takes a subset of the L0 language as input
and translates it to asm.js. This is a very early implementation, based
on `pass0`, with lots of issues and missing features.
It just writes the asm.js code to a file and invokes Node.js on it.
@zerbina zerbina added the enhancement New feature or request label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant