I like that CouchDB uses MapReduce to build its views. What I don't like is that its MapReduce functions are written in JavaScript and are slow.
You do actually want good security isolation in the MapReduce functions. You want to be able to run untrusted views.
So I want a fast and secure way of running MapReduce functions in the database thingy that I'm writing (in #Rust).
Correct me if I'm wrong, but #WASM is basically perfect for this use case, right? Should I start with #Wasmer?
and though _start was wrong, but the issue was another dynamic function, fun_fd_prestat_get, was returning None (aka []) and not a number (aka [I32]), but of course #wasmer decided NOT to inform you WHICH dynamic function was generating the runtime error.
I sure manage to reach a lot of "unreachable" code in #wasmer. Hit another one, and have no clue what I'm doing since the docs aren't very clear.
Interesting, I switched #wasmer 's compiler from llvm back to cranelift and both warnings went away.
Always funny to get an error that is:
RuntimeError: RuntimeError: unreachable
Apparently the #wasmer devs thought something wasn't reachable, but I managed to reach it anyways, and I have no clue where this "unreachable" code is.
@Perl @plicease's #WebAssembly in #Perl distribution https://metacpan.org/pod/Wasm (using #Wasmtime) now has competition in the form of Felipe Gasper's #Wasmer-based https://metacpan.org/pod/Wasm::Wasmer.
With @PerlFFI's ability to build Perl extensions in C, C++, #Rust, #GoLang, #Pascal (!), #Fortran (!!), and even #assembly (!!!), you can plug just about any high-performance code into Perl.
#webassembly #perl #wasmtime #wasmer #rust #golang #pascal #fortran #assembly
And w/ a bit of magic, I can convert the #wasmer buffer into a ctypes buffer so more sane usage can come from this:
(ctypes.c_uint32 * 10).from_buffer(bytearray(self.instance.exports.memory.buffer)[b:])
Still need to do some magic for pointers, but b is a pointer, and don't have to do magic on calculating offsets.
Did manage to get far enough to read the data written by #WASM program, but lots of cleanup is needed was the #wasmer API is bare bones and absolutely terrible. The ctypes interface is much better than this. At least it follows what you expect from C/assembly not this crazy made up idea of an API.
#wasmer docs are absolute crap.
I expected *_view offset to be in bytes, but they aren't. so now you have to divide the pointer provided by data length. Wonder if you can end up overwriting buffers you shouldn't by passing in non-aligned buffers to the WASM interpreter.
And I guess I'm supposed to hashtag things or something. Relevant content above. Am I doing this right? #grainlang #wasm #wasmer #zig #ziglang
#grainlang #wasm #wasmer #Zig #ziglang
More #wasmer weirdness. The WASI StateBuilder makes an ImportObject, but:
/// This object is deprecated in favor of dictionaries in Python.
Reading the source also lets me find out that you have to wrap functions for wasmer w/ it's own Function type.
Python's dynamicness is awesome when using other Python code, but lots of interface code, like #wasmer 's Python interface don't follow the zen of python, which is allowing emulation via class interface, but requiring that it be a specific object, e.g. PyDict.
> "#Wasmer can now turn a #WebAssembly file into a native Windows, Linux or Mac OS executable. This enables distributing executables to users, without requiring them to install Wasmer themselfes." :-)
#code #tech #wasm #webassembly #wasmer
Announcing Wasmer 3.0
https://wasmer.io/posts/announcing-wasmer-3.0
Hey #WASM friends, we have a brand new version of #Wasmer🚀