News for hackers. Stuff that matters.
Re:The Xonsh Python Shell by geophile on Monday October 12, 2020 @02:54PM (#24758014)
Another pythonic shell: 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").

Re:The Xonsh Python Shell by galkk on Monday October 12, 2020 @04:05PM (#24758850)
It'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

Re:The Xonsh Python Shell by geophile on Monday October 12, 2020 @04:17PM (#24758981)
Yes, that’s it. The link is included on the website.
Re:The Xonsh Python Shell by gridlockd on Monday October 12, 2020 @03:37PM (#24758536)
"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.

Re:The Xonsh Python Shell by cpascal on Monday October 12, 2020 @04:13PM (#24758938)
You may not be aware, but PowerShell can now be run on Linux, macOS, and Windows.

https://github.com/powershell/powershell

Re:The Xonsh Python Shell by globuous on Monday October 12, 2020 @04:48PM (#24759282)
I'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 :)
Re:The Xonsh Python Shell by geophile on Monday October 12, 2020 @03:48PM (#24758671)
So help out!
Re:The Xonsh Python Shell by scopatz on Monday October 12, 2020 @06:42PM (#24760311)
FWIW (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.
Re:The Xonsh Python Shell by geophile on Monday October 12, 2020 @08:37PM (#24761149)
Thanks 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?