kinode-dao / kinode-book

"Rust Book"-style introduction and documentation for Kinode OS
Apache License 2.0
12 stars 8 forks source link

Section 3. Process Standard Library #182

Closed jurij-jukic closed 6 months ago

jurij-jukic commented 6 months ago
  1. 'Since Kinode apps use the WebAssembly Component Model, they are built on top of a WIT (Wasm Interface Type) package.'

    • where is the link to this WIT package? or is it work in progress, if so, we might want to indicate that?
  2. 'This interface contains the core types and functions that are available to all Kinode apps, and these are automatically generated in Rust when building a Wasm app.'

    • do you use WIT types directly in Rust or do you use Rust types which are converted to WIT under the hood when building?
nick1udwig commented 6 months ago
  1. https://github.com/kinode-dao/kinode-wit/blob/master/kinode.wit
  2. wit-bindgen generates code in your language of choice from a WIT file and that generated code is then used. E.g.:

generate the rust code from wit

import from the generated rust code

process using types that were generated from wit

We define the imports in the runtime, here that are declared here