1. 17
  1. 3

    This looks quite ergonomic; the distinction between byte streams and values looks like a nice way to build something better than just what UNIX pipes afford.

    1. 2

      Line continuation in Elvish uses ^ instead of \

      Unlike traditional shells, line continuation is treated as whitespace.

      Why? This would mess with me (and maybe others coming from posix/bash/everwhere else that doesn’t do it like this?), and there’s no explanation of why it’s whitespace and why it uses ^ instead of \

      1. 3

        \ is an ordinary bareword to make Elvish more ergonomic on Windows - Windows support is experimental right now but I do expect Windows to become a first-class platform supported by Elvish.

        For the whitespace part, there are actually very few languages with the bash behavior, and I’ve been bitten by that in the past. I also find it more intuitive for line continuation to function as whitespace.

        I considered adding the rationale for the features to the page, but that would make it too long and no longer a “quick” tour. Maybe some of the more non-obvious design choices should be added to the FAQ.

        1. 1

          Maybe make the backslash behavior platform specific, so it behaves normally-for-shells on non-Windows systems? Otherwise I can see this tripping up a lot of users — I can’t think of any language I use that doesn’t use backslash for line continuations, so it’s kind of reflexive to use it.

          1. 1

            That’s an option I considered, but the additional complexity doesn’t seem to be worth it.

        2. 1

          ^ for continuation is per Windows (cmd, maybe others too), but not the whitespace rule.

        3. 1

          At first I was disappointed that it’s not actually in Elvish (which is supported by Unicode, is it not?)

          But it does look like a nice shell. It’s just that there are a couple of new modernized shells, and I’ve been stymied by the paradox of choice and haven’t jumped into any.

          Any quick summary of the pros and cons vs. Oil or Fish?

          1. 3

            At first I was disappointed that it’s not actually in Elvish (which is supported by Unicode, is it not?)

            You probably mean Tokien’s Tengwar script; unfortunately it isn’t part of Unicode yet: https://en.wikipedia.org/wiki/Tengwar#Unicode

            You might be further disappointed that the name of Elvish is also not directly related to Tokien’s Elvish languages: https://elv.sh/learn/faq.html#why-is-elvish-called-elvish

            1. 2

              Any quick summary of the pros and cons vs. Oil or Fish?

              If I have to summarize each one in one sentence:

              • Elvish is a functional programming language with a shell-like “feeling”, with nice UI features.
              • Fish is a tidied up version of bash/zsh, with nice UI features.
              • Oil is an upgrade path from bash to a modern language, and doesn’t have many nice UI features yet.

              Here’s the slightly longer version. There are two dimensions you can compare shells, the programming languge and UI features.

              • Elvish is as expressive as most modern dynamic languages - the language isn’t quite complete yet, but with lists, maps, lambdas it has a pretty robust functional programming core (you’ll find a lot of parallels with Lisp in Elvish). Its UI features are quite mature - some parts are not quite as mature as Fish but getting there, while othe parts (like the location mode) are not present in the out-of-box experience of most other shells.

              • Oil is, IIUC, intended to be as expressive as most modern dynamic languages too (my impression is that much of it is modelled after Python), but it isn’t there yet. The language also has two different modes, the “osh” mode is intended to be 100% backward compatible with bash, while the “oil” mode is not. Oil doesn’t have a lot of UI features yet since the focus is still on developing the language I believe.

              • Fish the language is quite limited in expressiveness - for example, you can’t build nested lists in Fish. In terms of the range of things the language can do it’s perhaps somewhere between bash and zsh, although it’s definitely more tidy. Fish has very mature UI features.

              1. 1

                It’s just that there are a couple of new modernized shells, and I’ve been stymied by the paradox of choice and haven’t jumped into any.

                If you want a daily driver today, Elvish is likely the most ready one out there. Most other modern shells have some pretty big limitations - for example, Oil doesn’t have good interactive features yet, Nu’s language is quite restricted the last time I checked, and changing fast. (This is a fast changing landscape though so my information might already be outdated - I’d be happy to be proven wrong.)

                Elvish also has a pretty active community right now - you can find it on the homepage https://elv.sh