4 ms·
From what I've seen of wit (called "witx" back when I last used it) it seems to be pretty skewed towards using Rust as inspiration for its design, even though i
by Asraelite 5y ago
From what I've seen of wit (called "witx" back when I last used it) it seems to be pretty skewed towards using Rust as inspiration for its design, even though it's meant to be language agnostic. The syntax is not far off from being a one-to-one copy of Rust.
Some examples: `foo: bar` for type annotations, `->` for return types, `enum { a, b }` for C-style enums, `variant { a(b, c) }` for tagged unions, `type a = b` for type aliases, `_` for placeholder types. Its implementation of WASI even uses `-> expected<_, errno>` for most of its return signatures, imitating Rust's Result.
I really like Rust's type system and syntax, and none of these design decisions are bad in their own right, I just get the impression that other language communities are not having enough influence in the design of WebAssembly compared to Rust.
- matei_radu 5y agoI think that is a really valid observation, and I would like to point out a couple of things: - the WIT language decisions will end up impacting people writing WIT syntax by hand. I am not sure how large that audience is right now (and I am not dismissing the initial comment), but I really hope we could get good enough tooling that could directly generate WIT (in its eventual binary format) based on annotated source code. - an equally valid observation here is that we need people from multiple programming languages looking at generating _idiomatic bindings_ based on the WIT format, which is what end users will interact with when using components. (Currently there are binding generators for Rust and C/C++, with hopefully Grain following soon enough.)
- dcode 5y agoAssemblyScript maintainer here. Can confirm, other language communities have practically zero influence on the design. In fact, AS was present during "specification" and has been completely annihilated for disagreeing with what the chairing majority has come up with there. It's particularly ironic that the Component Model suddenly targets Web integration again, or that this is now coined "language neutral". In relation, the syntax is more of a minor detail.