charlietap / chasm Goto Github PK
View Code? Open in Web Editor NEWA WebAssembly runtime built on Kotlin Multiplatform
License: Apache License 2.0
A WebAssembly runtime built on Kotlin Multiplatform
License: Apache License 2.0
Hi @CharlieTap , we love this library.
We noticed that you mentioned WASI (or maybe WASI2 makes more sense) support with regards to this. We'd be interested in sponsoring the development of these bindings for the library. Please reach out to me at [email protected] to discuss.
How to reproduce: remove JVM_21 on your machine, run gradle sync.
I've fixed that by removing all jvmToolchains
from gradle.plugins
conventions. Seems like the build is working now.
I attempted to use this library to execute WebAssembly code but encountered StackOverflowError exception in MemoryInitExecutorImpl and in TableInitExecutorImpl functions. Here are the stack traces:
java.lang.StackOverflowError
at io.github.charlietap.chasm.executor.invoker.instruction.memory.store.I32StoreSizedExecutorImplKt$I32StoreSizedExecutorImpl$2.invoke-Zyo9ksc(I32StoreSizedExecutorImpl.kt)
at io.github.charlietap.chasm.executor.invoker.instruction.memory.store.I32StoreSizedExecutorImplKt$I32StoreSizedExecutorImpl$2.invoke(I32StoreSizedExecutorImpl.kt:38)
at io.github.charlietap.chasm.executor.invoker.instruction.memory.MemoryInitExecutorImplKt$MemoryInitExecutorImpl$1.invoke-MJidatI(MemoryInitExecutorImpl.kt:97)
at io.github.charlietap.chasm.executor.invoker.instruction.memory.MemoryInitExecutorImplKt$MemoryInitExecutorImpl$1.invoke(MemoryInitExecutorImpl.kt:33)
at io.github.charlietap.chasm.executor.invoker.instruction.memory.MemoryInitExecutorImplKt.MemoryInitExecutorImpl-O0yBkHM(MemoryInitExecutorImpl.kt:64)
at io.github.charlietap.chasm.executor.invoker.instruction.memory.MemoryInitExecutorImplKt.MemoryInitExecutorImpl-O0yBkHM(MemoryInitExecutorImpl.kt:70)
java.lang.StackOverflowError
at io.github.charlietap.chasm.executor.runtime.Stack.peekFrameOrNull(Stack.kt:51)
at io.github.charlietap.chasm.executor.invoker.instruction.table.TableInitExecutorImplKt$TableInitExecutorImpl$1.invoke-gl31Vf4(TableInitExecutorImpl.kt:86)
at io.github.charlietap.chasm.executor.invoker.instruction.table.TableInitExecutorImplKt$TableInitExecutorImpl$1.invoke(TableInitExecutorImpl.kt:31)
at io.github.charlietap.chasm.executor.invoker.instruction.table.TableInitExecutorImplKt.TableInitExecutorImpl(TableInitExecutorImpl.kt:68)
at io.github.charlietap.chasm.executor.invoker.instruction.table.TableInitExecutorImplKt.TableInitExecutorImpl(TableInitExecutorImpl.kt:74)
at io.github.charlietap.chasm.executor.invoker.instruction.table.TableInitExecutorImplKt.TableInitExecutorImpl(TableInitExecutorImpl.kt:74)
In version 0.2.2 of the library, I also faced StackOverflowError in MemoryCopyExecutorImpl and MemoryFillExecutorImpl. However, I see that these were fixed in version 0.6.0, and I no longer see those errors.
As a workaround, I made a MemoryInitExecutorImpl and TableInitExecutorImpl tailrec: diff. This fixes the error, but I think there should be a more elegant solution.
This is a repository where I'm experimenting with running WebAssembly code: https://github.com/illarionov/wasm-sqlite-open-helper/tree/chasmDevel.
If you require it, I can later attempt to create a smaller reproducible example.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.