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.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- SUSE LLC's SUSE Manager
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Doing for User Space What We Did for Kernel Space
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide