Just for fun I've added environment variables supp...
# webassembly
e
Just for fun I've added environment variables support in the WASI target. Wasn't that difficult after understanding what the WASI API deals with. I've tried to match the same style used for existing WASM imports. Would like to have it in the stdlib tho 👀 https://github.com/Strumenta/antlr-kotlin/pull/132/commits/68153c173df8b74b8183710f5b434e93e5497f7d
👏 2
s
In case you haven’t seen it, we have (all?) WASI Preview1 APIs implemented in kowasm. Environment variables, for example, are done here. I’d like to eventually see a KMP API for dealing with environment variables. It is an open question whether it should be in stdlib or some kotlinx library.
gratitude thank you 1
e
Ah nice! Wasn't aware of that repo, thanks. Just a pity it's not easily accessible through published artifacts.
You also have file system APIs 👀 could be useful for kotlinx-io.
Overall it looks like environment variables could be totally multiplatform. The only target without access seems to be JS/browser. For native posix can be used on every platform I think.