Sorry for the basic question here. I'm trying to wrap my head around Emscripten, ASM.js, and compiling lower level languages to javascript.
Here is what I don't understand. You can do things in a native C program that you can't (and shouldn't) do in browser based js. For example, in a native app you can access or the file system or shut the computer down.
Suppose I wrote a C program that reads /etc/passwd and then shuts the computer down. Then, I compiled that program to js and popped it in a <script>
tag. What would happen when I visit the page with the <script>
tag in it? Obviously, it's not going to shut the computer down, but would it even compile?
It just seems to me that javascript running in a browser is so limited compared to lower level languages that I can't see how any meaningful applications can be simply compiled to js without totally breaking it.