The Source for Java Technology Collaboration
User: Password:



Evan Summers

Evan Summers's Blog

A Fool's Errand

Posted by evanx on May 19, 2006 at 02:44 AM | Comments (5)

A reader commented to my blog "Java is all you'll ever need" that "anyone thinking he needs only a single tool to do any job is a fool." That would be me. So lemme introduce you to this fool's errand...

penknife.jpg Of course we need more than one tool. But it depends what you define as a "tool." Every library is arguably a different tool. So then a programming language is a tool to write tools (libraries) to help with some specific tasks. If you prefer one programming language (eg. Java) and development environment (eg. Netbeans) over all others (eg. bash, python, perl, vi) then that is your sharpest tool for writing tools.

I have my favourite Java Leatherman with me, and so I gonna leave my Python Army Knife at home.

Bash is written in C. Clearly it could be rewritten in Java. But let's not do that, let's write a better bash. And rather than a scripting language, let's just write a framework and library.

Even if not as concise as a purpose-built scripting language, our approach will have the advantage of being able to leverage tools like Netbeans and Eclipse right off the bat to write our "scripts." And that is no small thing in my book.

My main argument against bash, python, perl, C et al, is very simple and personal. Just that they are not my favourite language, programmable using my favourite IDE. That is, they are not my personal favourite programming tool.

When I was at school in the 1980s, my first big pet project was writing a 4GL in Basic. A scripting language of sorts. I spent years on that thing. I was emulating my father because he wrote 4GL language tools.

When i discovered C, everything changed. Now rather than write a new scripting language, you would just write a new framework and library, because C let you do that. And Java has made that truer than it ever was with C.

nail-hammer.jpg It's true that shell scripts (and scripting languages in general) are gonna be much more concise right off the bat for scripting system tasks. Bash is specially designed for that purpose.

But Java (like any language) let's us write a library to support writing tasks, so that we can approach the brevity of shell scripts, without the downsides of shell programming. And with a big upside if Java/Netbeans is your favourite hammer and so you want everything to start looking like a nail.

So watch out for my blog in the next few days titled "Bin Bash Java (Chapter 1)." As you can surmise, it's the first in a series. It's the beginning of a journey, to create a library so that I can say goodbye to my bash scripts and do some serious "scripting" on Windows too. I hope to meet you along the way!

Update. This blog continues over at "Bin Bash Java (Chapter 1)". Also Check out NailGun which aims to obviate the start time of the JVM, eg. for Java command-line tasks. They say, "Java has an extensive and robust core API and huge number of available open source libraries. It's a great big hammer, making almost any programming project look like a nail."


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • A platform independent scripting language, this can be a really nice tools, i'm going to read your bin bash java series for sure !

    Posted by: alois_cochard on May 19, 2006 at 05:03 AM


  • Thanks Alois, please do read them and I hope you enjoy them! I will publish the first installment in a few days for sure (I have drafted it already).

    A better description of it would be a "tasking library" rather than "scripting language" as you'll see :)

    Posted by: evanx on May 19, 2006 at 05:23 AM

  • I've thought of the same thing a few times. I'd like to see the file sets and pattern sets of apache ant available in a command shell. A new syntax, some other shell features added, and you have an awesome product.

    Posted by: eirikma on May 19, 2006 at 12:33 PM


  • Regarding the Java programming langage, "anyone thinking he/she needs only a single tool to do any job is a fool", a mostly true statement.

    Forth, C, Common Lisp, all have places their applications.

    Maybe, the best/ultimate yet, is an interpreted Forth engine implementing a C virtual machine for developing Java and Common Lisp applications.

    Who Knows?

    Maybe best to think openly about tools for the /specific/ art of programming!

    Posted by: mawcowboy on May 19, 2006 at 05:04 PM

  • When I first heard about groovy I thought I could drop perl and use groovy to grep a bunch of text files, sort it and prepare it for analysis. I was really frustrated that this doesn't work that way. These guys played with the Java language but file processing is still as complex as in Java. I really want a Java scripting language for file processing.

    Posted by: pinus on May 21, 2006 at 11:50 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds