Whole-known-network
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> third: the browser doesn't provide anything by default either, you have to tell it to provide a `console.log` export explicitly</p><p>anyway, i would probably use the wasmtime python bindings and add the functions you want via Python. there are examples on doing so, ping me if you have issues</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> first off: nothing but browser and node.js will provide you with the ability to interoperate with JS</p><p>second: if you want specifically `console.log` as an import, you'll probably have to write some adapter code to run it with wasmtime, because you are now the embedder who is in control (and you get all the drawbacks of having total control)</p><p>wasmtime isn't a browser thing and it makes no attempt to emulate a browser environment</p>
<p><span class="h-card" translate="no"><a href="https://toot.cat/@endocrimes" class="u-url mention">@<span>endocrimes</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> Say I'm running some MDN sample code <a href="https://developer.mozilla.org/en-US/docs/WebAssembly/Guides/Understanding_the_text_format#importing_functions_from_javascript" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">developer.mozilla.org/en-US/do</span><span class="invisible">cs/WebAssembly/Guides/Understanding_the_text_format#importing_functions_from_javascript</span></a> which loads and invokes console.log. Neither wasm-interp nor wasmtime are able to locate console.log. What is the most reasonable / most browser-compatible way to print a string from code running in one or either of these programs?</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> Can I run wasmtime in a mode where only things that would be legal in a browser are legal?</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> to whatever code you want; you can add host functions written in Rust that your Wasm code can call. i don't think wasm-interp offers anything like this (I believe it just exists to validate the spec)</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> Bindings to what?</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> also wasmtime has features like "bindings" and "real multithreading" and "knows how to do various types of I/O", basically everything you need to run a production app (or yowasp.org)</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> wasmtime generates code that is competitive with C on computation-heavy workloads. wasm-interp is just the reference interpreter</p>
<p>time to fork the probe-rs repo and start working on the protocol</p><p><a href="https://github.com/GlasgowEmbedded/glasgow/pull/864" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">github.com/GlasgowEmbedded/gla</span><span class="invisible">sgow/pull/864</span></a></p>