mbrezu / Shovel

Shovel is a bytecode virtual machine that is embeddable, secure and interruptible.
BSD 2-Clause "Simplified" License
77 stars 5 forks source link

[request] Expose code generation and the format of the ast #6

Closed ghost closed 7 years ago

ghost commented 7 years ago

Please, can you get provide an api for code generation from the ast, and detailed documentation for the format of the ast, so that it might be easier to compile languages for your VM. The thing is, I see a lot of potential your VM. I spent ages trying to find a sandboxable VM, and Lua was the best for a long time, but this is way more than what I learnt I could do through hacks in Lua. It would like to see more languages compile to it, and potentially help by writing one, if I manage to.

mbrezu commented 7 years ago

Hello there,

there's a compiler from a subset of F# to ShovelScript - https://github.com/erecruit/Fovel.

I'm not sure what your expectations of Shovel VM/Script are, but you need to be aware that:

To put it another way, it's a replacement for Workflow Foundation, not a replacement for Lua.

I think it's not very hard to compile for the Shovel VM, I'm not sure how providing an API for the ShovelScript code generator would help you with other languages (the ShovelScript AST is ShovelScript specific).

Do you mean something like Reflection.Emit, but for Shovel VM?