|
|
|
|
|
by reggieband
2752 days ago
|
|
I don't see the benefits of jamming the square peg of language builtins into such a narrow use case. > the runtime translates WASI args_get and args_sizes_get > for the zeroth arg to the blockchain address() function. There is nothing intuitive about that for me. In most languages, exposing the blockchain interface as a module feels like it would be a significantly cleaner implementation. If I want to compile against different targets I'd prefer to wrap that module as a library behind my own interface. I can then swap out the implementation at compile time. |
|
It looks a lot like how a command-line program has the program name as the zeroth argument. The address just happens to be the name of the program in a blockchain context.
> exposing the blockchain interface as a module feels like it would be a significantly cleaner implementation
I'm not so sure. I think that the goal here is to allow developers to program "DApps" using their normal toolchain and abstract over the semantics of the blockchain platform. IMHO even the ideas of "block" and "chain" are implementation details in the same way as the journal of a traditional database is an implementation detail. Exposing these details as a library means that the program is tied to not only the blockchain, but a particular blockchain runtime.
> wrap that module as a library behind my own interface
That's always a good idea, but not incompatible with having a lower-level interface (in this case WASI and Rust/C++/AsmScript `std`).