7 ms·
"The key to making programs fast is to make them do practically nothing. ;-)" In a prefect world, I would prefer many programs that did nothing and worked toge
by terinjokes 16y ago
"The key to making programs fast is to make them do practically nothing. ;-)"
In a prefect world, I would prefer many programs that did nothing and worked together, than a monolithic program that does anything (and even contains a kitchen sink!) but is slow.
So come on fellow developers, let's make a bunch of nothing!
- tszming 16y agoThis is essentially the same as the "RISC patent" - a patent that essentially said "if you make something simpler, it'll go faster" Quoted from James Gosling, http://nighthacks.org/roller/jag/entry/quite_the_firestorm http://nighthacks.org/roller/jag/entry/quite_the_firestorm Also, kudo's to the 15 years maintainer of GNU grep.
- jonah 16y agoIsn't that a big part of the GNU mentality too? Lots of little programs that can be easily chained together.
- telemachos 16y agoLots of little programs that can be easily chained together. I think that's usually described as "the Unix philosophy." It's not limited to GNU (nor does it originate with GNU). See, for example, the Wikipedia article on "Unix philosophy"[1]: Doug McIlroy, the inventor of Unix pipes and one of the founders of the Unix tradition, summarized the philosophy as follows:[2] This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface. This is usually abridged to "Write programs that do one thing and do it well". [1]http://en.wikipedia.org/wiki/Unix_philosophy#McIlroy:_A_Quarter_Century_of_Unix http://en.wikipedia.org/wiki/Unix_philosophy#McIlroy:_A_Quar... [2]http://www.faqs.org/docs/artu/ch01s06.html http://www.faqs.org/docs/artu/ch01s06.html
- jacquesm 16y agoThere is this strange wall between 'program' and 'subroutines' that at times feels completely artificial. Why shouldn't 'grep' be automatically available as a routine once programmed? I can see some of the charm of 'images' such as used by smalltalk.
- telemachos 16y agoI can see some of the charm of 'images' such as used by smalltalk. Or maybe the appeal of glue languages like Bash or (one style of) Perl. It is very nice to have the ability to treat arbitrary programs like libraries for your program. (Unfortunately, because of the GNU/BSD split - among other things - this style of programming is also completely brittle. One non-standard flag, and boom.)
- alextingle 16y ago'grep' is available once programmed. Just use popen(3). Until you naturally think this way, you will not understand the Unix philosophy.
- jacquesm 16y agoI (obviously) realize that you can do that. But that's not 'natural', that's an external process with a whole pile of start-up and shut-down overhead. Incidentally, some of the worst C code I've ever seen used piped unix shell commands all over the place, as if there is no penalty to doing this.
- Locke1689 16y agoThat's true. I think the tricky part is providing segregation where it's needed. That is, the problem is in supporting systems and programs which don't conform to the standard. Process segregation and scheduling is one way of solving this problem. Another is to simply enforce the design uniformly across the entire system. IIRC Plan9 does this slightly, but a better example may be a system which uses e.g., Haskell as the base language and simply requires all programs (modules) to be interfaced with the system with public facing symbols. A 'grep' IO monad may be an interesting way of linking and segregation.
- cperciva 16y agoAs telemachos says, that's the Unix philosophy. The GNU philosophy is to add options to programs until you run out of letters in the alphabet.
- koenigdavidmj 16y agoStop! Whoever crosseth the bridge of Death, must answer first these questions three, ere the other side he see! "What... is your name?" "Sir Brian of Bell." "What... is your quest?" "I seek the Holy Grail." "What... are four lowercase letters that are not legal flag arguments to the Berkeley UNIX version of `ls'?" "I, er.... AIIIEEEEEE!"