JudoScript: Scripting for Java and Beyond
The Java platforms (J2SE and J2EE) are filled with rich and useful features, making Java an extremely useful resource for more than mere programming. To use Java, a good scripting tool is needed. JudoScript was developed to fill this need. It is a third and fourth generation tool (3GL and 4GL), providing normal programming support. In addition, it provides special mechanisms for various computing needs, such as Java scripting, JDBC scripting, XML scripting, HTML/SGML scraping, file and archive manipulation, versatile command-line execution, scheduling, HTTP handling, Java GUI scripting and many other utilities. JudoScript also is programmer-friendly and supports thread programming, useful data structures and so on. Its programming model is similar to that of Java and Python.
JudoScript was first released in November of 2001. You may wonder why we need a new scripting language? The truth is, with Java, we do not need another programming language, but we do need a good scripting tool.
Going through the Java packages shipped with J2SE and J2EE, one finds functionalities from basic computing to enterprise computing. Open-source projects provide even more cool functionalities, so we can do SSH/SCP, PDF generation, FTP, Telnet, Windows registry, UNIX syslog and much more. All in Java, Java has become a vast pool of readily usable resources for any platforms that runs it.
Coding in Java, however, is not a feasible solution. Often times we need to quickly fix up something, such as going through a directory tree to do some file manipulation, or checking a database for unprocessed orders or retrieving information in an XML document to create a report. For these types of one-time actions, rigorous Java coding is an overkill. Other times, we create scripts for repetitive tasks, which are run either manually or automatically. These scripts update frequently and performance is not critical. Edit-and-run can drastically improve productivity and reduce stress.
Another problem is the verbosity of Java programs. Java is a so-called system language, with low-level, fine-granularity APIs and language constructs that enforce good software engineering. But these elements become obstacles in our situations. On a related note, coding in Java requires expertise that is at times not available or desirable. Imagine trying to put a few files into a ZIP file using Java, without prior knowledge of the java.util.zip package. You would need to understand the files' meanings and relationships before you could do anything with them. As a user, I know Java can do ZIP files, but I don't really care whether java.util.zip.ZipFile or bill.wonderutils.ZipArchive is used.
So, really, what we need is a good scripting tool that allows us to easily use the many features in Java, standard or open source, with maximum flexibility (i.e., programmability) and extensibility.
Use Java as scripting. A few projects use Java as-is for scripting. This idea misses the fact that Java is a system language; edit-and-run alone does not legitimize Java as a scripting language.
The easiest way to solve problems is to tell an expert and have him do it for you. This idea reflects the philosophy of so-called 4GLs, which are domain-specific languages. They allow users to specify intentions, and the language engine provides solutions automatically. A typical example is SQL. You write a query; the SQL engine returns you rows of data. You don't need to open tables, locate available indices, check against the rows and create a cache for large amounts of data.
Opposite of 4GLs, 3GLs allow programmers to specify solutions in the form of algorithms. Most major programming languages, including scripting languages, are 3GLs. 3GL design is what I refer to as "orthogonal"; that is, the language has a small core syntax set and a standard extension mechanism (usually known as library or package) that allows the language to expand in functionality. Thus, a 3GL has few functionalities and uses on its own; they almost always come with a standard library to make it minimally useful, such as the C run-time library, standard Java packages and standard Python packages. This type of design fulfills the beauty of minimalism, at the expense of ease-of-use for non-coders (or coders who prefer not to code all the time).
JudoScript, on the other hand, embodies a special syntax for popular modern computing areas, such as JDBC scripting, sendmail, HTML/SGML scraping and GUI scripting. In other words, it takes a 4GL approach for popular functional areas. Because of such intimate support, scripting in these areas is more effective and elegant.
JudoScript is a genuine 3GL, too. It is an advanced programming language, with a hybrid object-oriented, procedural and thread programming model. It can directly use Java code.
UNIX shells have a 4GL flavor. They are legitimate programming languages and provide commands for tasks common to all system users. JudoScript serves a similar purpose for Java as shells do for UNIX, except Java and JudoScript go beyond the basics. They can use the latest computing trends, extend their reaches into application areas and run on multiple platforms.
|Designing Electronics with Linux||May 22, 2013|
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
- RSS Feeds
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Designing Electronics with Linux
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Validate an E-Mail Address with PHP, the Right Way
- What's the tweeting protocol?
- Kernel Problem
7 hours 56 min ago
- BASH script to log IPs on public web server
12 hours 23 min ago
15 hours 58 min ago
- Reply to comment | Linux Journal
16 hours 31 min ago
- All the articles you talked
18 hours 54 min ago
- All the articles you talked
18 hours 58 min ago
- All the articles you talked
18 hours 59 min ago
23 hours 24 min ago
- Keeping track of IP address
1 day 1 hour ago
- Roll your own dynamic dns
1 day 6 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?