encyclopegia.org

S-Lang

The S-Lang programming library is a software library for Unix, Windows, VMS, OS/2, and macOS.[src] It provides routines for embedding an interpreter for the S-Lang scripting language, and components to facilitate the creation of text-based applications.[src] 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.[src] It is free and open-source software released under the GNU General Public License.[src]

The S-Lang programming library is a software library for Unix, Windows, VMS, OS/2, and macOS.[src] It provides routines for embedding an interpreter for the S-Lang scripting language, and components to facilitate the creation of text-based applications.[src] 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.[src] It is free and open-source software released under the GNU General Public License.[src] ==Brief history== The S-Lang programming library was started in 1992 by John E.[src] Davis, considering that functions he wrote for a text editor might be useful in other programs.[src] 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-like syntax that he developed for use in a scientific plotting program.[src] The JED text editor was the first program to both embed the interpreter and use the terminal I/O components of the library.[src] ==Interpreter== The interpreter makes up most of the S-Lang library, and is also where most of the development takes place.[src] Although the original syntax supported by the interpreter resembled PostScript, the syntax has evolved to be much more C-like, with added support for object-oriented programming style constructs.[src] 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 and IDL.[src] Until version 2.0, the interpreter was not a standalone program.[src] Instead, Davis advocated embedding it into applications to make them extensible.[src] Using the interpreter meant either embedding it in a C program, or using it in the context of another application (e.g., the JED editor).[src] The S-Lang shell, slsh, was a demonstration program capable of little more than running scripts.[src] 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.[src] As such, it has become the S-Lang interpreter.[src] ==Screen management== In the mid-1990s while porting the sc spreadsheet to the S-Lang library, Davis developed the library's screen management facility.[src] 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.[src] The slrn newsreader was the first application to make full use of this interface.[src] 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.[src] Since version 2.0, the screen management routines have had transparent support for UTF-8.[src] ![src] /usr/bin/env slsh % The program below solves the following problem: % Sort an input file that consists of lines like this % % var1=23 other=14 ditto=23 fred=2 private variable Keys, Values; private define sort_fun (i, j) { variable s, a, b; s = Values[i] - Values[j]; !if (s) return strcmp (Keys[i], Keys[j]); return s; } define slsh_main () { variable line, len, i, vals; foreach line (stdin) { % Split string into an array of strings % % by using white chars and = as delimite % line = strtok (line, " \t\n="); len = length(line)/2; if (len == 0) continue; % Even elements are keys, odd are values % The [0::2] is an array containing indexes with a 2 specifying step % and creating indexes from 0 to the length(line) Keys = line0::2; vals = line1::2; % The variable is declared above Values = atoi (vals); i = array_sort ([0:len-1], &sort_fun); % There are different ways of writing the result.[src] Here is a % fast way that avoids a loop.[src] % The empty parenthesis () denote variable declaration and specifies % that return value should be discarded () = printf ("%s\n", strjoin (Keys[i] + "=" + vals[i], " ")); } } ==See also== ncurses ==References== ==External links== S-Lang Library Information Page, by John E.[src] Davis S-Lang Releases S-Lang Documentation[src]

31 sentences · 31 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"S-Lang." encyclopegia.org, 2026, https://encyclopegia.org/wiki/s-lang. Accessed 30 November 2026.

Chicago

"S-Lang." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/s-lang.

APA

encyclopegia.org. (2026). S-Lang. Retrieved November 30, 2026, from https://encyclopegia.org/wiki/s-lang

Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
release date2005Wikipedia

Related articles

Template:Lang-tr

stub · references available

Lang Jingshan

stub · references available

Mirko Lang

stub · references available

Mario Lang

stub · references available

k.d. lang

stub · references available

Khám Lạng

stub · references available

Declan Ronan Lang

stub · references available

Eddie Lang

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1338760895 · 0.5 · snapshot enwiki-001338760895

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.