Appendix A. JRuby IRB and Java API

Human-machine interface styles have varied over time, based on the nature of the device in question as well as somewhat arbitrary trends. Command-Line Interfaces (or CLIs) were the primary means of interacting with operating systems before the 1990s. After that time, they were overshadowed by graphical operating systems and the visually dominated Internet. Despite their relatively humble appearance, CLIs remain popular due to functionality they provide that is not readily available through a GUI.

The pattern of interaction provided by a CLI reflects the functionality of teleprinters (gizmos that evolved from telegraph machines used to send typed messages). A CLI is more reliant on a user’s typing ability than a corresponding GUI. This limitation is also an advantage in that CLIs lend themselves to scripting. Most programmers have some experience in a CLI through the command-line shell of whatever operating system they are using. When tasks become more involved, it is simple to bundle a set of commands together into a script. This capability has resulted in many scripting languages, including their own CLIs as an execution environment.

A CLI might also be referred to as a REPL (Read-Eval-Print Loop) or a language shell. Whatever you call them, they are invaluable for exploring language features and getting immediate feedback on the effect of running a given expression or command.

Though Java itself does not include a CLI (Beanshell is the closest equivalent), ...

Get Client-Server Web Apps with JavaScript and Java now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.