-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from ttulka/update_to_as_0_20
Update to as 0.20.x
- Loading branch information
Showing
34 changed files
with
324 additions
and
399 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
{ | ||
"targets": { | ||
"debug": { | ||
"binaryFile": "build/untouched.wasm", | ||
"textFile": "build/untouched.wat", | ||
"outFile": "build/debug.wasm", | ||
"textFile": "build/debug.wat", | ||
"sourceMap": true, | ||
"debug": true | ||
}, | ||
"release": { | ||
"binaryFile": "build/optimized.wasm", | ||
"textFile": "build/optimized.wat", | ||
"outFile": "build/release.wasm", | ||
"textFile": "build/release.wat", | ||
"sourceMap": true, | ||
"optimizeLevel": 3, | ||
"shrinkLevel": 1, | ||
"converge": true, | ||
"noAssert": true | ||
}, | ||
"test": { | ||
"debug": true | ||
} | ||
}, | ||
"options": { | ||
"exportRuntime": true | ||
"exportRuntime": true, | ||
"bindings": "esm" | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
{ | ||
"targets": { | ||
"debug": { | ||
"binaryFile": "build/untouched.wasm", | ||
"textFile": "build/untouched.wat", | ||
"outFile": "build/debug.wasm", | ||
"textFile": "build/debug.wat", | ||
"sourceMap": true, | ||
"debug": true | ||
}, | ||
"release": { | ||
"binaryFile": "build/optimized.wasm", | ||
"textFile": "build/optimized.wat", | ||
"outFile": "build/release.wasm", | ||
"textFile": "build/release.wat", | ||
"sourceMap": true, | ||
"optimizeLevel": 3, | ||
"shrinkLevel": 1, | ||
"converge": false, | ||
"noAssert": false | ||
} | ||
}, | ||
"options": {} | ||
"options": { | ||
"exportRuntime": true, | ||
"bindings": "esm" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Big from 'as-big/Big'; | ||
import Big from 'as-big'; | ||
|
||
export function basics0(): number { | ||
|
||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
const fs = require("fs"); | ||
const loader = require("@assemblyscript/loader"); | ||
const wasm = loader.instantiateSync(fs.readFileSync(__dirname + "/build/optimized.wasm"), {}); | ||
module.exports = wasm.exports; | ||
import { | ||
basics0, basics1, basics2, basics3, | ||
pi, pi_native, | ||
euler, euler_native, | ||
rump, rump_native | ||
} from "./build/release.js"; | ||
|
||
const { __getString } = wasm.exports; | ||
export { basics0, basics1, basics2, basics3 }; | ||
|
||
console.log('Basics #0:', wasm.exports.basics0()); | ||
console.log('Basics #1:', wasm.exports.basics1()); | ||
console.log('Basics #2:', __getString(wasm.exports.basics2())); | ||
console.log('Basics #3:', wasm.exports.basics3()); | ||
console.log('Basics #0:', basics0()); | ||
console.log('Basics #1:', basics1()); | ||
console.log('Basics #2:', basics2()); | ||
console.log('Basics #3:', basics3()); | ||
|
||
console.log('Pi constant (native):', (wasm.exports.pi_native(10000))); | ||
console.log('Pi constant (Big): ', __getString(wasm.exports.pi(10000, 100))); | ||
console.log('Pi constant (native):', pi_native(10000)); | ||
console.log('Pi constant (Big): ', pi(10000, 100)); | ||
|
||
console.log('Euler’s constant (native):', wasm.exports.euler_native(100)); | ||
console.log('Euler’s constant (Big): ', __getString(wasm.exports.euler(100, 100))); | ||
console.log('Euler’s constant (native):', euler_native(100)); | ||
console.log('Euler’s constant (Big): ', euler(100, 100)); | ||
|
||
console.log('Rump’s Royal Pain (native):', wasm.exports.rump_native()); | ||
console.log('Rump’s Royal Pain (Big): ', __getString(wasm.exports.rump())); | ||
console.log('Rump’s Royal Pain (native):', rump_native()); | ||
console.log('Rump’s Royal Pain (Big): ', rump()); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.