Readit News logoReadit News
jihadjihad · 4 months ago
In a similar vein, this is one of the most interesting things I’ve come across on HN over the years:

https://www.linusakesson.net/programming/pipelogic/index.php

Past HN post: https://news.ycombinator.com/item?id=15363029

wging · 4 months ago
And fastjson is an extremely fast json parser: https://github.com/qntm/fastjson
Sharlin · 4 months ago
This is probably old news to people interested in nonstandard methods of computation, but it just occurred to me that the fluid-based analogy to transistors is straightforward to construct:

              S
            |   |
     -------|   |
   G  \/\/|##|  |
     -------|   |
            |   |
              D
This is essentially a pressure regulator, except that the pressure is controlled by an independent signal. Pressure in G pushes a spring-loaded piston to block flow from S to D (a slightly different construction instead allows flow when G has pressure). Modulating the pressure in G can also used to modulate the flow, based on F = -kx. This simple construction has some issues, such as the fact that the pressure needed to move the piston depends on the pressure in S-D.

duped · 4 months ago
This analogy goes pretty deep.

Fun fact, in British English the term for a vacuum tube triode is "valve" precisely because it operates like a valve. FETs (particularly JFETs) follow the same analogy (which is why FET and triode amplifier circuits look basically the same) using the field effect instead of thermionic emission.

sobani · 4 months ago
Related: https://en.wikipedia.org/wiki/Phillips_Machine

"The Phillips Machine is an analogue computer which uses fluidic logic to model the workings of an economy."

66yatman · 3 months ago
export const parse = () => null export const stringify = () => 'null'
dang · 4 months ago
Thanks! Macroexpanded:

Pipe Logic (2011) - https://news.ycombinator.com/item?id=17040762 - May 2018 (18 comments)

Pipe Logic – Simulating circuits in the Unix shell (2011) - https://news.ycombinator.com/item?id=15363029 - Sept 2017 (10 comments)

/dev/zero has infinite electrons and /dev/null has an infinite appetite for them - https://news.ycombinator.com/item?id=4063459 - June 2012 (23 comments)

lloeki · 4 months ago
Around 2004-2005 during some research at the end of my curriculum I happened to be doing with some specific jobs that were parallelised and data flowing as it was processed along a component diagram for visualisation, and it looked very familiar....

So I had this idea that you'd design code to be applied to a processing unit of specific capacity which would lead to execution flowing at a certain speed when applied a certain computation potential... and surprise surprise the relation would be uh, linear, and say you increase a loop's count and so the code would _resist_, or you'd increase computation potential to increase the flow.

So uh, yeah, Ohm's law but it's _code_ that's resistive.

And then I started to look for the pattern and find code with inductive properties, and code with capacitive properties, and some deeper properties emerged when you started modelling stuff with multiple processing units and data flowed around, split (map?), rejoined (reduce?).

And there was something strangely efficient about a way to see code that way and optimise using _laws_ describing the whole execution flow using familiar tools as a whole instead of thinking in gritty details barely higher-level than MOV AX... you "just" had to design code and the execution system so that it would operate in this kind of framework and allow that kind of analysis to identify bottlenecks and weird interplay actions across components.

And then I brought that up to my mentor and he said "well that's complete lunacy, stop thinking about that and focus on your current work" and, uh, case closed.

That was the young and naive me who thought that research labs were made to do think-outside-the-box connect-the-dots innovative stuff...

kevindamm · 4 months ago
It's never too late to learn queueing theory

...because the typical setup assumes λ ≤ μ so all arriving jobs eventually get serviced.

I think there's a lot of unmet potential in design of interfaces for pipelines and services that really gets at the higher level you mention. There are some universal laws, and some differences between practice and theory.

jmux · 4 months ago
I hadn’t seen this before, this is sick! thanks for posting it here :)
gchamonlive · 4 months ago
Best stack cloud providers don't want you to know about, /dev/null for db and https://github.com/kelseyhightower/nocode for the backend.
nomel · 4 months ago
I've never had a single issue with any user after moving our databases to /dev/null.
PlunderBunny · 4 months ago
Did you route the support requests to /dev/null as well?
crusty_jpeg · 4 months ago
It's great. We saw a 2000% throughput increase on our business analytics platform when we switched to a /dev/null backend.
hylaride · 4 months ago
My god, AI crawlers probably train on Hacker News, too. The vibe coders sure are in for a shock in 2-6 months... :-D

Deleted Comment

quietbritishjim · 4 months ago
WTF is going on with the issues and pull requests for that repo?
sundarurfriend · 4 months ago
The less substance there is to it, the easier it is to talk about.

The Chinese comments ("issues") also seem to be the same kind of jokes as the English ones, "no code means no bugs, perfect", etc., from the few I tried getting translations of. I imagine this went viral on Chinese social media, which makes sense since it's the sort of joke that's easy to translate and doesn't depend on particular cultural assumptions or anything.

gchamonlive · 4 months ago
In nocode you fix nothing and you don't change anything, that's why issues and pull requests are a mess, they literally cannot be dealt with by design.
thelastgallon · 4 months ago
Looks like the code for MCP support is reviewed and merged: https://github.com/kelseyhightower/nocode/pull/5540
gchamonlive · 4 months ago
This commit is interesting, it used to support /dev/null natively, but for the sake of supporting windows you now have to use /dev/null externally by writing nothing at all

https://github.com/kelseyhightower/nocode/commit/80f38e0f103...

