This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement bytecode emulator backend
The native code generation backend is held up on a couple issues that we don't want to spend time at the moment attempting to address - namely that lowering to WebAssembly presents some difficult issues around how to support some of what our native backend wants or needs to do in order to bring all the pieces of the compiler and runtime together. The lack of any stack switching intrinsics native to Wasm is a major obstacle here. As a result, what this commit does is extend the existing compiler to support generation of our own bytecode, executed by an emulator which is linked in to any generated executables. From the perspective of the end user, there is no noticeable difference between native compilation and this backend, however there are a few constraints (addressable) that are not handled here - namely compilation of static/dynamic libraries, and linking modules previously compiled. This can be handled by performing our linking process, but that hasn't been implemented and currently isn't important. A significant amount of runtime infrastructure was also implemented during this time, including signal management, system services, and a rework of the term encoding scheme to support some additional types. The garbage collector was implemented and is integrated with the emulator. The next outstanding bit of work is aggressively testing what has been built here, and expanding upon it in a few ways: * Build on the current primitives to implement the init procedure * Implement ETS, persistent term, and atomics services * Implement the standard library on top of the above
- Loading branch information