sdeleuze
12/23/2022, 7:01 PMSvyatoslav Kuzmich [JB]
12/23/2022, 7:04 PMSvyatoslav Kuzmich [JB]
12/23/2022, 7:08 PMsdeleuze
12/23/2022, 7:43 PMsdeleuze
12/23/2022, 7:43 PMsdeleuze
12/23/2022, 7:45 PMsdeleuze
12/23/2022, 7:50 PMSvyatoslav Kuzmich [JB]
12/23/2022, 7:57 PMSvyatoslav Kuzmich [JB]
12/24/2022, 7:10 AMsdeleuze
12/25/2022, 8:05 PMsdeleuze
12/25/2022, 8:07 PMTEST-kotlinx.wasi.WasiTests.xml
contains:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="kotlinx.wasi.WasiTests" tests="5" skipped="0" failures="0" errors="0" timestamp="2022-12-25T19:44:57" hostname="m1" time="0.005">
<properties/>
<testcase name="Test_args_sizes_get[wasm, node]" classname="kotlinx.wasi.WasiTests" time="0.001"/>
<testcase name="Test_args_get[wasm, node]" classname="kotlinx.wasi.WasiTests" time="0.001"/>
<testcase name="Test_environ_sizes_get[wasm, node]" classname="kotlinx.wasi.WasiTests" time="0.0"/>
<testcase name="Test_environ_get[wasm, node]" classname="kotlinx.wasi.WasiTests" time="0.0"/>
<testcase name="testPrintln[wasm, node]" classname="kotlinx.wasi.WasiTests" time="0.002"/>
<system-out><![CDATA[PATH=/usr/local/bin:/usr/bin
HOME=/Users/ě´ě¤
WASI error: WasiError: WASI call failed with INVAL
WASI error: WasiError: WASI call failed with INVAL
WASI error: WasiError: WASI call failed with INVAL
WASI error: WasiError: WASI call failed with BADF
WASI error: WasiError: WASI call failed with BADF
WASI error: WasiError: WASI call failed with BADF
]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
Is it expected?Svyatoslav Kuzmich [JB]
12/25/2022, 8:08 PMsdeleuze
12/25/2022, 8:09 PMkotlin.wasm.unsafe.
API?sdeleuze
12/25/2022, 8:09 PMsdeleuze
12/25/2022, 8:09 PMSvyatoslav Kuzmich [JB]
12/25/2022, 8:09 PMsdeleuze
12/30/2022, 4:19 PMSvyatoslav Kuzmich [JB]
12/30/2022, 5:19 PMlatin1+utf16
encoding variants. It seems that conversion will happen only if different sides of interface have different supported string encodings.
Even if encodings are incompatible, there are different techniques to reduce overhead. We could do lazy conversion only when we actually access characters by index. We could also do a technique similar to Swiftâs breadcrumbs, where we could keep source encoding without copy but allow somewhat costly, but amortised O(1) access to UTF-16 characters.
There is also a stringref proposal, an abstraction over these multiple-encodings-at-once approach that could become a standard.Svyatoslav Kuzmich [JB]
12/30/2022, 6:08 PMkotlin.wasm.unsafe.*
and WasmImport
are now merged into master with a few changes. Allocator scopes can now be nested. And Pointer is now a value class with load and store methods.
Gradle configuration of nodeJsArgs
used in my experiments is not merged yet.Svyatoslav Kuzmich [JB]
12/30/2022, 6:11 PMsdeleuze
12/30/2022, 6:44 PMsdeleuze
12/30/2022, 6:45 PMsdeleuze
01/01/2023, 1:53 PMkotlin.wasm.unsafe.*
API, Kotlin/Native cinterop, etc.
Current API provide access to individual Byte
to Long
values, do you have already in mind what could be possible in term of exposing byte arrays access. Does it make sense to expose an API hat allow to store/load byte arrays from a Pointer
+ a size ? Would that involve copying those data or can we achieve zero copy interop? What types would be involved (ByteArray
, something else)?Svyatoslav Kuzmich [JB]
01/01/2023, 3:39 PMsdeleuze
01/01/2023, 6:42 PMsdeleuze
01/01/2023, 6:43 PMkotlin { wasm { wasi() } }
Gradle configuration? If that's the case, println()
and similar methods could just use WASI capability to print to standard output?sdeleuze
01/01/2023, 6:45 PMsdeleuze
01/01/2023, 6:46 PMsdeleuze
01/01/2023, 6:46 PMsdeleuze
01/01/2023, 6:46 PMsdeleuze
01/01/2023, 6:47 PMsdeleuze
01/01/2023, 6:47 PMsdeleuze
01/01/2023, 6:47 PMsdeleuze
01/01/2023, 6:48 PMSvyatoslav Kuzmich [JB]
01/01/2023, 6:51 PMIf at some point Kolin/Wasm supports WASI/WIT, would we have potentially aI think so. JS and WASI seems like a two leading âsystem interfacesâ for Wasm that should warrant first-party support.Gradle configuration? If thatâs the case,kotlin { wasm { wasi() } }
and similar methods could just use WASI capability to print to standard output?println()
Svyatoslav Kuzmich [JB]
01/01/2023, 7:02 PMsdeleuze
01/01/2023, 7:03 PMsdeleuze
01/01/2023, 7:21 PMnodeJsArgs
is merged.Svyatoslav Kuzmich [JB]
01/02/2023, 12:35 PMnodeJsArgs
support is merged.
Repo https://github.com/skuzmich/kotlin-wasi-bindings-experiments is now updated to be compatible with master.sdeleuze
01/04/2023, 7:47 AMsdeleuze
01/04/2023, 8:01 AMSvyatoslav Kuzmich [JB]
01/04/2023, 8:57 AMsdeleuze
01/04/2023, 8:57 AMSvyatoslav Kuzmich [JB]
01/04/2023, 9:00 AM