The S-Lang programming library is a
software library
In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and subr ...
for
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
,
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
,
VMS,
OS/2
OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 ...
, and
Mac OS X
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
. It provides routines for embedding an
interpreter for the S-Lang
scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.
A scripting ...
, and components to facilitate the creation of
text-based
In computing, text-based user interfaces (TUI) (alternately terminal user interfaces, to reflect a dependence upon the properties of computer terminals and not just text), is a retronym describing a type of user interface (UI) common as an ear ...
applications. The latter class of functions include routines for constructing and manipulating keymaps, an interactive line-editing facility, and both low- and high-level screen/terminal management functions. It is distributed under the terms of the
GNU General Public License
The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the Four Freedoms (Free software), four freedoms to run, study, share, and modify the software. The license was th ...
.
Brief history
The S-Lang programming library was started in 1992 by John E. Davis, considering that functions he wrote for a text editor might be useful in other programs. The earliest version of the library contained input/output routines for interacting with computer terminals and an implementation of a simple stack-based interpreter with a
PostScript
PostScript (PS) is a page description language in the electronic publishing and desktop publishing realm. It is a dynamically typed, concatenative programming language. It was created at Adobe Systems by John Warnock, Charles Geschke, Doug Br ...
-like syntax that he developed for use in a scientific plotting program. The
JED
Jed or JED may refer to:
Places
* Jed River, New Zealand
* Jed Water, a river in Scotland
* Jed, West Virginia, United States, an unincorporated community
People and fictional characters
* Jed (given name), a list of people and fictional charact ...
text editor was the first program to both embed the interpreter and use the terminal I/O components of the library.
Interpreter
The interpreter makes up most of the S-Lang library, and is also where most of the development takes place. Although the original syntax supported by the interpreter resembled PostScript, the syntax has evolved to be much more C-like, with additional support for object-oriented style constructs. As a reflection of Davis's background in physics and professional interest in scientific computing, the language natively supports many vectorized array-based operations similar to
MATLAB
MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation ...
and
IDL.
Until version 2.0, the interpreter was not a standalone program. Instead, Davis advocated embedding it into applications to make them extensible. Using the interpreter meant either embedding it in a C program, or using it in the context of another application (e.g., the
JED
Jed or JED may refer to:
Places
* Jed River, New Zealand
* Jed Water, a river in Scotland
* Jed, West Virginia, United States, an unincorporated community
People and fictional characters
* Jed (given name), a list of people and fictional charact ...
editor). The S-Lang shell, slsh, was a demonstration program capable of little more than running scripts. Version 2.0, released in 2005, made slsh interactive, and it has evolved into an application in its own right, with a number of external modules for use by it. As such, it has become the S-Lang interpreter.
Screen management
In the mid-1990s while porting the
sc spreadsheet to the S-Lang library, Davis developed the library's screen management facility. This component was designed to optimize screen output (by minimizing the number of characters sent to the terminal), and provide a simple way to support a variety of terminals through an extra layer of abstraction between the application code and the terminal. The
slrn
slrn is a console based news client for multiple operating systems, developed by John E. Davis and others. It was originally developed in 1994 for Unix-like operating systems and VMS, and now also supports Microsoft Windows. It supports scoring ...
newsreader was the first application to make full use of this interface. Since then, a number of other programs (e.g.,
Mutt) have taken advantage of this feature of the library, and it has become arguably the most used aspect of the library, as this component is considered to be an alternative to
curses
A curse (also called an imprecation, malediction, execration, malison, anathema, or commination) is any expressed wish that some form of adversity or misfortune will befall or attach to one or more persons, a place, or an object. In particular ...
.
[''Linux application development'', by Michael K. Johnson and Erik W. Troan, Addison-Wesley, 2005, , p513] Since version 2.0, the screen management routines have had transparent support for
UTF-8
UTF-8 is a variable-width encoding, variable-length character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode'' (or ''Universal Coded Character Set'') ''Transformation Format 8-bit'' ...
.
See also
*
ncurses
ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing "GUI-like" ...
References
External links
S-Lang Library Information Page by John E. Davis
S-Lang Releases
{{DEFAULTSORT:S-Lang (Programming Library)
S-Lang
Text user interface libraries
Unix programming tools