Hacker News new | past | comments | ask | show | jobs | submit login
Object SHell (geophile.com)
23 points by fuzztester on Oct 23, 2023 | hide | past | favorite | 15 comments



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.


https://www.marceltheshell.org/

Your Browser Is No Longer Supported

ffox 2 can display text and images.

actually had to turn off JS to degrade gracefully.


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.


GitHub repo says it's obsolete: https://github.com/geophile/osh


Indeed, the new incarnation appears to be Marcel https://github.com/geophile/marcel


Marcel seems very similar to Xonsh, another Python-based shell.


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.

Lots of examples here: https://marceltheshell.org


Some PowerShell vibes here. Interesting project.


It's mentioned in a linked page: http://geophile.com/osh/similar.html.

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


(2006)



Worth pointing out that osh wiki has a list of all sorts of alternative shells if you like this kind of stuff: https://github.com/oilshell/oil/wiki/Alternative-Shells




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

Search: