Merge pull request #291 from mipt-npm/commandertvis/readme-ast

Update README.md
This commit is contained in:
Iaroslav Postovalov 2021-04-26 08:47:45 +07:00 committed by GitHub
commit 1f71b5333a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -50,7 +50,7 @@ For example, the following builder:
MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField) MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField)
``` ```
leads to generation of bytecode, which can be decompiled to the following Java class: ... leads to generation of bytecode, which can be decompiled to the following Java class:
```java ```java
package space.kscience.kmath.asm.generated; package space.kscience.kmath.asm.generated;
@ -97,6 +97,7 @@ var executable = function (constants, arguments) {
}; };
``` ```
JS also supports very experimental expression optimization with [WebAssembly](https://webassembly.org/) IR generation. Currently, only expressions inside `DoubleField` and `IntRing` are supported.
```kotlin ```kotlin
import space.kscience.kmath.wasm.* import space.kscience.kmath.wasm.*
@ -104,7 +105,7 @@ import space.kscience.kmath.wasm.*
MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField) MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField)
``` ```
An example of emitted WASM IR in the form of WAT: An example of emitted Wasm IR in the form of WAT:
```lisp ```lisp
(func $executable (param $0 f64) (result f64) (func $executable (param $0 f64) (result f64)

View File

@ -19,7 +19,7 @@ For example, the following builder:
MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField) MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField)
``` ```
leads to generation of bytecode, which can be decompiled to the following Java class: ... leads to generation of bytecode, which can be decompiled to the following Java class:
```java ```java
package space.kscience.kmath.asm.generated; package space.kscience.kmath.asm.generated;
@ -66,6 +66,7 @@ var executable = function (constants, arguments) {
}; };
``` ```
JS also supports very experimental expression optimization with [WebAssembly](https://webassembly.org/) IR generation. Currently, only expressions inside `DoubleField` and `IntRing` are supported.
```kotlin ```kotlin
import space.kscience.kmath.wasm.* import space.kscience.kmath.wasm.*
@ -73,7 +74,7 @@ import space.kscience.kmath.wasm.*
MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField) MstField { bindSymbol("x") + 2 }.compileToExpression(DoubleField)
``` ```
An example of emitted WASM IR in the form of WAT: An example of emitted Wasm IR in the form of WAT:
```lisp ```lisp
(func \$executable (param \$0 f64) (result f64) (func \$executable (param \$0 f64) (result f64)