lucet icon indicating copy to clipboard operation
lucet copied to clipboard

Is it possible to use lucet with C++ (as scripting engine)?

Open blockspacer opened this issue 4 years ago • 3 comments

Use case: lucet as scripting engine for C++ server (uses boost for networking).

Issue: C++ server <-> Rust (lucet) as scripting engine <-> C++ (WASM)

blockspacer avatar Aug 16 '19 12:08 blockspacer

Hi,

The Lucet runtime has a C API. See the prototypes here: https://github.com/fastly/lucet/blob/master/lucet-runtime/include/lucet.h . The extern "C" guards are currently missing, but that can be easily added in order to make usage in C++ easier.

Now, Lucet currently works by compiling WebAssembly code ahead of time using lucetc. So it may not be a good fit as a scripting engine.

Can you clarify what you are trying to do?

jedisct1 avatar Aug 16 '19 12:08 jedisct1

I was trying to find lucet & C++ usage example.

I`ll try extern "C". Thanks for response.

blockspacer avatar Aug 16 '19 13:08 blockspacer

The documentation is indeed missing C/C++ usage examples.

This is something we absolutely need to improve, thanks for the heads up!

jedisct1 avatar Aug 16 '19 13:08 jedisct1