summaryrefslogtreecommitdiffstats
path: root/README
blob: 1d1e279e593ed409fb9dc0d3b9b137a421d99351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Eggshell Language
=================

Eggshell is an extension to (and proper superset of) shell command
language as specified by the POSIX.1 Shell and Utilities (XCU) Volume
and implemented by many Bourne- and Korn-compatible shells.  It enables
programs to be written, compiled, and linked like C programs and then
executed on any POSIX-conformant shell.

Features
--------

  * Static global variables and functions that are visible and
    persistent only within their translation unit
  * Proper local variables that, unlike in shells with a "local"
    command, are visible and persistent only within their function's
    frame in the call stack and are not clobbered by recursive function
    calls
  * Initialization function attribute
  * Stack trace function
  * Function parameter lists with type specifiers

Eggshell Toolchain
==================

eshtrans is a compiler (or "translator"), like the cc1 compiler of GCC.
It parses Eggshell source files and generates shell command language
object files.

eshrt is a runtime library, somewhat like crt0 of GCC.  It defines
functions for call stack management, function and translation unit
context switching, declaration of static and local variables, function
argument checking, and the calling of initialization functions.

eshld is a build-time linker, like ld of GNU Binutils.  It reads object
files built by eshtrans, adds a magic number ("#!") with interpreter
path, inserts Eggshell runtime library object files, and generates an
output program.

eshc (not yet written) is a compiler driver, like the gcc compiler
driver of GCC.  It runs eshtrans and eshld.

libeshprof is a function call profiling/tracing library, and eshprof is
a profiling analyzer.  Together they can profile functions of a program,
like gprof of GNU Binutils does, to identify which functions take the
most execution time.

Portability
===========

Since the Eggshell toolchain translates programs into shell command
language and implements Eggshell's features in a small and portable
runtime library, Eggshell programs can be portable to any
POSIX-conformant shell.

The Eggshell toolchain is tested to build programs that run on GNU
Bourne Again SHell (bash), Debian Almquist Shell (dash), BusyBox
Almquist Shell (ash), KornShell (ksh93), MirBSD Korn Shell (mksh), and
Z Shell (zsh).