github.com/xiaq/elvish@v0.12.0/website/src/ref/philosophy.md (about) 1 <!-- toc --> 2 3 The development of Elvish is driven by a set of ideas, a **design philosophy**. 4 5 # The language 6 7 * Elvish should be a real, expressive programming language. 8 9 Shells are often considered domain-specific languages (DSL), but Elvish 10 does not restrict itself to this notion. It embraces such concepts as 11 namespaces, first-class functions and exceptions. Whatever you may find in 12 a modern general-purpose programming language is likely to be found in 13 Elvish. 14 15 Elvish is not alone in this respect. There are multiple ongoing efforts; 16 [this page](https://github.com/oilshell/oil/wiki/ExternalResources) on 17 the wiki of oilshell (which is one of the efforts) is a good reference. 18 19 * Elvish should try to preserve and extend traditional shell programming 20 techniques, as long as they don't conflict with the previous tenet. Some 21 examples are: 22 23 * Barewords are simply strings. 24 25 * Prefix notation dominates, like Lisp. For example, arithmetics is done 26 like `+ 10 (/ 105 5)`. 27 28 * Pipeline is the main tool for function composition. To make pipelines 29 suitable for complex data manipulation, Elvish extends them to be able 30 to carry structured data (as opposed to just bytes). 31 32 * Output capture is the auxiliary tool for function composition. Elvish 33 functions may write structured data directly to the output, and 34 capturing the output yields the same structured data. 35 36 # The user interface 37 38 * The user interface should be usable without any customizations. It should 39 be simple and consistent by default: 40 41 * Prefer to extend well-known functionalities in other shell to inventing 42 brand new ones. For instance, in Elvish Ctrl-R summons the "history 43 listing" for searching history, akin to how Ctrl-R works in bash, but 44 more powerful. 45 46 * When a useful feature has no prior art in other shells, borrow from 47 other programs. For instance, the [navigation 48 mode](/learn/cookbook.html#navigation-mode), summoned by Ctrl-N, 49 mimics [Ranger](http://ranger.nongnu.org); while the "location mode" 50 used for quickly changing location, mimics location bars in GUI 51 browsers (and is summoned by the same key combination Ctrl-L). 52 53 * Customizability should be achieved via progammability, not an enormous 54 inventory of options that interact with each other in obscure ways.