>One major difference is that osh is designed to be used from within an existing shell, such as bash; while PowerShell, due to the absence of well-developed shells in the Windows world, is a complete shell.
- Typed inputs and IntelliSense. There is very basic support for types, even so, I'd love even more strict types and type inference as in Typescript, so my terminal and shell can give me a hint what kind of input the command is expecting. At the same time, IntelliSense should tell me what command flags are still available and what are viable inputs, like cd suggesting only directories, or kubectl --namespace suggesting available namespaces.
- A concept of past commands as building blocks and/or interactive data wrangling. Many times I am mucking around in zsh to find a chain of commands that reliably gets the data I need out of some CSV or other source, retyping the same few commands with some new links until it works the way I want it to.
- A command like EXPLAIN in SQL so I can see where I should rethink what I am doing so I can refactor that part of the chain. At the same time, I'd love it if I could take one of those magic snippets from Stack Overflow and have an EXPLAIN-like command pick the components apart and explain the flags via some structured docstring format.
- Snippets in the Shell for some regularly used patterns of command chains.
- The concept of transactions, like in SQL, so I can run a command or script without worrying about it failing halfway through - the shell automatically undoing its changes. Maybe this should work on the level of a shell session even.
This is basically a function on a streams, that takes an input N, and filters for files that changed in the last N days. To use it:
ls -fr | recent 3
I don't understand what EXPLAIN would do. In SQL, EXPLAIN helps you see the actual implementation chosen for a non-procedural statement. Marcel, nushell, etc. have no optimizer, so there is no invisible execution plan, that would be made visible using EXPLAIN.
Transactions: Might be feasible with a shell built on some kind of COW filesystem, but I'm dubious of how much transaction isolation is really possible even then.
Check out marcel: https://marceltheshell.org, and https://github.com/geophile/marcel. Both marcel and nushell start with the idea of piping structured data instead of strings, which is incredibly powerful. (This also applies to osh. I am the author of osh and marcel.)
Marcel (and osh) rely on Python types and language where typical shells have sublanguages. So instead of awk or find and their sublanguages, you just use Python. Instead of piping strings, you pipe streams of Python values.
Marcel lets you use Python on the commmand line. It also has an API which allows you to use shell-like commands inside of Python programs.
It does. However, instead of trying and sometimes failing to support Python in the shell, Marcel limits Python to well-defined contexts, always delimited by parens. Also, Marcel has a Python API so that you can use shell-like commands and piping inside of Python programs.
Thank you, kind stranger. I am the author of object shell. This project is obsolete, superseded by Marcel, which I also wrote. https://gitHub.com/geophile/marcel.
Marcel has a lot in common with nushell, but relies on Python syntax and types instead of inventing a lot of new language.
16 comments
[ 5.8 ms ] story [ 47.5 ms ] thread>One major difference is that osh is designed to be used from within an existing shell, such as bash; while PowerShell, due to the absence of well-developed shells in the Windows world, is a complete shell.
[0]: https://www.nushell.sh/
- Typed inputs and IntelliSense. There is very basic support for types, even so, I'd love even more strict types and type inference as in Typescript, so my terminal and shell can give me a hint what kind of input the command is expecting. At the same time, IntelliSense should tell me what command flags are still available and what are viable inputs, like cd suggesting only directories, or kubectl --namespace suggesting available namespaces.
- A concept of past commands as building blocks and/or interactive data wrangling. Many times I am mucking around in zsh to find a chain of commands that reliably gets the data I need out of some CSV or other source, retyping the same few commands with some new links until it works the way I want it to.
- A command like EXPLAIN in SQL so I can see where I should rethink what I am doing so I can refactor that part of the chain. At the same time, I'd love it if I could take one of those magic snippets from Stack Overflow and have an EXPLAIN-like command pick the components apart and explain the flags via some structured docstring format.
- Snippets in the Shell for some regularly used patterns of command chains.
- The concept of transactions, like in SQL, so I can run a command or script without worrying about it failing halfway through - the shell automatically undoing its changes. Maybe this should work on the level of a shell session even.
1) Command recall, like any shell.
2) Edit of a previous command, giving you access to the command in $EDITOR.
3) Abstraction. For example, suppose you want to find all files recursively, looking for those changed in the last 3 days. You could write:
To turn this selection into a reusable command: This is basically a function on a streams, that takes an input N, and filters for files that changed in the last N days. To use it: I don't understand what EXPLAIN would do. In SQL, EXPLAIN helps you see the actual implementation chosen for a non-procedural statement. Marcel, nushell, etc. have no optimizer, so there is no invisible execution plan, that would be made visible using EXPLAIN.Transactions: Might be feasible with a shell built on some kind of COW filesystem, but I'm dubious of how much transaction isolation is really possible even then.
Marcel (and osh) rely on Python types and language where typical shells have sublanguages. So instead of awk or find and their sublanguages, you just use Python. Instead of piping strings, you pipe streams of Python values.
Marcel lets you use Python on the commmand line. It also has an API which allows you to use shell-like commands inside of Python programs.
Lots of examples here: https://marceltheshell.org
https://www.oilshell.org/cross-ref.html?tag=OSH#OSH
Marcel has a lot in common with nushell, but relies on Python syntax and types instead of inventing a lot of new language.
Your Browser Is No Longer Supported
ffox 2 can display text and images.
actually had to turn off JS to degrade gracefully.