S-Lang (programming library)
Encyclopedia
The S-Lang programming library is a software library for Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

, Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, VMS
VMS
- Communication and transportation :* Voice Mail System, automated telephone messaging* Video Messaging Service , video messaging for 3G handsets* VMS MobiFone, one of the largest mobile phone operators in Vietnam...

, OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

, and Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

. It provides routines for embedding an interpreter for the S-Lang scripting language, and components to facilitate the creation of text-based 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.

Brief history

The S-Lang programming library was started in 1991 by John E. Davis as
a convenient way to reuse code among several of his software projects.
The earliest version of the library contained input/output routines
for interacting with computer terminals, and included an
implementation of a simple stack-based interpreter with a
postscript-like syntax that he developed for use in a scientific
plotting program. The JED
JED (text editor)
JED is a text editor that makes extensive use of the S-Lang library. It is highly cross-platform compatible; JED runs on Windows and all flavors on Linux and Unix. Older versions are available for DOS. It is also very lightweight , which makes it an ideal editor for older systems, embedded systems,...

 text-editor was the
first program to both embed the interpreter and use the
terminal I/O components of the library.

Interpreter

The bulk of what makes up the S-Lang library is its interpreter, and
it 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 familiar to Matlab
MATLAB
MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages,...

 and IDL
IDL
- General :* International Date Line, the time zone date boundary* Intermediate density lipoprotein* John F. Kennedy International Airport, from when it was named "Idlewild Airport" * International Drivers License...

 users.

Up until the release of version 2.0, Davis had always advocated that
the interpreter be embedded into applications to make them extensible.
That is, using the interpreter meant either writing a C program that
embedded it, or using it in the context of another application (e.g.,
the JED
JED (text editor)
JED is a text editor that makes extensive use of the S-Lang library. It is highly cross-platform compatible; JED runs on Windows and all flavors on Linux and Unix. Older versions are available for DOS. It is also very lightweight , which makes it an ideal editor for older systems, embedded systems,...

 editor). In this sense, a standalone
program called the S-Lang interpreter did not exist. Version 2.0 was
released in 2005 with an interactive version of the S-Lang shell,
slsh, which until then was distributed as a demo program that was
capable of little more than running non-interactive scripts. Since
then slsh has evolved into an application in its own right, and has
had a number of external modules developed 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 of supporting a variety of terminals through an extra layer
of abstraction between the application code and the terminal. The
slrn
Slrn
slrn is an open source text-based news client. It was originally developed for Unix-like operating systems, but is now available for many other operating systems, including Microsoft Windows....

 newsreader was the first application to make full use of this
interface. Since then a number of other programs (e.g.,
Mutt
Mutt (e-mail client)
Mutt is a text-based email client for Unix-like systems. It was originally written by Michael Elkins in 1995 and released under the GNU General Public License version 2 or any later version....

) have taken advantage of this feature of
the library, and it has become perhaps arguably the most used aspect
of the library. Since version 2.0, the screen management routines
have had transparent support for UTF-8
UTF-8
UTF-8 is a multibyte character encoding for Unicode. Like UTF-16 and UTF-32, UTF-8 can represent every character in the Unicode character set. Unlike them, it is backward-compatible with ASCII and avoids the complications of endianness and byte order marks...

.

External links

  • http://www.jedsoft.org/slang/
  • http://www.jedsoft.org/slang/slsh/
  • http://space.mit.edu/cxc/software/slang/modules/
  • http://www.s-lang.org/
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK