[announce] execline-

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Sat, 31 Mar 2018 23:15:43 +0000

  execline- is out.

  As you all know by now, the main obstacle to adoption of skaware by
distributions and mainstream Unix folks is the user interface; so, the
obvious next improvements to skarnet.org software is to provide
interfaces people are comfortable with. This is true for s6 + s6-rc,
but this is also true for execline.

  One of the main criticisms that execline gets is that for its purpose,
i.e. light scripting and gluing components together, people are already
used to the standard Unix shell, and have trouble wrapping their minds
around a new scripting tool with a very different syntax.
  I am convinced that execline offers significant benefits over the
shell in certain circumstances - in particular, it is much easier to
autogenerate; still, I want to make it easier for regular shell users
to approach and understand execline.

  So, with user-friendliness as a major goal, with version,
some execline commands have changed names. Commands that provide
equivalent functionality of a shell construct are now named after
the shell's syntax for that construct. Specifically:

  background is now named &
  backtick is now named `
  define is now named =
  dollarat is now named $_at_
  elglob is now named *
  fdclose is now named >&-
  fdmove is now named >&
  fdswap is now named <>
  foreground is now named ;
  getpid is now named !
  heredoc is now named <<
  homeof is now named ~
  if is now named &&
  importas is now named $
  pipeline is now named |
  redirfd is now named <

  I believe this renaming allows users coming from the shell to get
acquainted with execline without changing too many of their habits
and smoothly transition to a new approach to scripting. For instance,
the examples/etc/execline-shell script now reads:

#!/bin/execlineb -S0
` -n home { && -nt { ` -n user { id -un } $ -u user user $ -D $user USER
< -w 2 /dev/null ~ ${USER} } echo / }
$ -u home home $ -D $home HOME HOME
tryexec { ${HOME}/.execline-shell $_at_ }
/bin/sh $_at_

  which indubitably mimics the readability of a shell script much more
than the same script using the old execline command names ever did.

  An added benefit of this change is brevity. Where previous names of
execline commands were verbose, and execline scripts could be long
to type and annoying to read, the new names are very short, which
allows execline to approach the terseness and reader-friendliness of
the shell. For instance, one of the execline quines now reads as such:

= e "#!/bin/execlineb
= e $q${E}${q}
env e=$e
= q ${b}${q}
= b ${b}${b}
$ E e
echo $e"
env e=$e
= q \"
= b \\
$ E e
echo $e

  which is as short as a quine will ever be, while definitely looking
more like a shell script than quines for previous execline versions.

  Note that for execline, command brevity also means that you can fit
longer scripts into the limits of a command line, so the new version
allows you to write more featureful, more complete scripts without
hitting execline's inherent limitations. The benefits are numerous.

  I sincerely hope this change will help smooth the learning curve of
the execline syntax, and increase adoption of the language among
newbies and die-hard Unix veterans alike.


  Bug-reports welcome.

Received on Sat Mar 31 2018 - 23:15:43 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC