lunatic-solutions / lunatic

Lunatic is an Erlang-inspired runtime for WebAssembly
https://lunatic.solutions
Apache License 2.0
4.57k stars 136 forks source link

F# to Rust #219

Closed ShalokShalom closed 11 months ago

ShalokShalom commented 11 months ago

How does Rust code run on Lunatic? Since Lunatic itself is written in Rust, it probably needs to separate binding. But can I just compile F# code to Rust (with Fable) and it runs?

Or do I need to write a special binding for that? Thanks a lot

bkolobara commented 11 months ago

Rust code that runs on lunatic is compiled to WebAssembly first. This is different from the Rust code that is the runtime, that compiles to native machine code.

If you can compile F# directly to WebAssembly, you don't need to compile it to Rust. Just run the generated .wasm module directly on lunatic.

ShalokShalom commented 11 months ago

I can't compile directly to WebAssembly. Bolero is the only opportunity, and that is a web framework. I like to compile it to Rust, in order to compile it to WebAssembly.

Going by what you say, is this possible. Correct?

bkolobara commented 11 months ago

I think this could work, but I have never attempted to do something like that.