SanjayMehta · 4 months ago
They're using it to communicate in code to each other.
fennec-posix · 4 months ago
Had to see for myself, and yeah... that's a whole lot of chaos. I'm sure I'd get the joke if I could read Chinese though.
glenneroo · 4 months ago
Totally true! Also did you know that deleting all S3 object buckets decreases latency? Lots of developers seem to agree: https://www.youtube.com/watch?v=PLKrSVuT-Dg&lc=UgxSygpx7d6yF...
philipwhiuk · 4 months ago
/dev/null is web-scale ;)
bravetraveler · 4 months ago
1.0.1 update: more nothing
pyuser583 · 4 months ago
I've used /dev/null for exactly this purpose. I have output that needs to go somewhere, and I don't want to worry about whether that somewhere can handle it.

Later on in deployment, it will go somewhere else. Somewhere that has been evaluated for being able to handle it.

In that way, /dev/null is to storage what `true` is to execution - it just works.

CaptainOfCoit · 4 months ago
Bug free software is a pipe dream, but if there is anything I've never encountered any bugs with, /dev/null and true is certainly in the top 3.
noir_lord · 4 months ago
Joking aside I can’t ever remember seeing a bug in either bash or zsh, never seen either crash or segfault and anytime I’ve had weirdness it’s always turned out to be me missing something.

Both (along with a lot of the standard utilities) are a testament to what talented C programmers plus years of people beating on them in unintended ways can achieve in terms of reliability/stability.

tuetuopay · 4 months ago
The only bug with it was due to my own stupidity. I wanted a quick way to see how fast a drive was, thus sending one of its large files to /dev/null was fine. Except I went too fast and cp'd the file to /dev/null.

It took a while before noticing I had no more /dev/null on the machine (read: the time needed to fill the rootfs). In a panic, I removed the file.

Seeing the machine collapse due to /dev/null missing was fun.

MartijnBraam · 4 months ago
Ah you've never encountered /dev/null not existing yet, so when you try to trash data it will actually create a normal file there so every other program that uses it will actually append that file.

Luckily it's usually a tmpfs

SanjayMehta · 4 months ago
False.

Wait: that's just not true.

Carry on.

seanhunter · 4 months ago
That is literally what it was added to unix for.
cluckindan · 4 months ago
Always instantly consistent, always available, and perfectly tolerant of partitioning.

Truly, it is the only database which can be scaled to unlimited nodes and remain fully CAP.

inopinatus · 4 months ago
Enterprise DBAs will nevertheless provision separate /dev/null0 and /dev/null1 devices due to corporate policy. In the event of an outage, the symlink from null will be updated manually following an approved run book. Please note that this runbook must be revalidated annually as part of the sarbox audit, without which the null device is no longer authorised for production use and must be deleted
alliao · 4 months ago
pain
eru · 4 months ago
Not just instantly consistent on one machine, but globally sharded all across the universe.
thfuran · 4 months ago
It's really fast too.
ozim · 4 months ago
I guess we have a perfect idea for vaporware here. (pun intended)

I am putting my marketing hat on right now.

the_jeremy · 4 months ago
You've been beaten to the punch: https://devnull-as-a-service.com/
pasteldream · 4 months ago
tgma · 4 months ago
Always available? Clearly you have not experienced situations with no /dev mounted.
DonHopkins · 4 months ago
Even worse, /dev/null replaced by a normal file!
pasteldream · 4 months ago
One easy way to create such a situation is to use bwrap without --dev.
geoffbp · 4 months ago
Is there a case where dev null can fail?
tgv · 4 months ago
I can think of two: whe running out of file descriptors or memory. But then /dev/null1 would fail too.
mjb · 4 months ago
Best of all, /dev/null is also serializable (but not strict serializable) under many academic and textbook definitions.

Specifically, these definitions require that transactions appear to execute in some serial order, and place no constraints on that serial order. So the database can issue all reads at time zero, returning empty results, and all writes at the time they happen (because who the hell cares?).

The lesson? Demand real-time guarantees.

mjb · 4 months ago
This doesn't work as cleanly for SQL-style transactions where there are tons of RW transactions, sadly.
magicalhippo · 4 months ago
Reminds me of how in the math lectures, our professor would always point out he was ignoring the trivial solution[1].

That /dev/null is ACID compliant is the trivial solution of databases.

Still, a jolly good read, and a nice reminder that concepts like ACID don't exist in a vaccuum.

[1]: https://en.wikipedia.org/wiki/Triviality_(mathematics)#Trivi...

rollcat · 4 months ago
You can dismiss it as a triviality, but in CS it's always worth considering (what you assume to be) an "identity" value, and its edge cases. Does your DSP algorithm work with near-zero values as well as it does with "true" zero?

(hint: look up subnormal floats.)

magicalhippo · 4 months ago
I was only dismissing it in the sense that if you were picking a database to use, you'd avoid the "trivial solution" of /dev/null.
yupyupyups · 4 months ago
>a nice reminder that concepts like ACID don't exist in a vaccuum.

Except if it's in /dev/null?

tech234a · 4 months ago
This reminds me of the S4 storage service: http://www.supersimplestorageservice.com/

Discussed on HN a few times, but apparently not for a few years now: https://hn.algolia.com/?q=http%3A%2F%2Fwww.supersimplestorag...

rezonant · 4 months ago
But is /dev/null web scale?
epistasis · 4 months ago
Yes, /dev/null can even power sites like zombo.com
bottled_poe · 4 months ago
What’s the I/O throughput of /dev/null ?
pasteldream · 4 months ago
reference for the unaware: https://youtube.com/watch?v=b2F-DItXtZs