Hacker News new | past | comments | ask | show | jobs | submit login

Seems similar in spirit to Nushell[0], which is a project I'm really rooting for, a super interesting update of the shell/pipes framework

[0]: https://www.nushell.sh/




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.


Some stuff I'd love to see implemented:

- 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.


Marcel (my successof of osh) supports using past commands in a few ways:

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:

    ls -fr | select (f: now() - f.mtime() < days(3))
To turn this selection into a reusable command:

    recentN = (| N: select (f: now() - f.mtime() < days(int(N))) |)
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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: