Home > Tools > Picking a scripting language

Picking a scripting language

I’ve been working with Java for a dozen years now, actually more. I don’t really want to learn another language, or forget one. I’ve already forgotten perl too many times. But the problem is that I actually do need to learn another language. Java just doesn’t do everything for me.

For example, when I need to process a huge log file and write some data to another file, I don’t really want the overhead of writing in Java. What I want is to scribble something out and run it. I might keep the script around, but I might throw it away too. I need another tool. Perl once did this for me, once long ago. Then for whatever reason, I didn’t need it anymore. Now I need it again, but remembering how many times I’ve forgotten perl, I’m thinking maybe there’s a better language. Maybe there’s something that I can actually remember from week to week as my infrequent needs call upon it.

I’ve been thinking about a few language options:

  • Python 
  • Ruby
  • Bash
  • JavaScript

I’ve only read the introduction sections of books about Ruby and Python. Python just irks me with its dependence on space. I’m sure that’s a frequent complaint. For those who overcome that somewhat petty problem, the language seems to satisfy. But something about those procedures and method with __something__ surrounded with those underscore characters. Come on, what’s up with that? But the things that really do appeal to me about Python are the general ideas that explicitness is better that obscurity, that one common way is better than a dozen equally flexible ways, and that there is a best way to do something….well, those ideas are comfortable and appealing.

Ruby is fully object-oriented, and it actually does read nicely. I’m also interested in multiple spoken languages, character sets, etc., and I’m not sure whether it fully embraces Unicode as it’s character set. Maybe there are ways to make it work with UTF-8, but I haven’t quite advanced that far.

Bash? Uh no.

Can you believe that I actually considered Javascript briefly. When run under a vm with the Rhino implementation, your JavaScript code has full access to the JRE class libraries. Used this way, it really is only a way to script Java calls. For what I want, no “native” javascript functions exist to read the underlying file system or to create new files.  Without the boilerplate overhead of a full Java application, I suppose I could squeak out some extra productivity. In the end though, it really is just a way to work with Java code. JavaScript might be great within a browser, but on the file system? Hmmm, probably not.

So what are your ideas about a general purpose scripting language? Is perl still the best choice for system work, moving files around, parsing out some key values and writing them elsewhere? Did you move to Python and finally just accept the annoying white space issue? Or is Ruby a good tool for me. What do you know about these? Any suggestions?

Thanks!

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Be Sociable, Share!
Categories: Tools Tags: ,
  1. August 20th, 2010 at 04:44 | #1

    Of those choices, if I were starting fresh, I would probably pick Ruby, and not because that’s my daughter’s name. Unfortunately, I am not starting fresh, and learned Perl over 15 years ago, and use it almost on a daily basis to this day. Like any tool, for the parts of Perl that I use or need, I know the strengths and how to leverage them for a specific task, and likewise, for the weaknesses, I figured out sometimes clever ways to overcome or work around them. In the end, you may need to flip a coin. For general purpose, you probably cannot go wrong with Perl, Python, or Ruby.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  1. No trackbacks yet.