Stream: wasi

Topic: how to use wasi manually


view this post on Zulip Soni L. (Sep 12 2024 at 21:50):

how do you hand-write wasi-cli modules?

view this post on Zulip Soni L. (Sep 12 2024 at 22:46):

the component model explainer is not good enough for this

view this post on Zulip Soni L. (Sep 12 2024 at 23:10):

ah we see, it's too unstable to use, literally any typos will cause it to panic

view this post on Zulip Milan (Sep 12 2024 at 23:18):

Component Model book shows some examples in different languages. If by hand you mean using WAT this page shows a really simple starting example (but not a full wasi:cli world example, would probably use another lang for a full cli example but don't know what your use-case is): https://component-model.bytecodealliance.org/language-support.html#language-agnostic-tooling

view this post on Zulip Milan (Sep 12 2024 at 23:25):

This example from the component book shows a command component (using wasi:clii/run) written in rust: https://component-model.bytecodealliance.org/tutorial.html#create-a-command-component

view this post on Zulip Soni L. (Sep 12 2024 at 23:29):

why's there soooooo much boilerplate

(component
  (core module $Main
    (func (export "run") (param) (result i32)
      i32.const 1
    )
  )
  ;; we don't know what the wasm folks have been cooking but wasip1 took
  ;; SIGNIFICANTLY less boilerplate than this...
  ;; seriously, wasip2 is such a massive downgrade for readability...
  ;; maybe "Component Model Proposal" is a misnomer, they should call it
  ;; "Wasm Obfuscation Proposal" instead. lmao.
  (core instance $main (instantiate $Main))
  (alias core export $main "run" (core func $run))
  (type $uh (result))
  (type $uhh (func (result $uh)))
  (func $run (type $uhh) (canon lift (core func $run)))
  (component $main
    (type $uh (result))
    (type $uhh (func (result $uh)))
    (import "import-func-run" (func $uh (type $uhh)))
    (type $uhhh (result))
    (type $uhhhh (func (result $uhhh)))
    (export "run" (func $uh) (func (type $uhhhh)))
  )
  (instance $main (instantiate $main
      (with "import-func-run" (func $run))
  ))
  (export "wasi:cli/run@0.2.0" (instance $main))
)

view this post on Zulip Alex Crichton (Sep 12 2024 at 23:32):

I wouldn't mind answering questions like this but you are taking a particularly hostile tone and it seems like you are assuming bad faith on those involved in development. I would ask that you change how you communicate here as that may help foster answers to your questions.

view this post on Zulip Soni L. (Sep 12 2024 at 23:32):

most of the boilerplate is dealing with the fact that a module instance is not a component instance (?)

view this post on Zulip Soni L. (Sep 12 2024 at 23:44):

oh, may we share an itemized list of reasons why we're being somewhat hostile? it involves things like "why is compiling wasm-tools so slow (at least we only have to do it once)" "why's the explainer the only barely-decent source of information on components (and still doesn't explain things well enough to be able to write a wasi cli app using only the explainer as reference - we had to decompile/reverse-engineer a rust cli app to gather enough information for this)" "why is wasmtime overshadowing wabt" "[historical experiences with rust folks, which we shall not rehash here]" among others.

view this post on Zulip Soni L. (Sep 12 2024 at 23:48):

the original proposal for component model was that it was simply an ABI thing, you'd compile components and turn them into wasm modules. the current proposal is that component model is... we actually don't know what it is, we can't figure out what it is, it reminds us of wasm-c-api, as a binary RPC format, with some more stuff thrown on top, so we can do things like load modules and instantiate modules and link modules the same as we would if we were using wasm-c-api, and then there's all this stuff about worlds and resources which aren't in wasm-c-api

view this post on Zulip Jeff Parsons (Sep 12 2024 at 23:50):

@Soni L. You're being an ass to the very people you're ostensibly asking to help you. This is not a place to vent. Try Twitter?

view this post on Zulip Soni L. (Sep 12 2024 at 23:50):

but at that point we have this "wasm RPC format" which needs to be... loaded and instantiated like a wasm module, and then it loads and instantiates either more components or wasm modules, and it's just... why

view this post on Zulip Soni L. (Sep 12 2024 at 23:53):

(also it would be easier for ppl to understand if it were just called "wasm RPC" instead of "component model")

view this post on Zulip Soni L. (Sep 12 2024 at 23:59):

it is up to you to decide whether or not to accept feedback from someone who's been trying to figure out how to use "compoent model" aka wasm-rpc for as long as wasi preview 2 has been a thing, and is only now figuring it out

view this post on Zulip Soni L. (Sep 12 2024 at 23:59):

ultimately, the docs are written by ppl. and if someone had told us this is just RPC we would've figured it out ages ago.

view this post on Zulip Ralph (Sep 13 2024 at 11:49):

Dearest Soni, I'm uninterested in feedback that assumes its own hostility is somehow fine. Go somewhere else, or submit a PR to the docs. Don't like preview 2? Don't use it. Or you might like it but need more information? Ask like a human, as other humans are involved, and they don't work for you.

view this post on Zulip Ralph (Sep 13 2024 at 11:51):

For someone who has been "trying to figure out how to use" this for "as long as wasi preview 2 has been a thing" you haven't really appeared here that much and... simply asked. Of course the entire component model overview has the explanation about "why" but didn't find that and didn't ask, right? here: https://github.com/WebAssembly/component-model.

Repository for design and specification of the Component Model - WebAssembly/component-model

view this post on Zulip Ralph (Sep 13 2024 at 11:51):

Now, if reading that document doesn't help you, we'd love to know why but don't care whether you're "irritated" about it. That's on you, not anyone else.

view this post on Zulip Ralph (Sep 13 2024 at 11:52):

if, however, you do not understand the docs, or are looking for material that isn't there, that's fine. Please ask. Like a human to another human. Happy to help humans, always.

view this post on Zulip Ralph (Sep 13 2024 at 11:53):

The great thing about open source is that your own choices are essentially infinite. But they are YOUR choices, not ours. use something else! Entirely fine.

view this post on Zulip IFcoltransG (Sep 13 2024 at 11:53):

From here, I feel like this thread isn't going to go somewhere productive for anyone and it might be best not to continue it.

view this post on Zulip Ralph (Sep 13 2024 at 11:54):

you're right, it likely isn't.

view this post on Zulip Ralph (Sep 13 2024 at 11:55):

however, there are people who continue to enter the zulip who have expectations that are not met. it is important to ensure the tone of communication is established so that they can properly adjust their expectations in a comfortable way.

view this post on Zulip Soni L. (Sep 14 2024 at 02:08):

sorry


Last updated: Dec 23 2024 at 12:05 UTC