News for hackers. Stuff that matters.
Re:Dqlite – High-Availability SQLite by MuffinFlavored on Friday August 30, 2019 @11:42AM (#20839658)
> since all major languages have provisions to create C bindings.

Does WebAssembly or any of its runtimes provide a way to do this?

Re:Dqlite – High-Availability SQLite by szczepano on Friday August 30, 2019 @11:57AM (#20839803)
you can probably compile c to webassembly using clang/llvm
Re:Dqlite – High-Availability SQLite by derefr on Friday August 30, 2019 @08:21PM (#20843899)
That's not what the parent was asking. They were asking if WASM has an FFI interface for runtimes that want to not execute the WASM code entirely sandboxed from the host, but rather want to allow you to dlload(2) code into the OS process hosting the WASM interpreter and call it through WASM ops.

Presumably, https://github.com/CraneStation/wasmtime would benefit from such an FFI API being specified.

Re:Dqlite – High-Availability SQLite by zbentley on Sunday September 01, 2019 @07:31AM (#20851712)
That sounds like ActiveX 2.0 at best, and an utter security nightmare at worst.
Re:Dqlite – High-Availability SQLite by MuffinFlavored on Friday August 30, 2019 @09:30PM (#20844109)
Precisely. Do you think this is a feature the WebAssembly team should standardize or is it a bad fit for the language?
Re:Dqlite – High-Availability SQLite by syrusakbary on Saturday August 31, 2019 @10:51PM (#20850244)
That should be doable! (Disclaimer: I work at Wasmer https://github.com/wasmerio/wasmer )
Re:Dqlite – High-Availability SQLite by thosakwe on Saturday August 31, 2019 @07:58AM (#20845794)
Genuine question here: if you’re already going to be shipping native code, why would you need WebAssembly in the mix, especially if you’re not targeting a browser?
Re:Dqlite – High-Availability SQLite by funny_falcon on Tuesday September 03, 2019 @01:10PM (#20868707)
For example, if you want to execute "native" code in a restricted environment. WebAssembly is quite fast when (jit)compiled. Therefore, it's very tempting to use it to embed extension logic.
Re:Dqlite – High-Availability SQLite by tracker1 on Friday August 30, 2019 @01:35PM (#20840685)
Yes, emscripten/llvm builds C code into webassembly. I'd say a significant portion of webassembly is C/C++ sourced.
Re:Dqlite – High-Availability SQLite by MuffinFlavored on Saturday August 31, 2019 @12:08PM (#20847142)
You can't use emscripten/llvm with, #include <windows.h> to provide a GUI per se, can you?
Re:Dqlite – High-Availability SQLite by tracker1 on Sunday September 01, 2019 @03:35PM (#20854276)
Nope. There are iirc specific bindings for that in a browser context. I think there's been a lot of work for other runtimes.