7 ms·
This is an excellent layer on top of bash and has some overlap with concepts in other tools like fish shell, but it has me wondering, are we really at the end o
by sephoric 8y ago
This is an excellent layer on top of bash and has some overlap with concepts in other tools like fish shell, but it has me wondering, are we really at the end of the evolution of shells, so that we're now focused on making tools that improve shells? Or can we evolve the very concept of shells even further, making zsh and fish look like assembly language in comparison to Haskell?
- ariabuckles 8y agoWe can definitely evolve shells more. Most shells offer a convenient syntax around a lot of (fantastic) utilities that often mirror C libraries (notably posix). When we were working in C, having our shell mirror parts of that at times while being a very dynamic language at other times sounds great. But we have a much more varied landscape of language and library options now, and many developers haven’t ever used C or posix. So my thought is: what if we had a shell that was designed to interop with JS (or python, or ideally a language the user knows well), instead of C/posix. What if, instead of having to remember bash’s for loop syntax (or xargs), you could just write .map() and iterate over lines/execute commands that way?
- Gaelan 8y agoCheck out xonsh. I haven’t used it but it’s supposed to be a python/bash hybrid shell.
- pmalynin 8y agoXonsh is good, I’ve used it for a bit. I loved customizing but in the end I found the reliance on prompt toolkit unfortunate. It’s significantly slower than fish for example. Trying to hook into how search and similar stuff works is really hard — you end up having to hook into xonsh and then into prompt toolkit, and a lot of the source feels like it was cobbled together with a bunch of libraries. But it’s fun to use, still. I might come back to it a few versions down the road.
- evanmoran 8y agoTotally agree with this. We need to create shells based popular languages so language syntax stops being a barrier to entry for new people. How many times do we search for "if statement bash" or "function bash" because the if and function syntax isn't modern and isn't easy to remember? Transforming the shell is a great opportunity for a new project, and as you said should probably should be done in Python or JS. Lua is a good option as well for its elegance, though it's a bit less popular than the others. As for Z.lua, this is an interesting project and I really like seeing modern languages enriching what we do every day on the command line. Very cool!
- chubot 8y agoThat's the motivation behind my Oil project: Why Create a New Unix Shell? http://www.oilshell.org/blog/2018/01/28.html http://www.oilshell.org/blog/2018/01/28.html I took a very long route to doing it though, first implementing OSH (which will run existing shell scripts, which is close to done, but slow) and then Oil (a new language, not implemented). This is because POSIX shell/bash has a really strong network effect. zsh and fish are better in many respects, but people are locked into bash because that's what "everybody else uses". It's analogous to how C has a really strong network effect because e.g. every kernel is written in C. So C++ became a popular language in a large part because it's compatible with C. (Though the analogy breaks down because the Oil language isn't a superset of bash, so we can break free of legacy. The project is though.) In my mind, I think of Oil as a mix between Python and shell, with some elements of Ruby and JS (blocks, function literals, etc.)
- ariabuckles 8y agoI love what you're doing with Oil! Looking forward to trying the interactive version in the future :) And yes, network effects are so important—your C++ example is spot on. One recent example that comes to mind is the adoption from python2 to python3, showing just how big a barrier those network effects are to adopting something incompatible.
- chubot 8y ago
- rhacker 8y agoThat is the fundamental idea behind powershell. PS accesses the .NET world kinda like that. Many people love it. I would want one similar for JS and mainly fixated on the linux world (but works in Windows). Whereas PS works in Linux, I would say .NET isn't a great target for the linux audience.
- johnmaguire2013 8y agoI joked about this years ago. I'm not a Javascript fan, so really, I lamented that in a few years time, someone would make a CoffeeScript REPL[1] with built-in functions mirroring the Linux shell[2]. Call it jssh or sh.js. Just a few days ago, I saw a shell interpreter that had a method for bouncing in and out of Python with ease.[3] I'm sure the Javascript version isn't long behind. [1] https://coffeescript.org/#overview https://coffeescript.org/#overview [2] https://www.npmjs.com/package/shelljs https://www.npmjs.com/package/shelljs [3] https://xon.sh/tutorial.html#python-mode-vs-subprocess-mode https://xon.sh/tutorial.html#python-mode-vs-subprocess-mode
- Pxtl 8y agoI code a crapload of PowerShell and I've come to hate it. It's the most inconsistent language I've ever used, and the docs always bury the lede about the format of the returned object-stream, leaving me grasping to find the types and properties of everything where more text-oriented consoles would be far more wsiwyg.
- carlmr 8y agoYeah, it's a great idea but terribly executed. They could have just used F# as the new shell language, the interpreter already exists, the syntax is clean and concise, etc.
- _emacsomancer_ 8y agoeshell (https://www.gnu.org/software/emacs/manual/html_mono/eshell.html https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...) is a bit like that, but with Lisp.
- gpderetta 8y ago> What if, instead of having to remember bash’s for loop syntax (or xargs), you could just write .map() and iterate over lines/execute commands that way? But you can! The dot is spelled '|' of course, and 'map' for historical reason is called 'xarg'. There is no real lambda syntax nor closures though, everything is stringly typed.
- ninjaaron 8y agoYou have not because you ask not. https://xon.sh/ https://xon.sh/
- sametmax 8y agoWe can improve shells and terminals a lot. Shell: Currently shell code is limited to one language. If you have bash, you can only do bash. But we could imagine a shell that understands webassembly, and hence we can use it with many languages. We could even imagine tools to inline webassembly generation, so that you can code directly in your favorite language in the shell, and it gets transparently compiled and executed. Terminals: I use a combination of GUI and TUI all the time. I like my mouse. I wish there were a terminal that behaves more like a file browser, with back and next button, an address bar, and a way to temporarily switch the view from text to icons to select files with the mouse then enter a command for thoses. Some file operation should also be available from a right click on a file path. Not every shell lover wants his hands on the keyboard all the time.
- IAmLiterallyAB 8y agoI remember there being this shell/terminal hybrid that was a really advanced TUI. The best way I can describe it is, it was a blackboard/whiteboard you could run commands on. So you could have multiple commands running, and see their outputs scattered across the board (you could move things around with the mouse). Also had features like exploring filesystem trees, and inline images (I think). Can't remember what it was called and Google isn't helping :(
- sametmax 8y agoThere have been several attempts at merge GUI and TUI, but I can't remember any that looks like the one you describes appart from the inline images and fs tree exploring.
- floren 8y agoThe Acme editor is sort of like that. Text frames you can drag around and organize with the mouse. You can run commands that get their own frame for output, you can launch a shell in a frame and interact that way, you can browse directory structures, and of course you can edit files. I don't think it's what you're thinking of (Oberon, maybe?) but you might find it interesting: https://research.swtch.com/acme https://research.swtch.com/acme
- Symmetry 8y agoThere are a lot of things the address bar on my web browser does that would be useful in an interactive shell, I think.