首页

Marcel the Shell

217 点作者 jdblair超过 1 年前

23 条评论

larodi超过 1 年前
First of all - Linuxes and alike desperately need something like this shell becoming standard. And second - I always wonder how all these great minds who where throwing rubbish at Microsoft ever since... somehow forgot to mention that same company created important product called PowerShell like 20 years ago. And you know PowerShell is so good already you can easily drop it in any OS&#x2F;X, Linux and it actually works. No one, except for Jeffrey Snover figured it out on time, there is great interview here - <a href="https:&#x2F;&#x2F;evrone.com&#x2F;blog&#x2F;jeffrey-snover-interview" rel="nofollow noreferrer">https:&#x2F;&#x2F;evrone.com&#x2F;blog&#x2F;jeffrey-snover-interview</a>.<p>But for PowerShell to become Python on Perl steroids on top of all the .NET and COM+ there is, well, of course it took years, and top engineers to work on it, but also was needed an unified interface (API) to the underlying OS magic. Which is not there in Linux the same sense .NET became &quot;available&quot;. OS&#x2F;X has something similar to COM+ called CORBA which was left half-baked at best. Python is not .NET, sorry. Not anywhere near.<p>Someone may say the UNIX ideology is about your programs doing one thing at time, and having this STDIN-&gt;munch-&gt;STDOUT approach. But these streams never got any structure, and ppl out there been creating great tools to fill this gap, tools such as - jq, mlr, xidel to name a few. perhaps we should include ack, ag and rg in the list.<p>You know, guys, you hard-loving bash die-hards and sed+awk magicians, you should give this PowerShell thing a try before inventing the wheel again. And before legacies you wrote 20 years ago become as difficult to support as COBOL. Oh yeah, and PoSH is open source, based on open-source runtime, and available in brew&#x2F;apt&#x2F;yum...<p>Disclaimer: I do not work, and have never worked for MS (Guido does now!). Have used DOS since 6.22, FreeBSD since 8th version, Debian since v5, and Windows since v3.1. I did Perl for 20 years, actually I gave Perl classes in some university, still doing fair amount of Python, and accidentally discovered PowerShell 3 years ago. I&#x27;m not a .NET advocate, although I can tell the good parts.
评论 #37995606 未加载
评论 #37997579 未加载
评论 #37996657 未加载
评论 #37996018 未加载
评论 #37995978 未加载
评论 #37995510 未加载
评论 #37998083 未加载
评论 #38001132 未加载
评论 #37996224 未加载
评论 #37995357 未加载
评论 #37995759 未加载
评论 #37996371 未加载
geophile超过 1 年前
Hi, I’m the author of Marcel. If you like it and want to work on it, I can use volunteers, for developing features, debugging, doc, porting, improving the website, you name it.
评论 #37994875 未加载
评论 #37996188 未加载
评论 #37994891 未加载
dark-star超过 1 年前
For those who are wondering: The name is a reference to the 2021 movie &quot;Marcel the Shell with Shoes on&quot; <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Marcel_the_Shell_with_Shoes_On_(2021_film)" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Marcel_the_Shell_with_Shoes_On...</a>
评论 #37994711 未加载
评论 #37994510 未加载
abnry超过 1 年前
How does this compare to nushell? I am in the market to learn something other than bash and right now nushell seems like the best candidate.
评论 #37992466 未加载
评论 #37992265 未加载
评论 #37996134 未加载
评论 #37992405 未加载
mpweiher超过 1 年前
Marcel the author here. Didn&#x27;t know I was also a shell, though I do also have one that is somewhat similar in concept.<p>While taking an existing programming language like Python is an obvious choice (and one that&#x27;s been made a bunch of times), I think that ultimately you need a language where something like a pipe (of objects or text) is not bolted on, but a natural consequence of a more general view of programming based on architectural interconnection.<p>&quot;Pipes and filters&quot; is an architectural style. And it is itself a polymorphic style, meaning there can be substyles that pass objects and substyles that pass bytes, substyles where the filters are processes and substyles where filters are components within a process.<p>So: good direction, more of this!
1attice超过 1 年前
I haven&#x27;t kept up on my Python-flavoured shells. How is this different with xonsh? What similarities does it have with xonsh?<p>Looking for a compare&#x2F;contrast, not a ranking. Diversity is usually good<p>Kudos to author, this looks really good
评论 #37993185 未加载
ubermonkey超过 1 年前
It&#x27;s cute, but I suspect the rightsholders for the character won&#x27;t be thrilled about the name appropriation.
评论 #37992626 未加载
评论 #37993500 未加载
评论 #37993049 未加载
评论 #37994263 未加载
rahimnathwani超过 1 年前
<p><pre><code> However, instead of passing strings from one command to the next, marcel passes Python values: builtin types such as lists, tuples, strings, and numbers; but also objects representing files and processes. </code></pre> The bit before the semicolon sounds like what you&#x27;d do in a functional language like Elixir.<p>It would be cool to be able to do this in regular Python programs. I know some libraries (like pandas) fake it by having a method return an object of the same class, allowing method chaining, but that doesn&#x27;t work universally.
评论 #37992959 未加载
zelphirkalt超过 1 年前
This looks a lot like an idea I am having for a shell written in GNU Guile. MI am still at the very beginning and POC phase. My ideas are:<p>(1) making it possible to have any procedure that follows a certain interface to be usable as a &quot;command&quot; in the shell<p>(2) have a fallback function, that gives you a procedure for a standard shell command like &#x27;ls&#x27; (or reimplement your own!)<p>(3) have piped commands automatically use lightweight processes (guile-fibers) to automatically parallelize work, if possible<p>(4) pass structured data instead of strings, unless the structured data is actually a string or a fallback command of standard shell is used (although perhaps one could write functions parsing that string output into structured data and have structured data at the next step ...)<p>(5) provide composition concepts, that make it easy to compose commands or pipe their outputs into other commands<p>(6) have readable arguments for things like input or output redirection<p>(7) no need to be POSIX compatible, I just want a useful tool for myself and anyone, who might want to try it at some point. Don&#x27;t want to get mired in arcane stuff.<p>Well, many things to consider, probably tons of work hiding somewhere under the hood of all this. I also noticed there are issues with parallelizing things, if I want to keep the shell state local to a command. Previous commands in a pipeline would have to communicate shell state updates down the pipeline. So one needs to distinguish between communication of a shell state update and more input for the next command. Concurrency issues might ensue. I think I will be glad, if I can get some subset of my goals to work.
评论 #38000884 未加载
评论 #37999943 未加载
rbanffy超过 1 年前
I’m not sure this would be the way to go, but it’d be awesome if most Unix command-line tools had a way to accept and output JSON objects.
评论 #37992715 未加载
评论 #37996993 未加载
评论 #37992734 未加载
评论 #37994632 未加载
t43562超过 1 年前
To me the interest in this would be as a replacement for bash in makefiles with the hope that it could be cross platform and not require most of the utilities like sed&#x2F;awk etc. It&#x27;s an enormous pain to write x-platform builds with make because of shell issues - even with cygwin.<p>For this to work one would probably want to embed python and have a pool of interpreters so as not to pay the startup cost of python on every job invocation.<p>&quot;That Said&quot; I think passing around structures is not that useful to me - one is often trying to automate programs that are not written that way.<p>Python&#x27;s pipe handling is complicated and horrible compared to bash and that&#x27;s the thing I&#x27;d really want to &quot;buy&quot; from this - together with more shell-like ways to copy, search, touch files that are platform independent.
评论 #37996435 未加载
t43562超过 1 年前
To do the things I wanted to do I needed reduce and I think there&#x27;s no documentation for it. It took me a while to understand the code:<p><pre><code> ls | map (f: f.size) | red + # this adds all the file sizes together </code></pre> one can also use lamdas:<p><pre><code> ls | map (f: f.size) | red (lambda acc,y: (y if not acc else acc+y)) </code></pre> (this does the same thing - adds up the file sizes)<p>BUT: how would I then divide the result by 1024? .... or assign the result to a variable?<p>There are a number of other functions one can use with &quot;red&quot; like concat, * (times), max, min, count, and, or and a few more.<p>At the moment I feel like I&#x27;m playing with a very fun toy that might give up on me at any moment and turn out to be limited. It obviously has limits but I&#x27;m really enjoying it.
评论 #38000741 未加载
jw_cook超过 1 年前
&gt; A more powerful form of scripting can be done from Python, using the `marcel.api` module. With this module, you have access to the operators of marcel, neatly integrated into Python.<p>This looks like an appealing feature! Having some more coreutils-like functions available in python (i.e., stuff that I wish was in the `os` module) would simplify some cases where I otherwise might have to resort to `subprocess` calls. The GPL license definitely narrows the number of situations where I would realistically be able to add this as a dependency, though.
评论 #37993764 未加载
galaxyLogic超过 1 年前
This seems like obviously inspired by PowerShell. No?
评论 #37999117 未加载
1attice超过 1 年前
This is very cool but it needs a nix package. :) I may try my hand at packaging it for Nix(OS) later this week
评论 #37993299 未加载
sriram_malhar超过 1 年前
I like this a LOT.<p>Not only don&#x27;t I have to get used to another language, I can lean on Python&#x27;s rich ecosystem.
canucker2016超过 1 年前
for some reason I was singing the title to the Beatles&#x27; tune, &quot;Michelle&quot;...<p>surprisingly works well.<p>now i can&#x27;t stop doing it
评论 #37994251 未加载
jedisct1超过 1 年前
Very cool.<p>Love the fact that it uses Python!
besnn00超过 1 年前
Message to the person responsible for the site: they should use code blocks instead of images for their code. I say this because I can&#x27;t read the text inside the images from mobile. It&#x27;s way too small.
评论 #37992413 未加载
评论 #37992376 未加载
chaps超过 1 年前
Hate to be &quot;that guy&quot;, but it&#x27;s kinda sad that they pretty much stole the name... especially when the (fantastic!) movie with the original character came out recently in 2021.<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;k98Afd7Nf3Y" rel="nofollow noreferrer">https:&#x2F;&#x2F;youtu.be&#x2F;k98Afd7Nf3Y</a>
评论 #37992495 未加载
评论 #37992335 未加载
mousetree超过 1 年前
My name is Marcel and I’m partially a shell, as you can see from my body.
评论 #37992271 未加载
评论 #37992488 未加载
评论 #37992154 未加载
shanti2001超过 1 年前
Nice
mgaunard超过 1 年前
Nice.
评论 #37996174 未加载