-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebAssembly Backend #142
Closed
Closed
WebAssembly Backend #142
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Patrik Keller <[email protected]>
I'm struggling with RuntimeOpRecDot. make -C tests wasm I need debugger access to the generated wasm and provided ejson argument.
This PoC demonstrates how Assemblyscript could be used to implement a runtime for imp_ejson. The next step on this road would be to implement a pair functions that read/write JS Ejson from/to Assemblyscript's managed memory.
This commit adds a pair of functions that read/write JS Ejson from/to Assemblyscript's managed memory. Executing a imp function compiled to wasm is now easy. Next steps: - Test the set op implemented operators. - Hook the new runtime into the compiler pipeline.
The runtime allows to run qcert queries compiled to wasm modules in chrome. DevTools enable stepwise debugging. This predates the recent effort to implement the IMP operators in Assemblyscript.
This commit removes the Imp(Wasm) runtime operators that have been implemented before. Instead we call imported functions. These functions are defined in an Assemblyscript module. As a side effect, we lost support for constants and EjsonRuntimeOperator(s). Next steps: - Unit test the set op implemented operators. - Provide engine that links the compiled module with the runtime. - Compile constants - Support EjsonRuntimeOperator(s).
This commit add a PoC engine that executes a compiled to wasm qcert query on NodeJS. It dynamically links the IMP runtime that we implement in AssemblyScript and compile to a separate wasm module.
We can compile the following OQL queries: 3.14 not (true or false) 3.14 <. 4.5 pi pi <. e greet And execute them on input: { "pi" : 3.14, "e" : 2.72, "greet" : "Hello World!" }
Before, each use of an IMP constant lead to a fresh allocation in the AssemblyScript runtime. Additionally, strings were entirely encoded in the AST (as function that allocate and inititalize the corresponding string in the runtime). Now, constants are serialized into the linear memory of the compiled module. On first use, a corresponding value is allocated in the memory of the AssemblyScript runtime. Repeated use of a constant uses the same value on the runtime side.
We now use the AssemblyScript runtime. The old runtime is not needed anymore.
- Make explicit, that be transfer bytes of an UTF8 string. - Allocate a single, correctly sized buffer on the runtime side.
Avoids headache on Javascript/Wasm interface.
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
- fixes incompatibility with node ("invalid block type error" when loading compiled wasm module) - removes dependencies to wat2wasm/wasm2wat
Before, if-then-else became if-then-then Signed-off-by: Patrik Keller <[email protected]>
Q*cert's `EJsonRuntimeCompare a b` returns sign(b - a). Before this fix the Wasm implementation of this operator returned sign(a - b). Signed-off-by: Patrik Keller <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Patrik Keller <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
- derive the expected output from Imp eval. - avoid bash for loop for iteration
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
Signed-off-by: Jerome Simeon <[email protected]>
- add a small binary (tools/binary_to_string.(ml|exe) that escapes a binary string to a valid OCaml string using hex codes. - add a dune rule that reads binary runtime.wasm into a generated ml file. - use the resulting OCaml value in for the wasm spec eval.
Signed-off-by: Jerome Simeon <[email protected]>
pkel
approved these changes
Aug 24, 2020
Replaced by #147 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WASM backend