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: Code generator for WebAssembly #1

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

joamaki
Copy link

@joamaki joamaki commented Dec 22, 2020

This is a proof-of-concept WebAssembly code generator for Homer.

It is implemented on top of a runtime that provides the linear memories for heap and stack. The WASM stack is only used
to pass arguments to the runtime functions.

Memory in heap is garbage collected with a simple copying collector.

What works:

  • MakeClosure/AppClosure
  • Variant/Match
  • AppFunc (maybe)
  • Bool, Atom, Num
  • BinOps: add, greater
  • If
  • Copying garbage collection

Test coverage is currently non-existent and implementation likely buggy in parts.

TODO:

  • Record allocation and projection
  • Fix garbage collection of variants.
  • Rest of the binops
  • Tests!
  • Cleanup commit history
  • Clean integration into homer-run or new binary
  • Tail calls
  • Larger stack and detection of stack overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant