News for hackers. Stuff that matters.
Re:One Year of Nushell by geophile on Monday August 24, 2020 @08:56PM (#24267182)
Marcel is another pipe-objects-instead-of-strings shell. It takes a different approach to shell/language unification, compared to nushell and other modern shells. Marcel exposes Python on the command line, e.g. to find files that changed in the last day:

    ls -fr | select (f: now() - f.mtime < days(1))
ls pipes File objects to the select, and that's a Python function inside the parens.

Scripting is done in Python, using marcel's shell commands as functions, by importing the module marcel.api. So the examle above in Python would be:

    from marcel.api import *

    for file in (ls(file=True, recursive=True) |
                 select(lambda f: now() - f.mtime < days(1))):

    print(file)
So it's the same shell command (ls ... | select ...), but expressed as Python functions, and the result is an iterator so that the command output can be used inside a for loop.

For more info: https://www.marceltheshell.org, https://github.com/geophile/marcel.

Re:One Year of Nushell by xfer on Monday August 24, 2020 @09:03PM (#24267218)
It's not a different approach though. It works exactly the same way in powershell(just the host language is different).
Re:One Year of Nushell by geophile on Monday August 24, 2020 @09:43PM (#24267428)
Thanks, I wasn't aware of that. I believe my comment still applies to nushell and a couple of others.

I like bash for simple commands, but hate the requirement to learn so many sublanguages for more sophisticated usage, (as in sed, awk, find, and others). I like Python for scripting, but the integration of shell commands is really not very good. I built marcel to fix both of these problems.

Re:One Year of Nushell by vips7L on Wednesday August 26, 2020 @08:44AM (#24281884)
Powershell scripting is still done in the powershell language, but you can import all of the .net/c# runtime to use.

I'd like to build the same but using the JVM/groovy as the runtime/scripting language.