Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions game-of-life/asconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"targets": {
"options": {
"runtime": "stub",
"sourceMap": true,
"measure": true
},
"debug": {
"outFile": "build/untouched.wasm",
"textFile": "build/untouched.wat",
"use": "Math=JSMath",
"importMemory": true,
"debug": true
},
"release": {
"outFile": "build/optimized.wasm",
"textFile": "build/optimized.wat",
"use": "Math=JSMath",
"importMemory": true,
"optimizeLevel": 3,
"converge": false,
"shrinkLevel": 0,
"noAssert": false
}
}
}
Binary file modified game-of-life/build/optimized.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions game-of-life/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ <h1>
.then(buffer => WebAssembly.instantiate(buffer, {
env: {
memory,
abort: function() {}
abort: function() {},
"Math.random": Math.random
},
config: {
BGR_ALIVE : rgb2bgr(RGB_ALIVE) | 1, // little endian, LSB must be set
BGR_DEAD : rgb2bgr(RGB_DEAD) & ~1, // little endian, LSB must not be set
BIT_ROT
},
Math
}))
.then(module => {
var exports = module.instance.exports;
Expand Down
4 changes: 2 additions & 2 deletions game-of-life/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --runtime stub --importMemory --sourceMap --debug --measure",
"asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --use Math=JSMath -O3 --runtime stub --importMemory --sourceMap --measure",
"asbuild:untouched": "asc assembly/index.ts --target debug",
"asbuild:optimized": "asc assembly/index.ts --target release",
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
Comment on lines +7 to 9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"asbuild:debug": "asc assembly/index.ts --target debug",
"asbuild:release": "asc assembly/index.ts --target release",
"asbuild": "npm run asbuild:debug && npm run asbuild:release",

Copy link
Member

@MaxGraey MaxGraey Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess better to use new semantics which aligned with npx asinit .

"start": "npx serve"
},
Expand Down
4 changes: 2 additions & 2 deletions i64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"types": "index.d.ts",
"scripts": {
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
"asbuild:untouched": "asc assembly/i64.ts -t build/untouched.wat -b build/untouched.wasm --runtime stub --sourceMap --debug --measure",
"asbuild:optimized": "asc assembly/i64.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts -O3 --runtime stub --sourceMap --measure",
"asbuild:untouched": "asc assembly/i64.ts -t build/untouched.wat -o build/untouched.wasm --runtime stub --sourceMap --debug --measure",
"asbuild:optimized": "asc assembly/i64.ts -t build/optimized.wat -o build/optimized.wasm -O3 --runtime stub --sourceMap --measure",
"test": "node tests"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions libm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"types": "index.d.ts",
"scripts": {
"asbuild": "npm run asbuild:libm && npm run asbuild:libmf",
"asbuild:libm": "asc assembly/libm.ts -O3 -b build/libm.wasm -t build/libm.wat --runtime stub",
"asbuild:libmf": "asc assembly/libmf.ts -O3 -b build/libmf.wasm -t build/libmf.wat --runtime stub",
"asbuild:libm": "asc assembly/libm.ts -O3 -o build/libm.wasm -t build/libm.wat --runtime stub",
"asbuild:libmf": "asc assembly/libmf.ts -O3 -o build/libmf.wasm -t build/libmf.wat --runtime stub",
"test": "node tests"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions mandelbrot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --runtime stub --importMemory --sourceMap --debug --measure",
"asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --use Math=JSMath --runtime stub -O3 --importMemory --sourceMap --measure",
"asbuild:untouched": "asc assembly/index.ts -o build/untouched.wasm -t build/untouched.wat --use Math=JSMath --runtime stub --importMemory --sourceMap --debug --measure",
"asbuild:optimized": "asc assembly/index.ts -o build/optimized.wasm -t build/optimized.wat --use Math=JSMath --runtime stub -O3 --importMemory --sourceMap --measure",
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
"start": "npx serve"
},
Expand Down
Loading