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
|
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
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.
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 and Eggshell runtime library, and generates an output program. The
Eggshell runtime library "eshrt", somewhat like crt0 of GCC, defines
functions for call stack management, function and translation unit
context switching, declaration of static and local variables, and the
calling of initialization functions.
eshc (not yet written) is a compiler driver, like the gcc compiler
driver of GCC. It runs eshtrans and eshld.
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).
|