design icon indicating copy to clipboard operation
design copied to clipboard

Namespaces

Open SoniEx2 opened this issue 3 years ago • 2 comments

wasm currently has modules. it'd be nice to see fully-featured namespaces as well.

what are namespaces? to put it simply, it's the ability to use arrays of strings as names.

instead of a function being named "foo_bar", it can be named ["foo", "bar"].

that's it, that's the whole feature request.

SoniEx2 avatar Dec 18 '22 01:12 SoniEx2

Withing a module functions are addressed by an index, not a symbolic name. On the other hand, exports and imports use symbolic names. Imported names consist of two strings, which allows them to be used in a manner similar to namespaces. Are you proposing to extend that further or introduce grouping inside of modules as well?

penzn avatar Dec 21 '22 21:12 penzn

exports use simple names, since the module name is controlled outside of the module. the proposal is to use arrays of strings for export names, which implies using arrays of strings for import names.

SoniEx2 avatar Dec 21 '22 21:12 SoniEx2