EGSHEL

From Esolang
Jump to navigation Jump to search

EGSHEL (the Extensible Golfing Scripting High Efficiency Language) is a highly extensible pseudoesoteric stack-aware object-oriented scripting language in development by User:Catb0t intended partially for golfing, but which can also be implemented in more useful circumstances as a 'real' scripting language, and which can be built upon and used for almost anything.

Modes

EGSHEL implements two main modes, Concise (designed for golf) and Verbose (designed for readability and ease of use). In Concise, variables may only be uppercase A-Z, and builtins are bound to lowercase a-z. Most operations in this mode only take a few characters, though still far more than stack-oriented golfing languages. In Verbose, most builtins don't exceed 3 characters, and the preferred syntax changes. Concise code may be run in Verbose mode (the parser's default) but not the reverse.

Syntax & Grammar

EGSHEL has access to a few unique and interesting features:

Operator Example Explanation
0-9 A3 variable names cannot contain numbers 0-9 and if there's no assignment operator this must be Concise, thus A is 3.
@ B@AC defines B as a listener on A and C concatenated, such that when A or C's values change, B's value is automatically updated
~ C2~B defines C as B's 3rd history index, aka what B was 3 values ago
|- |- comment single line comment delineator

To decrease character counts, EGSHEL eliminates most delimiting grammar and punctuation, instead preferring semicolons or newlines to (for example) close strings.

Examples

Hello, World!

Concise: (15 bytes)

  v'Hello, World!

Verbose: (18 bytes)

  vsb'Hello, World!'

Verbose mode prefers close single and double quotes and verbose statements. Whitespace, however, is still unneeded.

99 Bottles of Beer

Concise: (91 bytes)

   A"Take one down, pass it around" on the wall," bottles of beer*99;B@~2AC@~1A".;{:A:vBC2~A,-A
             2~A                        1~A              ~A        A
   A"Take one down, pass it around" on the wall," bottles of beer*99;   -| define A as all the constructs we need, one after another
   B@~2AC@~1A".;   -| make B listen on a chronoconcatenation of A and its 2 previous values; make C listen on A and its most recent value
   {:A:vBC2~A,-A   -| for I in A: print B, print C, print A's oldest value, decrement A

External resources