Live data from Hacker News

Reaching the Unix philosophy's logical extreme with WebAssembly

xeiaso.net

101–110 of 142 posts

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#101
post #88
post #68

Earlier quoted context omitted.

Java (like mentioned in the article) does the same though IIRC Inferno OS is like Java in this regard. How will WASM change what Java has already done? Why would I compile Rust to WASM when I can compile Rust natively to any number of platforms? And use FFI? I think WASM, while nice, doesn't bring much new to the table. It's been hyped for years, and I still only see it used here and there very sparingly.

This is how. The installed size of OpenJDK 17 JRE on my machine is 186MB, according to the package manager. I suspect that the WASM VM embedded in the program demonstrated in the blog post is 1.5 to 2 orders of magnitude smaller.

There is no such thing as a JRE anymore, the way to package a Java application for quite some time now is by using jlink/jpackage that creates a stripped “JRE” of only the used modules helping both the size and loading times.

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#102
post #10

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…

Nothing like reinventing COM :)

Nobody has a good IPC/RPC-based abstraction set right now. And everybody is kind of struggling with that.

Look at the latest Microsoft thing about embedding Python in Excel. They're going the wrong direction. What everybody wants is to be able to drive Excel from Python aka an API that people could hook into.

Even WASM is kind of ... weak ... because it has to deal with the lowest common denominator--a web page with a single thread of execution and no access to anything.

And, COM wasn't terrible--it's just that the languages attempting to support it were very underpowered at the time. COM with VB6 created a huge ecosystem that probably still isn't really matched today.

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#103
post #88
post #68

Earlier quoted context omitted.

Java (like mentioned in the article) does the same though IIRC Inferno OS is like Java in this regard. How will WASM change what Java has already done? Why would I compile Rust to WASM when I can compile Rust natively to any number of platforms? And use FFI? I think WASM, while nice, doesn't bring much new to the table. It's been hyped for years, and I still only see it used here and there very sparingly.

This is how. The installed size of OpenJDK 17 JRE on my machine is 186MB, according to the package manager. I suspect that the WASM VM embedded in the program demonstrated in the blog post is 1.5 to 2 orders of magnitude smaller.

There are many JDKs available, some of which specializing in embedded, like this one: https://en.wikipedia.org/wiki/JamaicaVM

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#105
post #23

Everything 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.

There are two dimensions to "everything is a file". The first is the concept of a hierarchical filesystem namespace. The second is the notion that read and write can be used as a universal interface to any resource from the perspective of the runtime environment (e.g. kernel). People focus myopically on the first aspect, but it's really the second that is the most important and most enduring. The word "file" is ambig…

> People focus myopically on the first aspect, but it's really the second that is the most important and most enduring

But something you can read and write to is not called a file, it is called a stream. It is no accident that Linux differentiates between “files” that you can write to at arbitrary places, or ones that are append-only.

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#106
post #30

I wonder if we can reliably expect React-in-Rust framework that compiles to wasm instead of js? Or maybe just a React library written in Rust, but you can still write the source code in javascript? Or maybe at least Typescript-to-WASM compiler to skip JS output?

Seems a bit silly injecting all that garbage collected untyped stuff straight back into a context where one of the aims was to get rid of it

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#107
post #84

Earlier quoted context omitted.

Looks like memfd_create is from Linux 3.17 (2014), which was after I wrote the function. I sort of miss the days when simple stuff was hard.

>I sort of miss the days when simple stuff was hard. what? what's the point? for me it's the most annoying thing when the simple stuff is hard because why would it be?

I agree. I was looking into how you start a child process in C++ recently and I was surprised and not at all surprised to find that the answer is still fork and execve. Ridiculous.

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#109
In this paradigm, the browser's URL Omnibox can also be used as CLI/repel/input. So each "URL or search" to a browser, can open an app that accepts commands and inputs, and allows outputs, through the interfaces, or back to URLSearchParams (which could then be piped again). Maybe related (diclaimer: working on it), https://github.com/internet4000/find ; can be used with "local first web apps", and all the web "apps" which accept input from the URLSearchParams. Great talk!!

Re: Reaching the Unix philosophy's logical extreme with WebAssembly

#110
post #64

Reminds me of that time I wrote a StringToExecutableFile() function for running [e.g. a Rust binary] from C++, but that depended on several layers of build system horror to embed the executable file as a string, and it wasn't cross-platform. Imagine a utility function that dumps an embedded string to an unlinked temporary file, sets the +x permission, and returns a /proc/self/fd/N filename so you can exec() a subproc…

[deleted]
Post reply on HN