diff options
Diffstat (limited to 'src/blog/2025-06-06-webdev/webdev.md')
| -rw-r--r-- | src/blog/2025-06-06-webdev/webdev.md | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/blog/2025-06-06-webdev/webdev.md b/src/blog/2025-06-06-webdev/webdev.md index 3bf4f9b..b712a85 100644 --- a/src/blog/2025-06-06-webdev/webdev.md +++ b/src/blog/2025-06-06-webdev/webdev.md | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | ## Introduction | 19 | ## Introduction |
| 20 | 20 | ||
| 21 | I have recently worked on making a web application out of | 21 | I have recently worked on making a web application out of |
| 22 | [my latest Rubik's cube optimal solver](https://git.tronto.net/nissy-core/file/README.md.html). | 22 | [my latest Rubik's cube optimal solver](https://git.tronto.net/nissy-core). |
| 23 | This involved building a rather complex C code base (with | 23 | This involved building a rather complex C code base (with |
| 24 | multithreading, SIMD, callback functions and whatnot) to | 24 | multithreading, SIMD, callback functions and whatnot) to |
| 25 | [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly) via | 25 | [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly) via |
| @@ -77,7 +77,7 @@ With this out of the way, let's get started! | |||
| 77 | 77 | ||
| 78 | The examples used in this tutorial are all contained in a git repository, | 78 | The examples used in this tutorial are all contained in a git repository, |
| 79 | which you can find either on | 79 | which you can find either on |
| 80 | [my git page](https://git.tronto.net/emscripten-tutorial/file/README.md.html) or | 80 | [my git page](https://git.tronto.net/emscripten-tutorial) or |
| 81 | [on github](https://github.com/sebastianotronto/emscripten-tutorial). | 81 | [on github](https://github.com/sebastianotronto/emscripten-tutorial). |
| 82 | 82 | ||
| 83 | In order to follow them you are going to need: | 83 | In order to follow them you are going to need: |
| @@ -161,7 +161,7 @@ but in case you are interested you can check out | |||
| 161 | You can find the code for this example, as well as scripts to | 161 | You can find the code for this example, as well as scripts to |
| 162 | build it and run the web server, in the directory `00_hello_world` | 162 | build it and run the web server, in the directory `00_hello_world` |
| 163 | of the git repository | 163 | of the git repository |
| 164 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial/file/README.md.html), | 164 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial), |
| 165 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). | 165 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). |
| 166 | 166 | ||
| 167 | Anyway, now we can build our C code to run in a web page. But this is | 167 | Anyway, now we can build our C code to run in a web page. But this is |
| @@ -324,7 +324,7 @@ The answer is 42 | |||
| 324 | 324 | ||
| 325 | The code for this example can be found in the `01_library` folder in | 325 | The code for this example can be found in the `01_library` folder in |
| 326 | the git repository | 326 | the git repository |
| 327 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial/file/README.md.html), | 327 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial), |
| 328 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). | 328 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). |
| 329 | 329 | ||
| 330 | ## Intermezzo II: JavaScript and the DOM | 330 | ## Intermezzo II: JavaScript and the DOM |
| @@ -593,7 +593,7 @@ is included directly in `script.mjs`. | |||
| 593 | 593 | ||
| 594 | You can find the full the code for this example the folder | 594 | You can find the full the code for this example the folder |
| 595 | `02_library_modularized` in the git repository | 595 | `02_library_modularized` in the git repository |
| 596 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial/file/README.md.html), | 596 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial), |
| 597 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). | 597 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). |
| 598 | 598 | ||
| 599 | ## Multithreading | 599 | ## Multithreading |
| @@ -740,7 +740,7 @@ the server you are using; with darkhttpd you can use the `--header` option. | |||
| 740 | With your server correctly set up, you can enjoy a multithreaded program | 740 | With your server correctly set up, you can enjoy a multithreaded program |
| 741 | running in your browser! As always, you can check out this example from | 741 | running in your browser! As always, you can check out this example from |
| 742 | the `03_threads` folder of the git repository | 742 | the `03_threads` folder of the git repository |
| 743 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial/file/README.md.html), | 743 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial), |
| 744 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). | 744 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). |
| 745 | 745 | ||
| 746 | ## Intermezzo III: Web Workers and Spectre | 746 | ## Intermezzo III: Web Workers and Spectre |
| @@ -860,7 +860,7 @@ whose `data` property contains the object that was sent with `postMessage()`. | |||
| 860 | 860 | ||
| 861 | You can check out this example in the directory `04_no_block` in the | 861 | You can check out this example in the directory `04_no_block` in the |
| 862 | repository | 862 | repository |
| 863 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial/file/README.md.html), | 863 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial), |
| 864 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). | 864 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). |
| 865 | Try also large numbers, in the range of millions or tens of millions, and | 865 | Try also large numbers, in the range of millions or tens of millions, and |
| 866 | compare it with the previous example - but not don't go too large, we | 866 | compare it with the previous example - but not don't go too large, we |
| @@ -948,7 +948,7 @@ Other than that, you just need to add a couple of compiler flags: | |||
| 948 | out module at runtime with `addFunction()`. | 948 | out module at runtime with `addFunction()`. |
| 949 | 949 | ||
| 950 | And as you can check by running the example `05_callback` from the repo | 950 | And as you can check by running the example `05_callback` from the repo |
| 951 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial/file/README.md.html), | 951 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial), |
| 952 | [github](https://github.com/sebastianotronto/emscripten-tutorial)), | 952 | [github](https://github.com/sebastianotronto/emscripten-tutorial)), |
| 953 | everything works as expected, both in Node.js and in a web page. To make | 953 | everything works as expected, both in Node.js and in a web page. To make |
| 954 | the examples more interesting, the web page one is not only not logging the | 954 | the examples more interesting, the web page one is not only not logging the |
| @@ -1120,7 +1120,7 @@ And with all this, we are ready to run our optimized version of the | |||
| 1120 | `primes_in_range()` algorithm, all from within our browser! As always, | 1120 | `primes_in_range()` algorithm, all from within our browser! As always, |
| 1121 | you can check out the complete code in the folder `06_storage` of | 1121 | you can check out the complete code in the folder `06_storage` of |
| 1122 | the repository | 1122 | the repository |
| 1123 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial/file/README.md.html), | 1123 | ([git.tronto.net](https://git.tronto.net/emscripten-tutorial), |
| 1124 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). | 1124 | [github](https://github.com/sebastianotronto/emscripten-tutorial)). |
| 1125 | 1125 | ||
| 1126 | If generating this data on the user's side seems redundant, you can | 1126 | If generating this data on the user's side seems redundant, you can |
