Live data from Hacker News

Reaching the Unix philosophy's logical extreme with WebAssembly

xeiaso.net

41–50 of 142 posts

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

#41
The Unix Philosophy:

A) Tasks should done by combinations of simple tools combined into an elegant pipe.

B) Each tools should do three things, one of them at least so-so well:

Those three are:

1) Hackily parse the output of the previous tool by flaky assumptions like that a certain delimiter is always present, that spaces will not occur in such and such an item, or that such and such a field is from this column to that one and never overflows.

2) Do the actual processing correctly and efficiently --- provided nothing in the data, exceeds a 1023 character limit, or overflows an addition of two ints or doubles.

3) Produce output in some way that is hard to parse correctly for the next tool, like columns that may be empty, contain items with spaces, or overflow so that column widths are not reliable.

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

#42

> It's magic, just without the spell slots. I laughed out loud during a work meeting when I read this. Bravo, Xe!

You were reading HN during a work call ! Call HR !

I'm losing my job soon due to their return to office bullshit. And I was hired as a remote employee.

HR can kiss my fuzzy butt lmao

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

#43
The talk was amusing but much less interesting than it could be. Yes, we have adapters and shims and they make interfacing easier, sometimes.

I guess after all these years of waiting for WebAssembly to actually be useful (as in: I can write apps as easily as I can on desktop, with similar performance, but with the safety guarantees of a web sandbox), I finally realized what I wanted: web pages that are backed by virtual machines. Every page is just a view into a VM's framebuffer. User events are delivered just like X11 or win32 events. The page works like a desktop app. Any code that can run in a VM, can run in the window.

After all, the browser is just an inner platform and you should be able to run an virtual machine in your inner platform.

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

#44

The Unix Philosophy: A) Tasks should done by combinations of simple tools combined into an elegant pipe. B) Each tools should do three things, one of them at least so-so well: Those three are: 1) Hackily parse the output of the previous tool by flaky assumptions like that a certain delimiter is always present, that spaces will not occur in such and such an item, or that such and such a field is from this column to th…

[deleted]

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

#46
post #43

The talk was amusing but much less interesting than it could be. Yes, we have adapters and shims and they make interfacing easier, sometimes. I guess after all these years of waiting for WebAssembly to actually be useful (as in: I can write apps as easily as I can on desktop, with similar performance, but with the safety guarantees of a web sandbox), I finally realized what I wanted: web pages that are backed by virt…

[deleted]

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

#47
post #25

Earlier quoted context omitted.

One thing? It does a logical and and then negates the result. The shell doesn’t really let users compose commands this way, but alias NAND="AND | NEG" Also, a NAND command would need to have 2 stdin ’s.

> One thing? It does a logical and and then negates the result. Sorry? Take a second to think about what you're saying. In what conceivable sense is "doing a logical and " one thing while "doing a logical nand " isn't? You can equally claim that x & y is really just (x ↑ y) ↑ (x ↑ y)

Not the person you asked, but the initial point was taking that idea to the extreme. The concept of "one thing" in the NAND case is more extreme (in terms of granularity). No need to be sorry, it's ok.

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

#48
post #47

Earlier quoted context omitted.

> One thing? It does a logical and and then negates the result. Sorry? Take a second to think about what you're saying. In what conceivable sense is "doing a logical and " one thing while "doing a logical nand " isn't? You can equally claim that x & y is really just (x ↑ y) ↑ (x ↑ y)

Not the person you asked, but the initial point was taking that idea to the extreme. The concept of "one thing" in the NAND case is more extreme (in terms of granularity). No need to be sorry, it's ok.

Right, the person I asked is claiming that NAND is two things. You appear to have responded as if you disagree with my comment while not actually disagreeing with any part of it.

What did you think I meant by this question?

>> In what conceivable sense is "doing a logical and" one thing while "doing a logical nand" isn't?

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

#49
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?

At that point, why even bother with React? Just write a real user interface.

What do you define as a "real" user interface?

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

#50
The pipeline pattern has its uses, but it's not the most important (or even the most well known?) tenant of the Unix philosophy.

It's "Everything is a File"[0]. That one has really stood the test of time. And it's often misunderstood to mean that everything implements {Read,Write,Seek,Truncate, etc.}. Then when a TCP socket or character device or whatever shows up, the whole abstraction leaks, and it seems like not everything is a file.

The Good Parts of Everything is a File:

1. Everything exists in a Filesystem, meaning a directory tree. There are directories, they list things, either resources, or more directories. A process gets access to all additional resources through the filesystem. We've really screwed up by putting networking in it's own place, environment variables, etc.

2. File descriptors. If you squint, these are capabilities[1], which is probably the best way to manage resource permissions. They are fine grained, they handle delegation, there is a tree of legitimacy back to the root. We were so close, but we got this one wrong too, with a single global root, instead of a chroot per process by default.

[0] https://en.wikipedia.org/wiki/Everything_is_a_file

[1] https://en.wikipedia.org/wiki/Capability-based_security

Post reply on HN