Live data from Hacker News

Reaching the Unix philosophy's logical extreme with WebAssembly

xeiaso.net

31–40 of 142 posts

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

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

I mean probably, yeah, but why? You'd still need JS to involve the DOM with anything, and that's the performance expensive stuff, so might as well just do the whole thing in JS.

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

#33
post #25
post #12

The UNIX philosophy’s logical extreme is the NAND gate. Does one thing, does it well, and can be composed into arbitrary applications.

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.

[deleted]

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

#34
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.

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

#35
post #25
post #12

The UNIX philosophy’s logical extreme is the NAND gate. Does one thing, does it well, and can be composed into arbitrary applications.

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.

[deleted]

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

#36
post #25
post #12

The UNIX philosophy’s logical extreme is the NAND gate. Does one thing, does it well, and can be composed into arbitrary applications.

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)

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

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

I mean probably, yeah, but why? You'd still need JS to involve the DOM with anything, and that's the performance expensive stuff, so might as well just do the whole thing in JS.

Isn't there work on letting WASM call the DOM/Browser API's directly without having to go through JavaScript?

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

#38
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.

React-likes (including Vue, Preact, etc) have the most ergonomic interface for UX devs to develop with.

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

#39
post #32

Earlier quoted context omitted.

Okay… please… someone implement ‘nand’ and write a script that does something simple using only it.

https://nandgame.com/

Great find. People who like this might also like http://incredible.pm/ .

I don't know how I feel about the message "This is optimal!" displaying when you use one NAND gate to build an inverter at level 2. Level 1 forces you to build an NAND gate out of (1) an AND gate, plus (2) an inverter. It feels like it'd be more optimal to just reuse that inverter.

(And then level 3 is an AND gate, the other primitive† you started with...)

† Technically, you start with two primitives, implementing f(a, b) = a ∧ b and g(a,b) = ¬(b ⟶ a). You also get the ability to provide 0 and 1 as fixed inputs, thus ¬a ≡ g(a,1). What you lose after implementing the NAND gate is the ability to provide a fixed 1 input - instead, you are informed that you assume all gates automatically draw from this. Worst of all possible worlds.

Post reply on HN