In Part 1 of this series, I introduced JudoScript, detailed its JDBC (Java Database Connectivity) scripting abilities, and demonstrated the power of its synergy of functional support on top of a general programming language engine. JudoScript is, in a way, a shell for the underlying Java platform, which is, in turn, an interface to today's computing environment that is much richer than 20 or even 10 years ago. JudoScript is designed for today's computing needs, and is a language designed for any computer developer, not just Java developers, to manipulate computers and information.
In Part 2, I concisely present the other face of JudoScript, that is, its programming capability, including Java scripting. I list JudoScript's major features, but do not elaborate on them. The features introduced are all used in a J2EE case study. To conclude, I summarize the differences between conventional and functional scripting languages. I use criteria like signal/noise ratio, directness, coherency, and focus to compare code written in JudoScript with languages like Java and Perl, where Java is arguably one of the best general-purpose programming languages and Perl is the conventional scripting language that no other has surpassed in terms of capability.
Read the whole series on JDBC scripting:
The world already has too many programming languages. Inventing a new syntax for programming truly demands reasons. JudoScript, being a general-purpose programming language as well, simply adopts a JavaScript-like programming model and syntax, which is not bad at all. However, JudoScript has many sophisticated datastructures, thread programming, object-oriented programming, and syntactic sugar—it is a powerful programming language. JudoScript is also a top-of-the-line Java scripting language, capable of scripting Java to the fullest allowed by JVMs, including capabilities to extend Java classes and implement Java interfaces using JudoScript classes. I start by introducing the basics of JudoScript programming.
Values in JudoScript all have types. JudoScript has primitive types of integer, double, string, and date and time; all other values are objects, which can be built-in type objects or any Java object. JudoScript is a dynamically typed language, meaning that variables are generic "containers," and the value held in a variable at any time has a definitive type. JudoScript supports object-oriented programming, so you can define your own classes of objects. Each type, whether a primitive value, built-in datastructure, or extraneous object, has numerous properties and a set of predefined methods that are accessed and invoked in the same way regardless of type. Here are some examples:
a = 12345;
println a, ', HEX: ', a.fmtHex(), ', Roman: ', a.fmtRoman();
d = Date(2004, 3, 26);
println 'Today (', d.fmtDate('yyyy-MM-dd'), '), week of the year is ',
d.weekOfYear;
lst = new java::ArrayList;
println "List's length: ", lst.size();
Flow controls include if-elif-else, switch-case-default, while, do-while, and the for-family statements. Unlike Java, the conditional expression for if and while does not have to be quoted in parentheses, but curly braces ({}) must always surround the bodies, even if the body contains just one statement.
Archived Discussions (Read only)