I have found your project while searching around for existing solutions to get a (lightweight) POSIX like environment abstracted in the browser.
Some background:
With xterm.js we often get requests how to run a command/shell locally in the browser (like some own REPL). This is not easy to get done right, since xterm.js is just a terminal emulator that needs to run through a pty/tty to get the typical terminal interface behavior. Thus I started a pty project also to run solely in the browser mimicking parts of that behavior (very early stage: https://github.com/jerch/browser-fakepty). And ofc, since the TTY interface is a core POSIX feature it pulls more and more POSIX concepts into the project.
I kinda approach the "POSIX problem" from the terminal interface (high level behavior to fullfill typical user expectations), and do most things as lightweight JS implementation (a "process" can just be a JS function with all drawbacks of cooperative multitasking, no isolation whatsoever).
I saw that browsix approaches the "problem" from the other side - with syscalls into its own kernel and as a C compile target. While I started to write my own subset of needed syscalls (for file interface) and a stripped down process management (init process as kernel shim) I wonder if browsix would be a better starting point than doing all as handwritten JS shims.
I did not look up your code, whether you already have a TTY interface integrated (sorry for that) - just tested your terminal browser example (which does not seem to expose the more complex TTY/termios features).
So my questions are:
What is the state of the TTY interface in browsix?
Note that I am not interested in ancient features like full modem/serial support, basically I'd love to get the common termios flags working (ICANON, raw/cooked and such), rather on JS level than by doing C/emscripten compilation. (Once if the JS shim is capable enough this can be bridged later on into C realms).
What do you think, would it make sense to combine the efforts to get something rolling?
I have found your project while searching around for existing solutions to get a (lightweight) POSIX like environment abstracted in the browser.
Some background: With xterm.js we often get requests how to run a command/shell locally in the browser (like some own REPL). This is not easy to get done right, since xterm.js is just a terminal emulator that needs to run through a pty/tty to get the typical terminal interface behavior. Thus I started a pty project also to run solely in the browser mimicking parts of that behavior (very early stage: https://github.com/jerch/browser-fakepty). And ofc, since the TTY interface is a core POSIX feature it pulls more and more POSIX concepts into the project.
I kinda approach the "POSIX problem" from the terminal interface (high level behavior to fullfill typical user expectations), and do most things as lightweight JS implementation (a "process" can just be a JS function with all drawbacks of cooperative multitasking, no isolation whatsoever).
I saw that browsix approaches the "problem" from the other side - with syscalls into its own kernel and as a C compile target. While I started to write my own subset of needed syscalls (for file interface) and a stripped down process management (
init
process as kernel shim) I wonder if browsix would be a better starting point than doing all as handwritten JS shims.I did not look up your code, whether you already have a TTY interface integrated (sorry for that) - just tested your terminal browser example (which does not seem to expose the more complex TTY/termios features).
So my questions are: