Fundament-Software / scopes

Fundament fork of the Scopes language
Other
3 stars 1 forks source link

Allow outputting WASM to a memory buffer #11

Closed ErikMcClure closed 1 year ago

ErikMcClure commented 1 year ago

It would be useful if the compilation step allowed outputing the result of compiling WASM to a memory buffer instead of directly to a file.

queercat commented 1 year ago

Currently I'm looking at writing an additional function into the /src/gen_llvm.cpp file.

This function will be using the LLVM API --> LLVMTargetMachineEmitToMemoryBuffer defined here.

I will need to figure out exactly how to link this to the runtime of scopes but there should be enough information in the source files that I can figure it out.

queercat commented 1 year ago

See 46b10637b7beea809c5bd84f783ed32de0cf471f for specifics of current implementation. Moving to testing soon.

queercat commented 1 year ago

Technically resolves but I'd like to open another issue to make this function more generic. After a better understanding the language's internals I believe this can simply be: compile-object-buffer. Either way I am comfortable with this being resolved after review.