Can someone explain what can be the use case for this?
Can someone explain what can be the use case for this?
> enabling unmodified programs expecting a Unix-like environment to run directly in the browser
The latex example is probably the best example. There are a handful of latex typesetter web pages, but the "quick and dirty" implementation for all of them are something like:
(1) take the input (2) shell out to run the latex app on a unix box (3) return the output to the user via the browser
Step (2) requires a complete unix environment. As usage scales, so too does the processing power required. Imagine if that app got 10k requests/second: suddenly you have a farm of "rendering servers" and middleware managing availability, request routing, etc.
This allows you to offload step (2) to the user's browser for a broader range of applications, with easier/faster/less rewriting. While the upfront cost is still more complex if you have to port the app to this js platform, there may be long term savings in simplicity/efficiency from the reduced server requirements. e.g., you could reduce the latex typesetting webapp to static files served from S3.
\begin{align}
x &= 2^2
\intertext{so we can simplify}
&= 4
\end{align}
With a little bit of fanciness (sourcing the .sty sheets) behind the scenes, this could faithfully reproduce LaTeX.[1] https://github.com/mathjax/MathJax/issues/736
Edit: formatting
It's also a good project to learn about both the web and POSIX. Not that this kind of project is required when applying to job but it would seriously catch my attention when reviewing a candidate for any web or systems job. It's also top of hacker news so it's an excellent way to get your name out there.
This being possible is a glaring deficiency of the Web, and an example of how it is stalling the state of the art.
you're emulating a filesystem inside the browser to manage files. while you have highly advanced filesystems sitting outside the browser with direct access to NVMe SSDs, much lower power consumption and all that. But nope, "do it in the browser" nullifies all the advances that native makes.
I've been wanting something like this for ages (and have had a few ideas along those lines myself)...
The description of the technology glosses over all the really difficult bits, however, like how they turn compiled C into runnable Javascript. Emscripten? An interpreter? Gods help them, they're not using Clue, are they? How much overhead is there in executing the compiled code in chunks so that they can simulating blocking RPCs (for system calls)? Do they have a plan for threads? (I don't believe web workers support any kind of shared-memory threading.)
(later)
I found a demo here: https://unix.bpowers.net/
Inspecting the code shows lots of Emscripten stuff.
edit: found this http://bellard.org/jslinux/tech.html and this http://bellard.org/jslinux/