Fermyon!
2023-08-17   dejbug.github.io

Fermyon!

gh gh gh gh wasi gh gh gh gh gh gh gh gh gh gh wt docs:wt docs:wt docs:wt bytecodealliance.zulipchat.com bytecodealliance.zulipchat.com gh gh gh lld:llvm fermyon gh infoworld.com gh gh wasmer.io wasmer.io wasmer.io wasmer.io wasmer.io gh gh infoworld.com wiki:arch rs blog:rs groups:G fermyon gh gh gh gh wasi developer:fermyon fermyon datatracker:ietf gh gh developer:fermyon gh gh gh gh gh gh deislabs.io deislabs.io gh gh gh gh

Using C with Fermyon

"...not all of the stdlib is supported by WebAssembly’s sandboxed runtime. Sockets, for example, are not currently supported..." "It can be frustrating to figure out which existing libraries can be ported..." -- fermyon developer:fermyon fermyon fermyon wasi gh gh gh emscripten.org dev:moz

C++

fermyon neugierig.org gh dev:moz nxxm:gh gh qt wiki:qt medium tutorialspoint.com

TODO

fermyon fermyon handlebarsjs.com gohugo.io rhai.rs getbootstrap.com gh validator:w3 How to do it with style. developer:fermyon How to deal with secrets. developer:fermyon developer:fermyon developer:fermyon wiki:arch aur:arch So gevent.org lldb:llvm kern kern So edn.com linux-kernel-labs:gh gh gh gh gh gnu gnu wiki gnu rfc fermyon:gh gh gh gh gh gh gh gh gh developer:fermyon web.dev dev:moz emscripten.org

Beautiful Code

cs.princeton.edu musl.libc.org musl.libc.org gh gh gh gh gh gh gh sw.kovidgoyal.net gh html5-parser:rtd gh lxml.de gitlab:gnome gitlab:gnome gnome.pages.gitlab:gnome gnome.pages.gitlab:gnome gnome.pages.gitlab:gnome

Html Parsing Spec

html.spec:w3 lld:llvm gh wiki wiki wiki wiki wiki wiki wunderwuzzi23:gh So answers:G wiki web:ia googleblog.blogspot.com imperialviolet.org eff ietf paulkocher.com paulkocher.com schneier.com crypto:stanford dl.acm.org php.net security:Sx resources.infosecinstitute.com owasp.org community.sophos.com medium blogs.cisco.com openvpn.net mitmproxy.org crypto:stanford security:Sx So williamstallings.com thomasnet.com developers:G gh bytecodealliance:gh rustwasm:gh infoq.com

Optimization Flags

gh --strip-debug (24 MB -> 9 MB) -Oz (8.9 MB -> 8.4 MB) Info with: --metrics, --func-metrics. No benefits apparently: --abstract-type-refining, --code-folding, --gufa. Too slow to see what happens: --flatten --dfo. Increases size: --alignment-lowering. The following raises an error: --minify-imports-and-exports-and-modules; so don't know what it does. Is it a bug?

DOCS

WASI: wasi WASI Docs: gh Core Spec: w3 Cargo-wasi subcommand: bytecodealliance:gh Rust for Webassembly: rustwasm:gh WAGI Docs: gh Fermyon contribution guide: gh HTML Parsing Spec: html.spec:w3

Experimental WAGI Outbound HTTP

This works only for Rust and AS, not for C nor C++. It should be possible to split my app into C components and one Rust compnent with the latter doing all the fetching (into a shared sqlite database). But alas! It is a pipe-dream. WAGIs have no access to these things. Pure functions like. gh This shows how a Rust WAGI app would use the experimental api. gh gh gh Another idea was to write a C layer and send a pull request. gh docs:wt See also: gh

Fermyon with C

docs:wt

Wasmtime

docs:wt docs:wt wt docs:wt docs:wt docs:wt gh

Wasmtime for C

docs:wt Just says "more coming soon" :_) And points to: docs:wt docs:wt This is another part of the same docs which has more text. gh By default, the C/C++ toolchain orders linear memory to put the globals first, the stack second, and start the heap after that. This reduces code size, because references to globals can use small offsets. However, it also means that stack overflow will often lead to corrupted globals. The -Wl,--stack-first flag to clang instructs it to put the stack first, followed by the globals and the heap, which may produce slightly larger code, but will more reliably trap on stack overflow. See the wasm-ld documentation for more information and additional flags. Note flags related to dynamic linking, such [as] -shared and --export-dynamic are not yet stable and are expected to change behavior in the future. lld:llvm gh

Wasmtime Cache Configuration

docs:wt

Fermyon Limits & Quotas

developer:fermyon developer:fermyon

New stuff

brigade.sh Brigade is a platform for running scriptable, automated tasks. Brigade was apparently archived by the CNCF. See: cncf.io cncf.io CNCF is the open source, vendor-neutral hub of cloud native computing, hosting projects like Kubernetes and Prometheus to make cloud native universal and sustainable.

Memory-Mapped Files in the Wasmtime Runtime

gh To make things easier for people porting programs that just use mmap to read and write files in a simple way, WASI libc includes a minimal userspace emulation of mmap and munmap. groups:G There was a bug on OS X where mmap and fsync did not perform as expected. This caused problems in bitcoin, leading to their famous leveldb bug bounty. The solution was to change to purely stdio-based writing so it works on all platforms without relying on Linux behavior. pubs:og

Great

pubs:og The Open Group UNIX MAN pages

Feeds

feed.infoq.com InfoQ provides software engineers with the opportunity to share experiences gained using innovator and early adopter stage techniques and technologies with the wider industry. We carefully curate and peer review everything we publish. ia but as the broad-winged windward stranger shot nigh to her, the boastful sails all fell together as blank bladders that are burst, and all life fled from the smitten hull. Moby Dick ia ia ia ia ia ia ia... To this reasoning, founded upon figures, I had nothing to object. -- ia ia ia ia ia