News for hackers. Stuff that matters.
Re:Building apps in minutes, not months by mpweiher on Friday September 17, 2021 @03:12PM (#28569722)
> Text Must Be The Answer because it's just so easy to write `ls | grep`

That's actually not quite it. What's so fantastic about the textual interface in Unix is that it is the same packaging[1] for both use and reuse.

This is highly unusual, usually packaging that is optimised for use is unsuitable for reuse (doesn't compose well) and packaging that is good for reuse is unsuitable for direct use (cumbersome/inconvenient).

Using text to fill both roles comes with a ton of compromises, as you rightly point out. It's not really great at either function, but sorta/kinda gets by at both. But even with those compromises, pulling off the feat of having the same packaging for use and reuse is just incredibly powerful.

There are other ways of achieving the same result, for example Naked Objects[2] bridges the gap by the programmer only providing the reuse packaging (an OO API) and the tooling then automatically generating direct-use packaging (a GUI).

Other ways of bridging the gap that can learn from one or both of these approaches clearly seem possible.

[1] https://www.cs.cmu.edu/afs/cs.cmu.edu/project/vit/ftp/pdf/Pa...

[2] https://en.wikipedia.org/wiki/Naked_objects

Re:Building apps in minutes, not months by janci on Friday September 17, 2021 @03:41PM (#28570077)
Powershell cmdlets return objects that are suitable for reuse and also have their textual representation suitable for (human) use. I think the concept is beautiful, but the execution is awful.
Re:Building apps in minutes, not months by starfallg on Friday September 17, 2021 @05:02PM (#28570851)
> That's actually not quite it. What's so fantastic about the textual interface in Unix is that it is the same packaging[1] for both use and reuse.

That's the reason CLI tools are so powerful, and the reason why json and yaml aren't able to replace them. It's also the reason why human-friendly CLI syntax like Cisco IOS is better than programatic interfaces like the default syntax in Juniper JUNOS.

Re:Building apps in minutes, not months by fouric on Monday September 20, 2021 @01:33PM (#28596369)
> That's actually not quite it.

That might not be the UNIX environment's true strength, but it's the only one that any of its advocates discuss. I've seen hundreds of people defend the paradigm, and you're the first one who's mentioned "packaging for both use and reuse" - everyone else talks about "text as the universal interface" and "simple, composable commands".

Moreover, I don't think that this feature is unique to UNIX. In particular, Emacs Lisp functions can both be called from other elisp code and directly (and ergonomically) executed by the user (with plenty of features to enrich interactive execution) - and these functions can actually pass typed data between them, unlike shell commands.

This appears to be the same "packaging for use and reuse" that you mention - unless I'm misunderstanding what you're saying, which is very possible because I'm reading through the (exceptionally interesting) PDF that you kindly linked, and I don't understand what it's getting at (although it seems profound).

Re:Building apps in minutes, not months by mpweiher on Wednesday September 22, 2021 @08:28AM (#28615533)
"text as the universal interface" is the thing that enables "packaging for both use and reuse", so it's not surprising that this is what they refer to.

> Moreover, I don't think that this feature is unique to UNIX.

It's not. It's not common though, and certainly Emacs Lisp code doesn't work at the OS level, it is trapped inside Emacs.