Hacker News new | past | comments | ask | show | jobs | submit login

The CLI has a massive blind spot in today’s operating systems: it knows nothing useful about events.

Yet events are the primary way anything happens on a computer, whether it’s a user system or a server.




Annoying though it may be, you can run a program in the background that can write to your open terminal.

Just in userspace you have;

   dmesg -w

   tail -f /var/log/messages
There's also dbus to monitor on Linux systems and a lot of kernel hook tricks you can use to get a message pop up if an event happens.

Because it gets annoying to have a process splurge notification stuff to a term you are working in, that's why you have info-bars which many terminal emulators support.


That's the specific hole which Expect fills for scripting:

<https://en.wikipedia.org/wiki/Expect>

Much of modern operating systems is events-based and relies on polling for specific actions, devices connecting / disconnecting, etc. Linux device management is based on this, for example. There are numerous scripts which fire as a service is enabled or disabled (networking "ifup" and "ifdown" scripts, for example), or services are started / stopped. Systemd extends these capabilities markedly.

And of course there's a whole slew of conditional processing, beginning with init scripts, [], test, &&, ||, and specific conditional logic within shells, scripting, and programming languages.


In unix world, everything is a file, so you can poll the file waiting for something to happen. And there’s the whole signal thing and dbus exists.


Yeah, these are the event paradigms that I meant by “nothing useful.”

Files are not a good abstraction for events. Signals are broken in many ways. And DBus is both extremely clunky to use and non-portable.

There isn’t a built-in event paradigm similar to how streams and pipes are an integral part of the Unix-style CLI.


> Files are not a good abstraction for events

Why is that? On the low level everything is a state of electronic cells. Files address those cells in a suitable fashion. Modern programming abstractions such as async/await are very simple, but fail miserably if you need something really complex and efficient.


I can't even understand this. How does the CLI relate to events? Are you saying that all servers secretly have an invisible GUI and handle events there?

This just seems like an odd non sequitur.


You mean, like entr triggering commands?


huh? DBUS is very much a thing and has CLI-tooling?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: