Live data from Hacker News

Marcel the Shell

marceltheshell.org

141–150 of 209 posts

Re: Marcel the Shell

#141
post #132

Earlier quoted context omitted.

I agree. It maybe wasn't design smell when it was designed but 50 years later it definitely is a design/culture smell. Doesn't make "tooling" any less smelly though.

Maybe it is time to rethink what a terminal is, and get rid of the restriction to be text-only? There is really no reason for that, other than Typewriter heritage.

There are some terminals that can display inline images, but those features aren’t commonly used.

Why?

Text works. Text is the lowest common denominator for working with data. This is why terminals are still primarily text based. This is also why stdin/out/err are also commonly text based (when the user is expected to view it). Text is simple and easy to parse. Binary data exchange formats (or objects) come in and out of vogue, but text just keeps on working.

Re: Marcel the Shell

#142
post #106

Earlier quoted context omitted.

>Also ALL Parameters can be abbreviated if they are unique. If no other Parameter starts with R then -R is enough for -Recurse. (there are some quirks with this, but generally pretty intuitive) So, adding a new parameter starting with R to any command is a breaking change that will crash every script using it? Sounds like a terrible idea.

> So, adding a new parameter starting with R to any command is a breaking change that will crash every script using it? In a script, write it out in full. When manually typing it’s okay to take shortcuts. There is always a tension between ergonomics and safety.

That's really no different to the advice given for GNU coreutils:

    man grep | grep -- --recursive
           -r, --recursive

Re: Marcel the Shell

#144
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:

(1) making it possible to have any procedure that follows a certain interface to be usable as a "command" in the shell

(2) have a fallback function, that gives you a procedure for a standard shell command like 'ls' (or reimplement your own!)

(3) have piped commands automatically use lightweight processes (guile-fibers) to automatically parallelize work, if possible

(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 ...)

(5) provide composition concepts, that make it easy to compose commands or pipe their outputs into other commands

(6) have readable arguments for things like input or output redirection

(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't want to get mired in arcane stuff.

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.

Re: Marcel the Shell

#145

Earlier quoted context omitted.

Marcel the Shell with Shoes On [1], a recent Oscar-nominated film [1] https://en.wikipedia.org/wiki/Marcel_the_Shell_with_Shoes_On...

That's in a completely different business. Trademarks generally do not cover all possible uses of a word, only the use of that word in the segment it was approved for.

Plus that one doesn't have shoes.

Re: Marcel the Shell

#146
post #136
post #23

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.

The "tree" command will output JSON on fd3 (which it dubs 'stddata') when available. If more programs adopt that pattern we could use stdout (fd1) only for interactive programs.

This is a pretty brilliant idea. Ideally, someone from BSD-land and GNU-land should meet and come up with some sane JSON schemas.

Re: Marcel the Shell

#147
post #86

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/X, Linux and it actually works. N…

I wrote Marcel, and its forerunner osh, also recently on HN. Osh actually preceded powershell, and in fact I don’t recall it receiving any acknowledgement from Microsoft. To be fair, I’m sure they never heard of it.

The idea of piping objects has been rediscovered many times.

Re: Marcel the Shell

#148
post #132

Earlier quoted context omitted.

Maybe it is time to rethink what a terminal is, and get rid of the restriction to be text-only? There is really no reason for that, other than Typewriter heritage.

There are some terminals that can display inline images, but those features aren’t commonly used. Why? Text works. Text is the lowest common denominator for working with data. This is why terminals are still primarily text based. This is also why stdin/out/err are also commonly text based (when the user is expected to view it). Text is simple and easy to parse. Binary data exchange formats (or objects) come in and ou…

Is that so? Because the way I see it, there are a bazillion different tools, plus decades of accrued knowledge only related to massaging data into text and back to structures. How many human brain cycles are wasted to data conversion on the Terminal?

Text is a lousy abstraction. It may have worked well 50 years ago when computing was limited to researchers on American universities, but the digital world back then has little in common with ours.

Acting like extending the shell to anything beyond plain text would require switching to fancy new serialisation formats every other year is a red herring. The only thing it takes is admitting a shell isn’t used on typewriters but modern computers, where humans use high-resolution screens and programs can exchange structured data. Everything else follows, and is well suited for standardisation.

But that will never happen as long as grumpy sysadmins insist that cobbling together grep and sed in some arcane incantation is the only thing we ever need.

Re: Marcel the Shell

#149
post #86

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/X, Linux and it actually works. N…

Today, we use json. How do we integrate it into our shell scripts? That's right, we simply make a tool (jq, miller) that takes stdin json, and _continue_ to use the agnostic, untyped tools alongside it, because they are just that, agnostic. In 20 years when we use BGHY or whatever other format, we can use it alongside existing tools by simply... Making a tool that takes stdin in that format.

But it still sucks because of the unstructured data. I added JSON support to Marcel in an afternoon, and still have structure data flowing through the pipelines. JSON first, then nested Python ducts and lists from the JSON translation.

Re: Marcel the Shell

#150
post #132

Earlier quoted context omitted.

Maybe it is time to rethink what a terminal is, and get rid of the restriction to be text-only? There is really no reason for that, other than Typewriter heritage.

There are some terminals that can display inline images, but those features aren’t commonly used. Why? Text works. Text is the lowest common denominator for working with data. This is why terminals are still primarily text based. This is also why stdin/out/err are also commonly text based (when the user is expected to view it). Text is simple and easy to parse. Binary data exchange formats (or objects) come in and ou…

Text does work, but text data exchange formats come in and out of vogue just like binary. And when any structure is needed, we typically get some ad-hoc text format that doesn't interoperate. JSON has made things better here, but it's a bit of a verbose eyesore for humans.

I think the lack a structured (text based) format is a definite shortcoming in UNIX. Whitespace delimited lists of strings do get you surprisingly far (although some things are a total mess, e.g. filenames with spaces). But a simple more structured format (e.g. stripped down YAML with maybe non-prefixed lines being a list/iterator of strings for backward compatibility) would make the shell a lot more powerful.

You should be able to include binary in these, but make it render nicely in the terminal (e.g. like browser devtools do).

This doesn't also exclude having binary. And binary data is piped though programs all the time, but it makes including other data painful. Also don't see any harm in being able to show images in the terminal when wanted.

Post reply on HN