Execline

From Esolang
Jump to navigation Jump to search

execline is the first script language to rely entirely on chain loading. An execline script is a single argv, made up of a chain of programs designed to perform their action then exec() into the next one. ~ Laurent Bercot[1]

Execline
Designed by Laurent Bercot
Appeared in 2013
Computational class Unknown
Reference implementation [1]
Influenced Vixen
File extension(s) .sh

execline is a scripting language designed to provide an alternative paradigm for shell scripts. An implementation of execline consists of several dozen independent programs installed to the shell path rather than a monolithic interpreter. Instead of compiling an input program into an intermediate form like Bash or Oils, execline parses programs into a sequence of tokens which are passed to an exec() system call. Each execline program is a Bernstein chain loader which modifies its environment slightly, often consuming some of its argv, before performing another exec(); execution proceeds by repeated exec() system calls.

Examples

A quine by Paul Jarc using echo to emit code:

#!/command/execlineb -P
define e "#!/command/execlineb -P
define e ${q}${E}${q}
export E $e
define q ${b}${q}
define b ${b}${b}
importas E E
echo $e"
export E $e
define q \"
define b \\
importas E E
echo $e

A quine by Sertonix [2] using only execline commands:

#!/bin/execlineb
export \# 1
define 1 "#!/bin/execlineb
export ${b}# 1
define 1 ${q}${1}${q}
export 1 $1
define q ${b}${q}
define b ${b}${b}
importas 1 1
export 1 $1
dollarat"
export 1 $1
define q \"
define b \\
importas 1 1
export 1 $1
dollarat

References

  1. L. Bercot. execline: language grammar and design. https://www.skarnet.org/software/execline/grammar.html