Earlier quoted context omitted.
Wasi co-chair and Wasmtime maintainer here: we agree! Wasi Preview 1, which this article is about, was a first attempt at porting some of these Unix ideas to Wasm. We found pretty quickly that unix isn't the right abstraction for Wasm. Not only is it not really portable to platforms like Windows without reinventing a compatibility layer like cygwin, it also doesn't really make sense in a Web embedding, where users en…
Have you looked at capabilities, like E, Mont-E and its descendants? https://en.wikipedia.org/wiki/Object-capability_model https://monte.readthedocs.io/en/latest/taste.html#cooperatio... https://en.wikipedia.org/wiki/E_(programming_language)
Reaching the Unix philosophy's logical extreme with WebAssembly
21–30 of 142 posts
Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#22Everything is not a file. There are files and file-contents. The content of a file is not a file. The magic trick happens with #SheBang because that tells you who should interpret and execute the file-contents. That is "magic" because in a sense you must read (part of the content) to know how the contents which is just 0s and 1s should be interpreted.
A file is a collection of data, which usually has an associated identifier (filename and/or path). A USB mouse drive is not a file, but it can be represented as such.
Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#23Everything is not a file. There are files and file-contents. The content of a file is not a file. The magic trick happens with #SheBang because that tells you who should interpret and execute the file-contents. That is "magic" because in a sense you must read (part of the content) to know how the contents which is just 0s and 1s should be interpreted.
The word "file" is ambiguous, and was used ambiguously in Unix documentation and papers. It of course meant an object with a name in the filesystem. But it also can refer to an object (whether or not existing on or even referenced by the filesystem) which is accessed using read/write, independent of how you acquired the reference (i.e. file descriptor) to that object. If you look at the whole of the Unix system, read/write over file descriptors is the backbone of the environment; process inheritance, shell redirection... much of the time a program has no idea how a resource reference was acquired, just that it can be accessed using read/write.
Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#24Earlier quoted context omitted.
Wasi co-chair and Wasmtime maintainer here: we agree! Wasi Preview 1, which this article is about, was a first attempt at porting some of these Unix ideas to Wasm. We found pretty quickly that unix isn't the right abstraction for Wasm. Not only is it not really portable to platforms like Windows without reinventing a compatibility layer like cygwin, it also doesn't really make sense in a Web embedding, where users en…
Nothing like reinventing COM :)
Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#25The UNIX philosophy’s logical extreme is the NAND gate. Does one thing, does it well, and can be composed into arbitrary applications.
alias NAND="AND | NEG"
Also, a NAND command would need to have 2 stdin’s.Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#26Earlier quoted context omitted.
Wasi co-chair and Wasmtime maintainer here: we agree! Wasi Preview 1, which this article is about, was a first attempt at porting some of these Unix ideas to Wasm. We found pretty quickly that unix isn't the right abstraction for Wasm. Not only is it not really portable to platforms like Windows without reinventing a compatibility layer like cygwin, it also doesn't really make sense in a Web embedding, where users en…
Nothing like reinventing COM :)
Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#27Earlier quoted context omitted.
Only if the NAND gate is expressed as a file
Okay… please… someone implement ‘nand’ and write a script that does something simple using only it.
Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#28Earlier quoted context omitted.
Okay… please… someone implement ‘nand’ and write a script that does something simple using only it.
Sure! Here's an implementation of nand and a 2-bit adder that uses it: https://github.com/jewel/nand
I’m going to poke around and see how much it would take to stretch this into a basic Turing machine emulator.
Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#29Re: Reaching the Unix philosophy's logical extreme with WebAssembly
#30Or maybe at least Typescript-to-WASM compiler to skip JS output?