Home Page | Introduction | Tutorials | Reference | Packages | Hacking |
? "Hello World!"; |
There are many shells, interpreters and languages available. Virtually without exception, they are incompatible with one another. What's the point of learning a tool that, no matter how sophisticated it is, leaves your source code stuck with that particular tool. You want to do scripting, so you use Python or Scheme. You want to do reporting, so you use Perl. You want to write a script, so you use Bash. You want to write an applet, so you use Java. To be a programmer these days, you need to be fluent in a dozen different languages. You would be making more money if you got a job at the United Nations.
The Business Shell is different. It is part of a language environment called ABEE, one of the most powerful and flexible environments available for Linux today. It's based on a language called AdaScript, a subset of GCC Ada, so that any project you write in Bush is immediately portable to any machine that GCC runs on. In other words, virtually everything. And it means that Bush scripts can be compiled using GCC and everyone knows that GCC is superior to most commercial compilers.
A Bush Script | A GCC Program |
procedure hello is pragma ada_95; |
with text_io; |
You don't have to rewrite your scripts to use them in applications. Use the same variable types, the same structures, the same built-in packages. Cut-and-paste your code.
If that's not enough, using the JGNAT open source compiler, you can even compile your Bush scripts into actual Java bytecode. There is another tool, A#, that will compile scripts into .NET byte code Things don't get much more platform-independent than that.
What about PHP? BUSH has a HTML template engine that runs embedded scripts in a secure environment. No need to worry about users messing with your code...unless you want them to.
<html> <head> <title>Bush script embedded in a web page</title> </head> <body> <?bush ? "Hello World!"; ?> |
It's the same BUSH source code that you use for your scripts. No need to learn a special template language with a new set of rules.
But Bush does more than just create scripts, executable programs and Java applets. It's a powerful computer language on its own able to do complex math, manipulate files, generate reports and able to do network programming. Bush will let strings grow as big as you need without worry of a running out of buffer space. And a number of built-in packages will let you do everything from compute trig functions to connecting to a web server.
But best of all, Bush is easy. Perl claims to be easy. Easily like riding a bicycle backwards in the middle of a thunderstorm. Bush is easy to read, easy to understand. You know exactly what a script does without having to have a reference book beside you at all times
Bush doesn't run your programs outright. First it examines them, compresses them, and converts them into intermediate code. (That's "byte code", to you Java developers.) Bush optimizes the program for the best possible performance. It also takes the time to verify your program will run before attempting to execute the first line.
And if you make to typing mistake, Bush will let you know before running your program. There's no need to worry that your typo will be a valid command like it would be in most other languages. Bush works for you, not against you.
One tool for all solutions.
And, yes, Bush is also makes a pretty good shell.
So you basically have two choices. Keep working for the U.N., or give Bush a try and make your life a little easier.
Figure: ABEE Multitier Enterprise Application Model
Client-Side
Presentation
On a user's desktop can run native Ada 95 applications created with the Win32 version of Ada Core Techologies' GNAT (another name for GCC Ada) or one of the commercial desktop Ada compilers. Alternatively JVM applications can be created with Ada Core Technologies' JGNAT Java byte code compiler. Or create .Net applications using A#, the Ada .Net compiler. You can also create JVM or .Net applets to run in a client's web browser. In all these cases, using Ada means that developers need to know only one core language.
Server-Side Presentation
The web server can use BUSH web
templates to create web pages with embedded AdaScript code. Like
JSP, ASP, PHP and similar products, BUSH can connect to databases and
generate new web content dynamically. BUSH templates can
communicate to the other layers by opening TCP/IP sockets (for remote
machines) or by files (on local machines). Using AdaScript for
your templates means that developments use the same core language as
used in the other layers.
Server-Side Business Logic
To manage and cache information, compiled applications and server software can be built using GCC Ada. The server software gain the speed advantage of binary code for the host machine while still being able to communicate with the other tiers through files, TCP/IP sockets. Cluster computer can be done using GCC Ada's GLADE environment: GLADE partitions a single application over multiple computers without worrying about the underlying operating system. You can also share objects using Ada's CORBA implementation. Process control and information flow can be coordinated by BUSH scripts.
Enterprise Information Systems
BUSH has integrated support for SQL so there usually no reason to reply on a database client program. The stored procedure language for most databases is very similar to AdaScript and is intuitive to learn and use if developers are already familiar with ABEE. The database package with BUSH is also available with GCC Ada applications.
At each layer, developers will need to know only one core language, with the same basic constructions and types. For example, a "for loop" is written the same way in any tier, whether for a .Net application or a BUSH web template. This reduces training costs and makes source code portable between the tiers over solutions that require different languages at each tier. In addition, the same core packages are available (string handling, math, lock file handling, I/O, and others).
In comparison, consider Sun's Java 2 Enterprise Edition (J2EE) environment. Java "components" (small applications) can be distributed across an information system using secure connections to negotiate with one another. Ignoring Sun's marketing buzzwords, you can see that the open source ABEE approach is as good as or superior to J2EE:
The components ABEE standard is the result of the work of the U.S.
government,
Ada professionals and open source volunteers.
There are many open source scripting languages and shells
available.
They are often created to solve particular kinds of problems. The
following sections summarize the major differences between BUSH and
these
other common tools.
BUSH is a shell that has the fundamental syntax of the Bourne shell. However, BUSH uses a different language for advanced features making BUSH easier to read and debug. BUSH scripts can be compiled into Java or .NET byte code or into an executable program. BUSH's reliability, scalability and speed make it ideally suited for professional scripting projects. BUSH can act as an interactive shell and can run scripts.
BUSH is a shell and language designed for high reliability business and scientific applications. BUSH scripts are slower to develop than Python programs but are easier to maintain over the lifetime of a project. The shortcuts BUSH provides are carefully chosen so as not to undercut reliability. BUSH scripts can be easily upgraded to a compiled language.
Perl is well known for being hard to learn and read. It combines the features of completely unrelated tools (including shell scripts, the sed command, and the awk command). In fact, this was the reason Larry Wall developed Perl in the first place. Perl scripts must be extensively commented to be readable. BUSH, on the other hand, is based on an international standard and has features that are designed to fit together smoothly. BUSH scripts are very readable, even with limited comments.
Perl developers also endorse Perl's shortcuts as making scripts more reliable (by making them a smaller) and as aid for programmers. BUSH also contains shortcuts, but it makes no claim that smaller scripts are easier to maintain. While Perl shortcuts can actually hurt development, BUSH's shortcuts are carefully chosen so that a programmer can't "shoot himself in the foot". Some kinds of shortcuts are dangerous. Perl will convert a number to a string automatically, whether or not the programmer made a mistake. If BUSH sees a number where a string was expected, it reports it as a serious contradiction.
Perl is not a shell and is not designed to run programs or to handle process control. However, it contains many features beyond report generation, including interprocess communication and database access. Because of its pattern matching features, cryptic syntax and shell-like quoting rules, Perl makes large projects error-prone and difficult to maintain.
Perl is often described as portable. With GNU tools and the Linux operating system, portable languages like PERL are no longer necessary. Even when PERL is chosen for portability, it is not based on any standard: features can change and break between even minor releases of PERL making PERL scripts difficult to port and upgrade. BUSH is heavily tested and based on an international standard making it more portable than PERL.
BUSH is a Linux shell and shell language designed for high reliability business and scientific applications. Although it's not a report generation language, it can generate reports using formatted output and pattern matching like PERL does.
BUSH scripts are not as "quick-and-dirty" as PERL but but BUSH scripts are easier to maintain over the lifetime of a project. Because of its emphasis on a typo-resistant syntax, BUSH is easier to maintain, especially when used large projects. BUSH scripts can also be compiled into executable programs, Java applets or .Net programs.
BUSH is a shell and scripting language. In addition, it can display information about PostgreSQL databases, run queries and display the results as psql-style responses all at the BUSH command prompt. The user doesn't have to switch between a shell and psql--BUSH handles most database needs by itself.
The BUSH shell is not an Ada interpreter. BUSH uses AdaScript, a subset of the Ada 95 language with additional features specifically for interactive shell sessions. Because of its Ada 95 background, BUSH scripts are easy to create, maintain, debug and can be compiled into fast, executable programs using an Ada 95 compiler.
If you are looking for full Ada compilers or interpreters, they are available on the Internet.
BUSH scripts can also be compiled into Java or .NET byte code (using the JGNAT compiler) and run the same way as Java applets/applications, including web page applets. BUSH scripts are easy to create, maintain, debug and can be compiled into fast, executable programs using GCC.
BUSH is a shell and language designed for high reliability business and scientific applications. BUSH scripts are more secure and robust than PHP and they are easier to debug and maintain over the lifetime of a project. BUSH has a native template engine. BUSH scripts can be easily upgraded to fast, compiled applications (using GCC) or applets (with JGNAT).
BUSH is a shell and language designed for high reliability business and scientific applications. BUSH scripts are slower to develop than Ruby programs but are easier to maintain over the lifetime of a project. Changing capitalization and white space does not change the how a script is run. BUSH features do not fall victim to the "feature bloat" syndrome that weakens the reliability of a language. BUSH scripts can be easily upgraded to a compiled application or applet.
Screenshot of the TIA IDE
The File/Check command will run BUSH with the --check (syntax check) option.
Tia is designed for building large projects. In the project parameters window, chose "Make" and create a Makefile so that TIA can build and execute your Bush projects. As long as your scripts contain a "#!" line and have executable permissions, they should be runnable from TIA after a project is built.
Instructions for using TIA are contained in the Big
Online Book of Linux Ada Programming.
BUSH offers advantages over a PHP/Apache/Perl/C solution.
Feature | C | Perl | PHP | Shell | BUSH / GCC Ada |
String Equality | strcmp/strncmp | eq | == | = | = |
Number Equality | == | == | == | -eq | = |
Bush performs all equality operations with a single tool--the equals sign. When your choice of development environment involves 4 different possibilities for equality, is this really an advantage or are developers spending too much time in paradigm shifts and adapting their software from one tool to another?
Feature | C | Perl | PHP | Shell | BUSH / GCC Ada |
Undefined Variables | never | var == undef | empty() | -z (null string) | never |
String Concatenation | strcat/strncat | . or word expansion | . | word expansion | & |
Arrays | fixed size, 0-based index | variable size, 0-based index | variable size, 0-based index or strings | variable size, 0-based index | fixed size, integer or enumerated index |
Which is easier to use? Which has a smaller risk of errors? Consider the fact that Java adds yet another non-standard level of incompatibility while ABEE (BUSH + GCC Ada) offers a consistent environment where you can be sure that fundamental features all behave the same.
To combat this problem, BUSH scripts can be developed using a progressive development model.
In its native mode, BUSH provides a quick and easy environment to write short Linux programs. Like BASH, variables can be declared anywhere and can be typeless. Although its structure is relaxed compared to a compiled programming language, AdaScript's syntax is both easier to read than a BASH script and provides much more security against typing errors. Common errors in BASH such as missing a quotation or spelling mistakes on variable names are quickly caught.
As an BUSH script grows over time, becoming longer and carries more responsibility, the structure of the script can be improved by using "pragma ada_95". This BUSH directive disables many of the "lazy" AdaScript features such as typeless variables and requires closer conformation to the Ada language. A programmer can "tighten" his code as part of his regular duties, add type checking, and ensure that the script's structure is sound and the source is readable without resorting to a complete rewrite.
Some important scripting features, like running commands in the background with "&", are still allowed.
Finally, if the BUSH script continues to grow and is no longer suitable as a script, the script can be compiled with minimum changes as an Ada program. With other shells and scripting languages, a developer would have no choice but to rewrite the script "from scratch".
Results of an HP-UX benchmark with an early version of BUSH 0.8
shows
that BUSH (when compiled) easily outperforms than the fastest shell
tested.
It ran about 16 times faster than BASH. Except for white space, the
output
was identical to the original shell script. It did not require a
rewrite
into another programming language.
End of Document