From 20fc12c529c1f29596ada9507c44f18c30a9b371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Faria?= Date: Mon, 8 Apr 2024 17:01:39 +0100 Subject: [PATCH] feat(examples): add example demonstrating wasm playback in browser --- .gitignore | 3 +- examples/code/wasm/README.md | 14 ++++++++ examples/code/wasm/index.html | 51 ++++++++++++++++++++++++++++ examples/code/wasm/test_chords.wasm | Bin 0 -> 1396 bytes 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 examples/code/wasm/README.md create mode 100644 examples/code/wasm/index.html create mode 100644 examples/code/wasm/test_chords.wasm diff --git a/.gitignore b/.gitignore index 394a03a..529a75c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,5 @@ actual_output/ *.exe *.dll -**/testdata/fuzz/ \ No newline at end of file +**/testdata/fuzz/ +.DS_Store \ No newline at end of file diff --git a/examples/code/wasm/README.md b/examples/code/wasm/README.md new file mode 100644 index 0000000..a2c4aea --- /dev/null +++ b/examples/code/wasm/README.md @@ -0,0 +1,14 @@ +Requirements: sointu binaries, `wabt` + +To generate the .wasm file: + +``` +sointu-compile -o . -arch=wasm tests/test_chords.yml +wat2wasm --enable-bulk-memory test_chords.wat +``` + +To run the example: + +``` +npx serve examples/code/wasm +``` diff --git a/examples/code/wasm/index.html b/examples/code/wasm/index.html new file mode 100644 index 0000000..9429b3e --- /dev/null +++ b/examples/code/wasm/index.html @@ -0,0 +1,51 @@ + + + + sointu WASM example + + + + + + diff --git a/examples/code/wasm/test_chords.wasm b/examples/code/wasm/test_chords.wasm new file mode 100644 index 0000000000000000000000000000000000000000..087c77151340f51d9e180c772cd9730e5ac0ff46 GIT binary patch literal 1396 zcmbVLF>hQ&5T2Rc_wL>8+1@j8ilkuQ?Gp-?B3ZE%PAJH4bC?i?iUyj93lc&(+a!@u zs7~)uP$407J_98MLMW|&0EUiVkOF=R1>ZcoprGPTJG0;H%+5En^XSp>5fc&b3})QW zOco1X%vc3=o6ZC)U^63v6U@>yB-acdnWs;_Am$@`_~g@DBrqI5{*1(2-7?15EbsMt zdN~zEAuN4s`6*?YVcN(ajv7wn{+D14YfUG=DqKUUy;LuE6_M+WEFTH+v03Lsv%#Mm zUvR%aU`p)l+WOEBekitj6o=aa?@n9i$eTD!c3usghb`HIY8Z!sCUD9ra3Hr%QEn1M z;&~xIn25e>*M9+?Gp)Ccv)^^Ag1(Pe}ol9*jjZoiS&PsUzdkk|HY)jz~)L ziq!r2m@T?d3YGy432=S?zO5q#GcS?b7iUuw?m1_daY;E^O*KU#t5x60Hmd{Kgf-^4Rx zzWt`&apyG1vb$gFpfgY?o?Tx~e}3`et(Ctr-TC;{$@H&JexF<%th6jzj!iJ%oQw@- z8jVH;mzL5bgK{jK&j~FJco@G?W-esP#c!qTg3&eVat07So&LG;N4@f*V0PWzVs0?Z zm>u>RXpUBaH79bVpZ?Q~Zw_y454SN0ZWDVy(%b75WV?5Q&kdXN-_(wh;N6`9l6y_P zuVO%vyYmi6tNlP+ps$hoWO=&6ha5Dh{q_6q=sV0*AY1zkjr5q?gmBE4qJxUiapxW~ xtnPyvMBc`_i?xrX;NIo_zG9#Ukh*_QA&ZE$y*}0Wg-(1}Q(L$7rE0UB_#Zpy#vT9w literal 0 HcmV?d00001