What does HackerNews think of marcel?

A modern shell

Language: Python

#48 in Database
#30 in PostgreSQL
#164 in Python
#10 in JavaScript
#38 in Shell
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.

Indeed, the new incarnation appears to be Marcel https://github.com/geophile/marcel
I like the idea of Unix pipelines, but I hate all the sublanguages, awk being one of the biggest. I scratched my itch and built my own shell, marcel: https://github.com/geophile/marcel.

I mention this specifically, here, because of the CSV point. Marcel handles CSV, e.g. "read --csv foobar.csv" reads the foobar.csv file, parses the input (getting quotes and commas correct), and yields a stream of Python tuples, splitting each line of the CSV into the elements of the output tuples.

Marcel also supports JSON input, translating JSON structures into Python equivalents. (The "What's New" section of marcel's README has more information on JSON support, which was just added.)

Another tool for shell scripting form Python: https://marceltheshell.org. (Source: https://github.com/geophile/marcel.)

E.g.

    from marcel.api import *
 
    for file, size in (ls('marcel',
                          'test',
                          file=True,
                          recursive=True) |
                       map(lambda f: (f.path, f.size))):
        print(f'{file}: {size}')
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

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.

Take a look at marcel: https://github.com/geophile/marcel. It is a pipe-objects-instead-of-strings shell, implemented in Python. But it is also an API allowing scripting from inside Python, e.g.

    for file, size in ls('/home/jao') | map(lambda f: (f, f.size)):
        print(f'{file.name}: {size}')
A new shell: https://github.com/geophile/marcel.

- Based on Python -- filter, transform, etc. using Python functions.

- Pipe Python values, not strings.

- Database operations from the command line.

- Run commands remotely and combine results.

I love pipelines. I don't know the elaborate sublanguages of find, awk, and others, to exploit them adequately. I also love Python, and would rather use Python than those sublanguages.

I'm developing a shell based on these ideas: https://github.com/geophile/marcel.

Being 63, I don't get to say this very often: I am one of the youngest people in this conversation.

Delighted to read these stories about even-older-than-me old-timers. Even though I am a relative spring chicken, I'll list my old-timey computing experiences:

- Started programming on programmable Wang and Monroe calculators.

- PDP-8m in high school. 12k 12-bit words for four terminals running Basic. By special arrangement, I could take over the whole thing and use FORTRAN.

- IBM-370 in college, and I spent lots of hours on an IBM 029 keypunch. (That's where I developed my love of loud, clicky keyboards.)

- First job with Datasaab (yes, a computer division of Saab), and I programmed in their weird DIL-16 language.

- PDP-11 in grad school.

- Various VAXen in my early working life. Picked up Emacs in 1985 and now it's in my fingertips.

- A buddy and I wrote a book intended to support people who needed to work with a large variety of computing environments, (a real problem my buddy encountered). It was instantly obsolete, as it was published as minis were dying and PCs were becoming dominant. (https://www.amazon.ae/Computer-Professionals-Quick-Reference...)

- Many years in startups, mostly in Unix/Linux environments.

Retired now, but still enjoying programming. Having a blast with my current project: https://github.com/geophile/marcel.