aboutsummaryrefslogtreecommitdiff
path: root/src/blog/2025-06-06-webdev/webdev.md
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-08-30 18:35:23 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-08-30 18:35:23 +0200
commit5e3b4b6c21d33b28e60ce976479339f72d544a6c (patch)
tree0e5a101d4944e7dd5a99606344b6a6807a9a5606 /src/blog/2025-06-06-webdev/webdev.md
parentd3f0841cfdd229ff16b8a230117737a435fc7a56 (diff)
downloadsebastiano.tronto.net-5e3b4b6c21d33b28e60ce976479339f72d544a6c.tar.gz
sebastiano.tronto.net-5e3b4b6c21d33b28e60ce976479339f72d544a6c.zip
Switch from stagit to cgit
Diffstat (limited to 'src/blog/2025-06-06-webdev/webdev.md')
-rw-r--r--src/blog/2025-06-06-webdev/webdev.md18
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
21I have recently worked on making a web application out of 21I 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).
23This involved building a rather complex C code base (with 23This involved building a rather complex C code base (with
24multithreading, SIMD, callback functions and whatnot) to 24multithreading, 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
78The examples used in this tutorial are all contained in a git repository, 78The examples used in this tutorial are all contained in a git repository,
79which you can find either on 79which 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
83In order to follow them you are going to need: 83In order to follow them you are going to need:
@@ -161,7 +161,7 @@ but in case you are interested you can check out
161You can find the code for this example, as well as scripts to 161You can find the code for this example, as well as scripts to
162build it and run the web server, in the directory `00_hello_world` 162build it and run the web server, in the directory `00_hello_world`
163of the git repository 163of 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
167Anyway, now we can build our C code to run in a web page. But this is 167Anyway, 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
325The code for this example can be found in the `01_library` folder in 325The code for this example can be found in the `01_library` folder in
326the git repository 326the 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
594You can find the full the code for this example the folder 594You 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.
740With your server correctly set up, you can enjoy a multithreaded program 740With your server correctly set up, you can enjoy a multithreaded program
741running in your browser! As always, you can check out this example from 741running in your browser! As always, you can check out this example from
742the `03_threads` folder of the git repository 742the `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
861You can check out this example in the directory `04_no_block` in the 861You can check out this example in the directory `04_no_block` in the
862repository 862repository
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)).
865Try also large numbers, in the range of millions or tens of millions, and 865Try also large numbers, in the range of millions or tens of millions, and
866compare it with the previous example - but not don't go too large, we 866compare 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
950And as you can check by running the example `05_callback` from the repo 950And 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)),
953everything works as expected, both in Node.js and in a web page. To make 953everything works as expected, both in Node.js and in a web page. To make
954the examples more interesting, the web page one is not only not logging the 954the 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,
1121you can check out the complete code in the folder `06_storage` of 1121you can check out the complete code in the folder `06_storage` of
1122the repository 1122the 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
1126If generating this data on the user's side seems redundant, you can 1126If generating this data on the user's side seems redundant, you can

Generated with cgit - Back to sebastiano.tronto.net