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

Guide for compiler-developers #225

Open
emil14 opened this issue Dec 7, 2023 · 1 comment
Open

Guide for compiler-developers #225

emil14 opened this issue Dec 7, 2023 · 1 comment

Comments

@emil14
Copy link

emil14 commented Dec 7, 2023

Hey there! First of all thank you much for this awesome project.

I create my own programming language and the only reason why I don't choose wasm as a compilation target is because it lacks green threads. I found your project because found out grain uses it to implement concurrency. But I struggle to understand what I have to do in order to support lunatic API in my language. Documentation looks extremely small (only one "installation" section!). All I have is source code for Rust, AssemblyScript and Grain gindings on github - all 3 languages that I haven't use in my entire life :)

Looks like the most common use case is to write one of these to compile them to wasm but my case is to create language from scratch that compiles to wasm. How can I leverage your platform? Thanks!

@marceline-cramer
Copy link

So, the Rust, AssemblyScript, and Grain bindings each work by using WebAssembly function imports that the Lunatic runtime provides to each WebAssembly module.

The signatures for all of those function imports can be found here: https://github.com/lunatic-solutions/lunatic-rs/blob/main/src/host/api.rs

These are in Rust, but these are low-level ABI definitions, wrapped in an extern "C" block, meaning that these function signatures are similar to the signatures of those WebAssembly host imports.

If you wanted to target Lunatic as a runtime in your language for starters, you'd need to import these same host functions and integrate them into a higher-level Lunatic API in your language.

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

No branches or pull requests

2 participants