3 ms·
Another pythonic shell: https://marceltheshell.org https://marceltheshell.org. Unlike Xonsh, marcel provides a strict separation between shell syntax and Python
by geophile 6y ago
Another pythonic shell: https://marceltheshell.org https://marceltheshell.org. Unlike Xonsh, marcel provides a strict separation between shell syntax and Python syntax. Specifically, some shell commands take Python functions as arguments. E.g., in the current directory, find all the .c and .h files, and count lines:
ls -fr \
| select (f: f.suffix in ('.c', '.h')) \
| map (f: f.read().count('\n')) \
| red +
- List only files (-f) recursively (-r).
- Select those whose suffix is .c or .h.
- Map qualifying files to the count of \n in the file.
- Reduce those counts to a total using +.
The parentheses delimit Python functions (marcel permits omission of "lambda").
- gridlockd 6y ago"Marcel has been built and tested on Linux. It seems to mostly work on Mac, except for the ps operator. Haven't tried Windows at all." That's unfortunate, because as awful as bash may be, a shell that works natively on all three systems would be far more valuable. Python has all that platform abstraction already built-in.
- geophile 6y agoSo help out!
- cpascal 6y agoYou may not be aware, but PowerShell can now be run on Linux, macOS, and Windows. https://github.com/powershell/powershell https://github.com/powershell/powershell
- globuous 6y agoI've only tried Emacs' eshell on Linux and MacOS, it works great, and I'm sure it works great on Windows as well. Maybe has been the one true shell all this time :)
- galkk 6y agoIt's a good tone to show an affiliation to the project, when you introduce it. judging by the nickname and github url it's yours https://github.com/geophile/marcel https://github.com/geophile/marcel
- geophile 6y agoYes, that’s it. The link is included on the website.
- scopatz 6y agoFWIW (as the original author of xonsh), xonsh does have a strict separation of Python and subprocess syntax. Users can always choose to write in fully formal xonsh, it is just that most users choose to use the default convenience mechanisms that xonsh provides.
- geophile 6y agoThanks for the clarification. I read an interview with you, and there was some discussion of the difficulties in parsing things like "ls -lR", and whether to interpret that as an ls command with flags, or a subtraction. (If I'm remembering correctly.) If a xonsh user does want to do strict separation, how does that work? Syntactically, how do you separate shell code from Python code?