On Sun, Feb 18, 2018 at 4:47 AM Lars Seipel <lars.sei...@gmail.com> wrote:

>
> Go already has a NaCl backend which might fit the bill. See
> misc/nacl/README for how to set it up. It links to a design document
> (https://golang.org/s/go13nacl) with some background.
>
>
The sucessor of that project is WebAssembly.

WebAssembly is a really good design, where the virtual machine is formally
specified, with a testbed implementation in Ocaml. One of the defining
features is that the VM is a stack-vm with a twist:

* Stack-based VMs usually have smaller opcodes (since you don't have to
specify registers to operate on)
* Stack-based VMs are usually easier to target
* WebAsm's VM is built in a way such that the layout of the stack is
statically known at compile time.

The latter means that you can compile it to a register-based VM, which tend
to be faster at execution.

Ok, C programs can only be implemented in it if you provide a shadow stack.
But given that C generally allows too much of the programmer, this is
perfect :) Also note, I don't think Go would need a shadow stack, but there
might be a subtlety somewhere which mandates it.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to