Live data from Hacker News

/dev/null is an ACID compliant database

jyu.dev

181–190 of 203 posts

Re: /dev/null is an ACID compliant database

#182
post #155

Earlier quoted context omitted.

I don't get why this is still the case on classic shells. fish properly puts the prompt on column zero, while outputting a small "line return arrow" at the end of the command to indicate it lacked one.

It's arguably not the shell's role to protect against garbled output. Do you expect a shell to reset the TTY state after every command too in case you accidentally `cat /dev/urandom` and the terminal emulator enters a weird state due to random escape sequences? The newline is a line terminator, a command outputting an incomplete line without a line terminator is producing garbled non-textual output. Files which conta…

> The newline is a line terminator, a command outputting an incomplete line without a line terminator is producing garbled non-textual output.

A command could very well be manipulating the cursor on its own and intentionally not writing newlines when it wants to overwrite text such as in a progress bar.

Re: /dev/null is an ACID compliant database

#184
post #164

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

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…

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.

Re: /dev/null is an ACID compliant database

#186
post #155

Earlier quoted context omitted.

I don't get why this is still the case on classic shells. fish properly puts the prompt on column zero, while outputting a small "line return arrow" at the end of the command to indicate it lacked one.

It's arguably not the shell's role to protect against garbled output. Do you expect a shell to reset the TTY state after every command too in case you accidentally `cat /dev/urandom` and the terminal emulator enters a weird state due to random escape sequences? The newline is a line terminator, a command outputting an incomplete line without a line terminator is producing garbled non-textual output. Files which conta…

If you were designing a command-line interface from scratch, you'd definitely make it so that the command prompt gets displayed consistently and reliably after each command terminates, regardless of what garbage it spewed. The only reason we see anything different is because UNIX systems happened to grow that way, and everything gets crammed through an interface that was originally designed to show characters on physical paper.

With the design we actually have, the shell is the only thing in the chain that could reset the TTY state and ensure that the prompt gets displayed consistently each time, and it should. I wouldn't go so far as to say that I expect it to (my expectations for computers are not high in general) but it ought to.

Re: /dev/null is an ACID compliant database

#187

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

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)

Re: /dev/null is an ACID compliant database

#188
post #156

I get the joke, but IMO it doesn't pass Durability test, as what is sent to it (i.e. transactions) are not durable. Durability in ACID is about the durability of the data that is sent to the database (in this ironic post, /dev/null) once committed. "[...] completed transactions (or their effects) are recorded [...]" But I will give it that ACI do make sense! #PedanticMode

Let's test that: 1. Nothing stored in /dev/null is durable. 2. Nothing is stored in /dev/null. 3. Ergo, /dev/null exhibits durability. Thank you, I'll take my check at the door.

You are missing the part where the data did exist and that after something/someone sent it to /dev/null, the data was gone. Therefore, the data did not endure. The Durability test of ACID failed for /dev/null.
Post reply on HN