| 1 |
Notes on Building WebChucK |
| 2 |
-------------------------- |
| 3 |
winter 2023: this document created (Ge) |
| 4 |
|
| 5 |
WebChucK is built from ChucK core and with an emcripten-based host. |
| 6 |
Both are maintained in the chuck repository: |
| 7 |
https://github.com/ccrma/chuck |
| 8 |
|
| 9 |
In your local clone of the repository, |
| 10 |
chuck/src/core: contains the ChucK compiler, VM, and audio engine |
| 11 |
chuck/host_web: contains the emcripten-based host |
| 12 |
|
| 13 |
|
| 14 |
compiling WebChucK |
| 15 |
------------------ |
| 16 |
1. install emscripten |
| 17 |
https://emscripten.org/docs/getting_started/downloads.html |
| 18 |
|
| 19 |
2. in chuck/src/, first 'make XXX', where XXX is your local platform; |
| 20 |
this is to pick up the lexer and parser generated files. |
| 21 |
(FYI: run 'make' without arguments to see available platform targets) |
| 22 |
|
| 23 |
3. in chuck/src/, next 'make web' |
| 24 |
(may need to source emsdk_env.sh, wherever it's installed from step 1) |
| 25 |
|
| 26 |
4. if the compilation is successful, it should create two files: |
| 27 |
chuck/src/host_web/webchuck/js/webchuck.wasm |
| 28 |
chuck/src/host_web/webchuck/js/webchuck.js |
| 29 |
|
| 30 |
|
| 31 |
deploying webchuck |
| 32 |
------------------ |
| 33 |
WebChucK modules can be deployed on websites; they runs entirely on the |
| 34 |
client-side within web browsers (i.e., no server backend needed). |
| 35 |
|
| 36 |
see webchuck repository |
| 37 |
https://github.com/ccrma/webchuck |
| 38 |
|
| 39 |
helpful overview for creating your own WebChucK project |
| 40 |
https://github.com/ccrma/webchuck/blob/main/README.md |
| 41 |
|
| 42 |
As explained in the README.md above, to deploy WebChucK you only need to |
| 43 |
"link" your HTML/JS files to access three files: webchuck.wasm, |
| 44 |
webchuck.js, and webchuck_host.js. This can either be done |
| 45 |
1) by referencing a CDN service URL from your index.html (easy to get |
| 46 |
started; works with respect to CORS-related HTTP security restrictions) |
| 47 |
2) OR by hosting these three files on your webspace (self-contained; |
| 48 |
does not rely on external CDN services; allows customizing your own |
| 49 |
webchuck_host.js). You can download the most recent versions of these |
| 50 |
files here: https://chuck.stanford.edu/webchuck/src/ |
| 51 |
|
| 52 |
a deployment of WebChucK IDE on the ChucK website |
| 53 |
https://chuck.stanford.edu/webchuck/ |
| 54 |
https://chuck.cs.stanford.edu/webchuck/ |
| 55 |
|
| 56 |
|
| 57 |
---------------- |
| 58 |
"How much web could a WebChucK ChucK if we all could ChucK on the web?" |