News for hackers. Stuff that matters.
Re:Unix and Flow-Based Programming by SixSigma on Friday December 18, 2015 @03:47PM (#10760814)
> Then Tannenbaum came out with his book and it didn’t really take off.

> Then Torvalds open-sourced linux and that is what started to gain popularity.

cough BSDi cough

Re:Unix and Flow-Based Programming by nickpsecurity on Saturday December 19, 2015 @12:10AM (#10762726)
To support your point:

https://web.archive.org/web/19990224090656/http://www.bsdi.c...

Seeing the list, now I'm sure which BSD that SCC likely used in their Sidewinder firewall. They modified it to have mandatory access controls to contain breaches of subsystems. This was before SELinux, etc. Never used BSDi, though, so can't say much about it except its users were getting pretty of mileage out of it given rep of products based on it. Least in appliances.

Re:Unix and Flow-Based Programming by SixSigma on Saturday December 19, 2015 @12:00PM (#10764077)
We used BSDi to launch an ISP in 1995, with 20 modems and 512kbps of bandwidth.

I still have the Cdrom and we do hosting nowadays.

Re:Unix and Flow-Based Programming by nickpsecurity on Saturday December 19, 2015 @01:02PM (#10764261)
How much did it cost out of curiosity?
Re:Unix and Flow-Based Programming by SixSigma on Saturday December 19, 2015 @01:45PM (#10764417)
I really can't remember. I didn't order it myself.
Re:Unix and Flow-Based Programming by bitwize on Friday December 18, 2015 @09:00PM (#10762275)
Well yeah, but that's not really how complex systems are developed anymore. Modern software development uses the object as the modular unit of granularity, not the process -- and APIs, perhaps augmented with message queues, for communication rather than pipes, sockets, and file descriptors. This is because it's much easier to statically reason about objects with well-defined APIs and they can be composed more flexibly with appropriate fabric: interacting locally or across process, user, or system boundaries.

This model dates back at least as far as Smalltalk but what really caused it to take off was -- wait for it -- Windows COM. So modern development has moved on from the Unix philosophy and embraced the Windows philosophy.

Re:Unix and Flow-Based Programming by chubot on Saturday December 19, 2015 @04:21AM (#10763109)
Uh, this is crazy wrong. Maybe in the desktop era objects were more important, but processes have come back with a vengeance now that everything is a distributed system.

I'm not sure what you mean about objects being composed across system or process boundaries. Name a successful system where that's true. Who uses DCOM? Distributed objects failed. I occasionally see people trying to bring back this way of thinking (e.g. they want methods instead of RPCs and protobufs), but they have not succeeded, for fundamental reasons.

In reality it's not either-or. You need both ways of thinking. Objects are static (they exist as an agreement between the compiler and programmer, and are usually thrown away at runtime); processes are dynamic. Many programmers that think only in terms of objects learn the hard way that their programs are brittle and inefficient. System operators think in terms of processes, and this way of thinking is essential for resilient systems.

In addition, objects are losing importance in distributed systems because state in a single machine's memory is not very useful. In real distributed systems you need replicated/resilient state with varying consistency guarantees. An object doesn't help you with any of those things.

Re:Unix and Flow-Based Programming by teddyh on Friday December 18, 2015 @04:20PM (#10761021)
> I was going to mention Unix “cat” but forgot.

> Wildly simple - it takes at most one argument.

That is asinine. Why would a program be called ‘cat’ if it can’t concatenate multiple files?

Also, his “grash” program is seriously deficient in the handling of signals – it completely ignores the issue. There are many subtle issues with signals which have to be handled correctly when writing a shell: http://www.cons.org/cracauer/sigint.html

Re:Unix and Flow-Based Programming by throwaway999888 on Friday December 18, 2015 @06:07PM (#10761604)
> That is asinine. Why would a program be called ‘cat’ if it can’t concatenate multiple files?

Because he only thinks it's the "echo file to terminal" command.

The main use of cat was mentioned in the Programming in the UNIX environment article.

> The fact that cat will also print on the terminal is a special case. Perhaps surprisingly, in practice it turns out that the special case is the main use of the program. [...] But what about -v? That prints non-printing characters in a visible representation. Making strange characters visible is a genuinely new function, for which no existing program is suitable. [...] The answer is ‘‘No.’’ Such a modification confuses what cat ’s job is concatenating files with what it happens to do in a common special case - showing a file on the terminal.

http://harmful.cat-v.org/cat-v/unix_prog_design.pdf

Re:Unix and Flow-Based Programming by mtdewcmu on Friday December 18, 2015 @06:17PM (#10761642)
Like a lot of people, he overuses cat when it's not needed. `cat FOO | more` is approximately equivalent to `more < FOO`, except the first one spawns an extra process for no reason.
Re:Unix and Flow-Based Programming by throwaway999888 on Friday December 18, 2015 @07:04PM (#10761888)
> except the first one spawns an extra process for no reason.

I wonder how many processes I could spin up in the time it would take for me to figure out "hmm, no, invoking that command would use one more process than necessary..."

I don't give a hoot about that stuff when I'm doing stuff interactively. e.g. when using `more`.

Re:Unix and Flow-Based Programming by hawski on Saturday December 19, 2015 @12:29PM (#10764168)
In my opinion it's better to replace `cat FOO | more` with `< FOO more`, because cat is used because people first think that they want to take contents of some file and pass it through some filter.
Re:Unix and Flow-Based Programming by mtdewcmu on Saturday December 19, 2015 @03:10PM (#10764664)
I didn't know you could put the redirection first. You learn something new every day. Maybe that form would make it more mnemonic for some people, because it more resembles a pipeline.
Re:Unix and Flow-Based Programming by throwaway999888 on Friday December 18, 2015 @08:16PM (#10762139)
BTW, the authors effectively embraced having the functionality of using `cat` instead of < .

> The use of cat to feed a single input file to a program has to some degree superseded the shell’s < operator, which illustrates that general-purpose constructs - like cat and pipes - are often more natural than convenient special-purpose ones.

Re:Unix and Flow-Based Programming by mtdewcmu on Friday December 18, 2015 @11:04PM (#10762573)
If you're going to write shell scripts or do anything sophisticated with the shell, it's worth understanding the difference. And there is a fundamental difference. With |, standard input is hooked up to a pipe. With <, standard input is hooked up directly to the file. Sometimes it does matter.
Re:Unix and Flow-Based Programming by isolate on Friday December 18, 2015 @11:13PM (#10762592)
The purpose cat serves is that it lets you forget about < until you really need it.
Re:Unix and Flow-Based Programming by throwaway999888 on Saturday December 19, 2015 @05:47AM (#10763227)
The comparison was between cat + pipe and < ...
Re:Unix and Flow-Based Programming by mjevans on Friday December 18, 2015 @05:51PM (#10761526)
I like how busybox cat does it, with a do while loop:

https://git.busybox.net/busybox/tree/coreutils/cat.c

Re:Unix and Flow-Based Programming by epistasis on Friday December 18, 2015 @05:11PM (#10761334)
"cat" sounds like the abbreviation of "catenate" not "concatenate". Perhaps its possible that later versions of cat allowed more than one argument?
Re:Unix and Flow-Based Programming by RadioactiveMan on Friday December 18, 2015 @08:01PM (#10762092)
Catenate means to connect things together[1], which implies it was named with multiple files in mind.

[1] https://en.m.wiktionary.org/wiki/catenate

Re:Unix and Flow-Based Programming by epistasis on Friday December 18, 2015 @09:08PM (#10762296)
I'd think that it's chaining together the characters in the file, catenating a file to the screen. Wikipedia claims that the first version of Unix did a single file.

https://en.wikipedia.org/wiki/Cat_(Unix)#History

Whereas "con"catenate means to link separate things together. These are minor distinctions, but if somebody is going to call things "asinine" they should at least get the pedantry correct.

Re:Unix and Flow-Based Programming by teddyh on Saturday December 19, 2015 @12:14PM (#10764111)
The reference Wikipedia gives for that does not actually say that the original “cat” only took one file name. What is says is that “cat”s predecessor, “pr”, only took one file name, and that “cat” subsumed it.

How’s that for pedantry?

Re:Unix and Flow-Based Programming by epistasis on Saturday December 19, 2015 @11:29PM (#10766059)
Excellent!
Re:Unix and Flow-Based Programming by RadioactiveMan on Friday December 18, 2015 @09:20PM (#10762336)
Good to know. Reading definitions of concatenate and catenate, I was confused about whether there actually was a difference or not.

Edit: that wikipedia page makes it sound like the program it replaced was the one that prints a single file to the screen.

Re:Unix and Flow-Based Programming by yarrel on Friday December 18, 2015 @04:26PM (#10761057)
cat takes as many files as you pass it, yes.