From: Eric Wong Date: 2010-08-18T06:43:35+09:00 Subject: Re: Unix Philosophy in Ruby Programing Diego Bernardes wrote: > So, this is the question, what you guys think about the way ruby > programs are made? > Why build a gem/program to send mail if you can send with sendmail? > Why build process monitor if you can use monit? > And so.. People build libraries/applications to fill particular niches/needs that aren't as easily filled by existing ones. Ruby makes that easier than before. Complex configuration files for existing C applications either no match in power to a programming language such as Ruby or much harder to read and maintain than Ruby. Technology is about evolution, some older technologies are gradually replaced/superceded by superior (or sometimes unfortunately, just better-marketed) ones. To me, Ruby is just another piece of evolution. With Ruby, I don't have to worry about the boring grunt work that I did in C applications. I have a language that wraps most of the Unix API in a pretty language with GC and exceptions[1]. I don't think I'd appreciate Ruby nearly as much as I do if I didn't have years of Unix programming experience in C and Perl before it. However, I just see Ruby as yet another tool in the Unix toolkit. I mostly use Ruby in places where I'd previously used Perl[2] or C. I still use a mix of Bourne shell, awk, sed, GNU make, Perl and C in places where I feel they're more appropriate than Ruby (and of course I freely combine them). The most important part is that they're all part of the Unix ecosystem and information flows freely between them via pipes, sockets, files, signals, message queues and what not. If I feel an AWK component isn't powerful enough to do what I need to do, I can just swap it out for a Ruby one. And if Ruby is too slow[4], I'll swap in a C replacement. Scripting languages continually blur the line between configuration and programming languages and enable less-experienced (or just lazier :) folks to do more. The ever-increasing performance of scripting languages combined with advances in hardware continues to drive higher-level things like Ruby forward and uglier things away. > A nice post about this is: http://tomayko.com/writings/unicorn-is-unix Fwiw, I'm the primary author of the Unicorn server mentioned in that article. I also work exclusively with Unix-like platforms and refuse to work with anything I feel has too much corporate control/influence over it. Maybe the corporate trolls will one day kill off dinosaurs like me, or we'll just eat them alive :) [1] - exceptions-by-default the biggest reason I favor Ruby over Perl/C. I don't need to write error checking code for every single function call I make, Ruby will just raise an exception and fail early and loudly[3]. [2] - the other big reason I favor Ruby is that I can easily drop down to C (the language of Unix) and use any exotic system calls that Ruby doesn't already provide for me. Many Ruby programmers did not have C programming backgrounds, so they may feel differently. [3] - an important tenet in Unix programming :) [4] - less and less these days since Ruby 1.9.2 + tcmalloc -- Eric Wong