component-docs icon indicating copy to clipboard operation
component-docs copied to clipboard

Update language guide `add` example to use a world with an interface

Open kate-goldenring opened this issue 2 years ago • 1 comments

To better align with tutorial, update wit and examples to:

interface add {
    add: func(a: u32, b: u32) -> u32
}

world adder {
    export add
}

kate-goldenring avatar Aug 24 '23 01:08 kate-goldenring

I started looking into this but i must say that i am stumped by how to implement a component with an interface for jco and componentize-py. I am thinking of waiting till after Componentize the World on Sept 8th, as there will be explicit tutorials from the language experts that we can learn from and encorporate

kate-goldenring avatar Aug 29 '23 20:08 kate-goldenring

Hey @kate-goldenring is this still a priority? I do agree that we should use an interface (adder?) instead of the bare function export (and at this point it's pretty well supported!) -- so I could work on this and update all the docs and code samples OR we could leave it as a bare function for now :)

vados-cosmonic avatar Oct 31 '24 09:10 vados-cosmonic

I think this is something we should still do, so I don't think we should close this. I personally don't have the time to take it on but i think it would be great to get to. Potentially in a way where all examples just implement the adder world from the tutorial instead of having a separate add interface for the example host which causes a lot of confusion, which we observed in the JS lang docs revamp.

kate-goldenring avatar Oct 31 '24 18:10 kate-goldenring