News for hackers. Stuff that matters.
Re:Run Unix processes inside your browser by digi_owl on Sunday December 11, 2016 @11:20AM (#13151693)
Their github may be more informative.

https://github.com/plasma-umass/browsix

Seems they are using web workers to implement a POSIX environment.

And their shell demo do not even support cd(!).

Re:Run Unix processes inside your browser by jamescostian on Sunday December 11, 2016 @12:12PM (#13151963)
It seems they only have these binaries available on their shell demo:

``` $ ls /usr/bin cat cp curl echo exec grep head ld ls mkdir nice node rm rmdir sh sha1sum sort stat tail tee touch wc xargs ```

Re:Run Unix processes inside your browser by chei0iaV on Sunday December 11, 2016 @12:21PM (#13152001)
It doesn't support a lot of very basic things, like variables

    $ TEST=1
    $ echo $TEST
    $TEST
Interestingly, in the example they show:

    $ cat README | while read L; do echo "README: $L"; done
    
...and yet:

    $ read L
    /usr/bin/read: command not found
    $ while true; do break; done
    /usr/bin/while: command not found
    $ echo "quotes"
    "quotes"
Seems like a horribly backwards approach to implementing a posix shell...
Re:Run Unix processes inside your browser by userbinator on Sunday December 11, 2016 @12:30PM (#13152041)
This is apparently the source code for it:

https://github.com/plasma-umass/browsix/blob/master/src/bin/...

It doesn't do much, and certainly does not qualify as being unmodified existing code (which is what this whole system is supposed to be able to run as one of its benefits.)

Re:Run Unix processes inside your browser by nteon on Sunday December 11, 2016 @04:51PM (#13153545)
That was our first shell we used for debugging before we had emscripten working.

The shell currently used in the demo is dash, compiled with emscripten: https://github.com/plasma-umass/browsix/blob/master/src/dash...

Which ends up in the build through our gulpfile: https://github.com/plasma-umass/browsix/blob/master/gulpfile...

Re:Run Unix processes inside your browser by ris on Sunday December 11, 2016 @02:52PM (#13152788)
Surely one can just compile bash for browsix though?
Re:Run Unix processes inside your browser by nteon on Sunday December 11, 2016 @04:15PM (#13153295)
That example is actually running dash - the Debian Almquist shell.

The weirdness (and reason that cd + setting variables doesn't work) is because whenever you type a command in, it executes:

$ dash -c '$COMMAND'

Rather than having a long-running shell process listing to standard in. We plan to fix this and implement a full TTY subsystem in the next month or so.

Re:Run Unix processes inside your browser by ori_b on Sunday December 11, 2016 @03:19PM (#13152958)
Probably not. If you read the source, This thing has no real idea of processes.
Re:Run Unix processes inside your browser by userbinator on Sunday December 11, 2016 @12:19PM (#13151989)
And their shell demo do not even support cd(!).

That means their claim that "Unmodified C, C++, Go, and Node.js programs run as processes on Web Workers"

...is not true, as otherwise they could've just "compiled" e.g. bash or some other shell to run on their system, along with GNU coreutils or similar.

Re:Run Unix processes inside your browser by nteon on Sunday December 11, 2016 @04:40PM (#13153467)
The shell is dash, compiled from C. We run each command as

dash -c "$COMMAND"

Processes can change their current directory (We support the chdir(2) system call), but the way the shell demo is currently implemented no state is retained between command invocations. We plan to address this shortcoming soon as part of a bigger TTY refactoring.

Re:Run Unix processes inside your browser by roblabla on Sunday December 11, 2016 @01:34PM (#13152367)
My guess is, they can, it's just horrendously slow.