197 points · by ingve · 9y ago · 86 comments
For example, since I'm prone to making stupid mistakes, I always use a linter. But as far as I know, there weren't any well known options for linting until ShellCheck [0].
Personally, I've been using fish for a while now and I'm generally happy with it. It has great defaults, so I rarely have to tweak anything. Hacking together small scripts is easy, leaving very little room for error.
If I have to do anything event remotely tricky, I use node with shelljs [1]. Now that async functions are available, it results in some pretty clean scripts. And although I haven't tried it yet, the pkg [2] tool allows you to bundle things up into a single binary. That should make certain deployments incredibly easy.
Circling back to Elvish, one minor detail that immediately stood out to me was that they create another folder in your home folder. Since I dislike the ever-growing clutter in my home, I created a GitHub issue asking them to consider following the XDG base directory spec [3].
[0] https://www.shellcheck.net
[1] http://documentup.com/shelljs/shelljs
All javascript can now be minified to zero bytes [0]. This can result in a significant improvement in asset load times as well as render times.
Furthermore, by following the process backwards developers can save time in the build process.
I'm also happy to announce that this new technology is supported by all major browsers that anyone will ever want to use: Firefox, Chrome, Opera, Edge, lynx etc.
(PS: there are also significant improvements waiting in accessibility and SEO.)
Sincerly,
Greybeard
Fullstacker
[0]: for more details about how this can happen see the papers linked here: https://www.google.no/search?q=html+spec
Frontend communities have been building their docs as static sites forever. You aren't telling 'frontenders' anything they don't know here.
That's just the point. Few people do this, yet the effect is vastly more usable, readable, and clean than "modern design", which ironically is much more difficult to pull off.
It doesn't feel like any SPA I know.
$ curl -s https://api.github.com/repos/elves/elvish/issues |
jr 'each{|issue| puts "#{issue["number"]}: #{issue["title"]}"} ' | head -n 11
Or (I expect pitchforks when you see the implementation for this): $ curl -s https://api.github.com/repos/elves/elvish/issues |
jr 'puts{"#{$I["number"]}: #{$I["title"]}"}' | head -n 11
With "jr" looking like this[1]. Expect this to fall apart in all kinds of ways - it was just something I threw together. Not convinced the monkey-patched "puts" is worth it, but it's just an experiment..[1] https://gist.github.com/vidarh/d088d6e342e665f0b6554ec4fbaa5...
jr 'puts{$number+": "+$title}'
E.g by changing the "each" in my example with: def each █
$J.each do |i|
$I = i;
i.keys.each {|k| eval("$#{k} = $I[k].to_s")}
block.call(i)
end
end
Though this is error prone - e.g. if the key collides with any pre-defined Ruby globals like $stdin... Would probably be worth using a prefix etc.. This is the downside to using a general purpose language for stuff like this instead of a specialised tool like jq which can ignore other syntax concerns..Sounds like Powershell.
The problem of designing the shell becomes both much harder and simpler at the same time. Harder because you need to figure a way to really pass objects from one process to another, which implies some sort of serialization protocol. On the other hand the shell becomes simpler again, because the processes will (most likely) do most of the heavy lifting of managing objects etc.
No criticism, though. Powershell is brilliant, and I'm glad to see the Unix world starting to take cues from it.
Wot?
Ugly syntax, cryptic error messages and random idiosyncrasies like misplaced semicolons turning variables into lists... The language is a nightmare.
Yeah, nothing like the elegance, straightforward messages, and "no surprises" of POSIX shells...
Can you elaborate on the semicolons? Lists are declared by a comma, not semicolon: `$a = 1,2`, or `$a = @(1)` to enforce it
It seems that none of recently emerged shells had that point in their design:
- elvish: no (https://github.com/elves/elvish/issues/193).
- xonsh: no (https://github.com/xonsh/xonsh/issues/1959).
- fish: no (https://github.com/fish-shell/fish-shell/issues/238).
[ranger]: http://ranger.nongnu.org/ [autojump]: https://github.com/wting/autojump [fzf]: https://github.com/junegunn/fzf
You had me up until this point.
Well that is definitely interesting.... Are there any examples? I was writing a compiler that worked by pipelining different stages to different parts of the compiler (tokenizer -> parser -> AST) all using unix pipes. I had to stop and do something productive once I realized I couldn't pipe complex datatypes easily without a lot of effort to parse the inputs.
I'd love to see an example of this.
Python was originally developed as a shell language for the Amoeba distributed operating system. ( https://docs.python.org/3/faq/general.html#why-was-python-cr... )
I find with the addition of the IPython "shell magic" I can easily do anything that doesn't fit e.g. Bash (for my skill level of course.)
curl -s https://api.github.com/repos/elves/elvish/issues | jq -r '.[] | [(.number|tostring), .title] | join(": ")'~> + 1 7 6 324 234 ▶ 572
https://fishshell.com/assets/img/screenshots/autosuggestion....