| Using Rexx for easy Desktop Linux scripting |
by Howard Fosdick (May 28, 2005)
Foreword: This article by Howard Fosdick, author of the Rexx: Programmer's Reference, tells you everything you need to know to get started using Rexx on your Linux desktop. Linux features powerful scripting languages like Bash and Perl, but these may not be suitable for end user scripting. Rexx, on the other hand, has proven ideal for desktop Linux users, according to Fosdick, yet it combines both ease of use and power, and is available in a three basic forms including procedural ("classic" Rexx), object-oriented, and Java-compatible versions.
Using Rexx for easy Desktop Linux scripting
by Howard Fosdick Linux runs a plethora of free shell languages. These include Bash, the KornShell, the C shell, and their supporting tools such as awk, sed, and yacc. Linux also offers an exceptional selection of powerful free scripting languages such as Perl, Python, and Ruby. Linux developers dwell in hog heaven. Who wouldn’t love this set of powerful scripting tools? The answer, of course, is the desktop user. This person is not a professional developer. He doesn’t have the time or inclination to learn an advanced language like Bash or Perl. Nor does he program full-time. This person might be an IT professional who is employed somewhere other than in desktop development. Or she might be a "sophisticated user" -- a professional employed outside of IT, such as a business person or administrator or engineer or scientist. Users script to tailor their systems, automate repetitive tasks, or solve simple programming problems. Languages that base their power on complex syntax, such as Bash or Perl, are difficult for them to learn, master, and remember. Users require a language they can script from memory, since they don’t program every day. They like languages with minimal syntax, forgiving formatting, and easy interactive debugging. Their language has to be designed for quick learning and ease of use while still supplying power. Rexx fulfills this role. Rexx was bundled with both OS/2 and the Amiga OS based on its exceptional ease of learning and ease of use. But Rexx yields power: the language drives mainframes, where it has been the default scripting language for over twenty years. Ease of use and power conflict. Rexx reconciles them through its tiny instruction set surrounded by a large set of built-in functions. As in C language, this design allows users to quickly code in the language while expanding their knowledge into the function set at their own pace. But Rexx differs from C in that scripts contain almost no punctuation or syntax. Rexx instructions and functions are high-level. Rexx is a glue language. Scripts easily stitch together existing programs, scripts, operating system commands, APIs, DLLs, shared libraries, objects, widgets, components, and the like. Rexx supplies power through easy extensibility: external functions are coded just like internal ones (after a statement sets up access to the external library). Scripts leverage existing code to increase productivity and give power to casual programmers. Rexx capitalizes on its interpreted nature to avoid the programming restrictions that frustrate non-professionals. Take data typing and storage allocation, for example. Rexx does not type variables; all variables contain variable-length strings. Variables containing valid numbers may be used in computations, while the others are simply character, bit, or hex strings. Variables may either defined by use or declared in advance. Rexx automatically manages all aspects of variable sizing and storage allocation. Consider how this applies to arrays. An array does not have to be declared. Its size automatically expands and contracts as required. Arrays can contain like or varied data elements. They can be homogeneous or heterogeneous, sparse or dense, indexed by numbers or arbitrary strings or variables, and subscripted to any degree. This flexibility yields power. Yet it is all based on the simple syntax of variable names separated by periods, such as: my_array.1 or my_array.1.4. Arrays may be indexed by variables and arbitrary character strings as well as numbers, as in my_array.my_subscript. This allows users to create any imaginable data structure with them, including lists, key-value pairs, look-up tables, trees, balanced trees, linked lists, doubly-linked lists, and more. All this is achieved with the simple "dot notation" of arrays. No other syntax is necessary. The result is power without complexity. Rexx varieties
Rexx comes in three basic varieties: Procedural or Classic Rexx; Object-oriented Rexx; and NetRexx. - Procedural or Classic Rexx -- this variety of Rexx features a strong international standard to which all interpreters adhere. It's a cross-platform scripting tool that runs on every imaginable platform, from handhelds to PCs to servers to mainframes. Users can run the same scripts on desktop Linux as on their handhelds, for example. Rexx even integrates desktop Linux into mainframe sites because it is the predominant mainframe scripting language.
When using Procedural (Classic) Rexx, Linux users can choose among three available Rexx interpreters:
- Regina features many built-in extensions to the language and comes with book-quality documentation. Regina runs under all varieties of Linux, BSD, and Unix as well as all other major operating systems. Regina has a large user community and is a great place to start with Rexx.
- Rexx/imc was specifically designed for Linux, BSD, and Unix. It is a standard Rexx with a few well-chosen additional features for the Linux user. Rexx/imc has been around for a decade. It's a rock-solid interpreter with a proven, long-term track record for support.
- BRexx is the smallest and fastest Rexx interpreter. It runs in tiny and embedded Linux systems (as well as on the Mac OS, Windows CE, DOS, BSD, Unix and Amiga OS). BRexx runs like a bandit with the cops on his tail in memory-resident Linuxes like Knoppix.
- Object-oriented Rexx -- this variety of Rexx was originally developed by IBM Corporation. Called Object REXX, it was released as open source and turned over to the Rexx Language Association in late 2004. The Rexx L.A. renamed it Open Object Rexx or ooRexx for short. ooRexx is fully object-oriented. It supports inheritance, multiple inheritance, classes, messages, polymorphism, overloading, intra-object concurrency, and a powerful class library. Open Object Rexx runs under all versions of Linux, Unix, and Windows.
What makes ooRexx unique is that it is 100 percent upwardly-compatible with classic Rexx. Users can work under ooRexx immediately, coding procedural scripts, then wander into object-oriented scripting at their own pace. Companies preserve their investment in traditional Rexx scripts even as they migrate to object-oriented scripting. Are object-oriented languages the best choice for desktop users? The question is debatable. If you believe they are ooRexx presents an easy-to-learn alternative to Python or Ruby.
- NetRexx -- this final variety of Rexx brings Rexx's traditional user-friendliness to the Java environment. It either runs under the Java Virtual Machine (JVM) or stand-alone. NetRexx scripts use Java classes and may be used to create classes used by Java programs. NetRexx can be used to develop applets, applications, servlets, classes, and beans. NetRexx is not a standard Rexx and can best be described as a "Rexx-like language." Most consider it a developer tool rather than an end-user language.
NetRexx's big advantage is that it provides an easy scripting alternative to traditional Java programming. An IBM study showed that NetRexx reduced the number of lexical tokens versus Java source for a typical class by about 35 percent while requiring 20 percent fewer keystrokes. With complete JVM compatibility, NetRexx can be intermixed to any degree desired into Java-based systems. NetRexx can even generate fully commented Java code. Rexx For Desktop Linux? With its very different personality, Rexx nicely complements Linux's power scripting languages. Rexx offers ease of use and ease of learning while supplying power and flexibility. It is especially suitable for end user programming and for use by computer professionals who script only on occasion. Rexx addresses the needs of the desktop Linux user. Rexx has hundreds of thousands of users world-wide. Yet it's little-known within the American Linux community because its heaviest use has been on other platforms. Rexx earned itself a role as the bundled language of operating systems like the Amiga OS and OS/2. It fulfills a real need for desktop Linux users. Learn More This short article omits the most important item in your understanding of Rexx -- example scripts. You can download several dozen example scripts in a single compressed file. These examples run under Linux and/or Windows. They include a half-dozen Open Object Rexx scripts for Linux. My new book Rexx Programmer's Reference covers everything about free Rexx. It starts with a simple tutorial, then progresses into advanced scripting, tools and interpreters, and a complete language reference. What about support? The Rexx Language Association is an international organization devoted to Rexx. Along with the web sites above for specific interpreters, it’s a great source of tools and information. Rexx forums offer support in a half dozen languages. Check them out in English, French, German, Russian, and Japanese. An international platform like desktop Linux needs international support -- and Rexx provides it.
About the Author: Howard Fosdick is an independent DBA contractor who's worked with most major scripting languages. His book Rexx: Programmer's Reference is the complete tutorial and reference for Rexx. It covers all aspects of the language, its tools and interfaces -- in 700 pages for under $30.
Related stories:
(Click here for further information)
|
|
|
Approaching the Linux Desktop
The purpose of this paper is to help organizations evaluate the Linux desktop against their own enterprise needs and discover what benefits the Linux desktop might bring to their organizations.
Migrating To Linux: Application Challenges and Solutions
Several solutions exist to help organizations migrate in an orderly fashion from Windows to Linux desktops. This paper establishes the characteristics of an ideal cross-platform solution and reviews these alternatives in light of this ideal standard. The paper takes a closer look at the pros and cons of various solutions and outlines the business benefits that can be achieved.
Linux Advantages: Publicly Available Information on Linux Software
This paper offers a brief summary of readily-available Linux information to help businesses sort out this widely misunderstood operating system.
Top 5 Strategies for Managing Linux
Despite continuous evolution in the manageability of Linux, a 2006 survey cited manageability concerns as a top reason why organizations are hesitating to adopt Linux. Levanta believes Linux can be as manageable, if not more so, than other operating systems by following key strategies. These strategic recommendations were developed from experiences in numerous customer environments, both large and small.
Why Choose Novell for Linux?
This paper outlines the benefits of switching to the Linux platform and choosing Novell as a high-performance, enterprise solution.
Enterprise Linux Selection Guide
Considering moving your enterprise to the Linux operating system? Since there are so many similar versions, choosing the right one can be tough. This paper offers a clear process to help you make an informed decision and get the features, support, and cost that are right for your business and technical needs.
Overcoming Challenges in Managing Linux
Levanta has created a new administration model with innovative technology that breaks down the barriers to making the most of Linux systems. This paper will provide an in-depth look at the workings of Levanta’s product, the first Linux appliance of its kind.
SUSE Linux Enterprise 10 for Retail Businesses
Discover why major retailers have switched to SUSE Linux Enterprise Desktop in the back office. SUSE Linux Enterprise Desktop 10 is a low-cost desktop that offers a complete set of productivity applications and interoperates seamlessly with the other Windows, Macintosh and UNIX desktops in your store.
Moving to a Linux Desktop
Migrating from Windows to Linux on the desktop can be a substantial undertaking because it has the potential for touching -- and perhaps disrupting -- every user in your organization. Unlike a data center (server and infrastructure) migration that is largely transparent to users, the cultural and administrative transitions and environment readiness required to support a Linux desktop migration are extensive.
Seven Good Reasons to Exchange Exchange
This paper describes seven compelling reasons why you should switch from Exchange to Scalix.
|
|
|
|
|