Live data from Hacker News

Show HN: Cosh – concatenative command-line shell

github.com

11–20 of 39 posts

Re: Show HN: Cosh – concatenative command-line shell

#11

Earlier quoted context omitted.

It appears to be extremely similar to Forth, surprisingly. The docs sections on Variables, Functions, Loops, at least, are all pretty much exactly Forth. the docs: https://github.com/tomhrr/cosh/blob/main/doc/all.md

That's specified right in the article title. The "concatenative" language family includes Forth, but also PostScript, Joy, etc. Languages in which expression reduction is expressed concatenatively via e.g. a stack, RPN syntax, etc. Consistent and powerful and terse, but IMHO hard to read. I think it's a great idea for a shell/script language, maybe, but not universally easily readable.

> That's specified right in the article title.

My point was that a lot of the grammar seems exactly the same as Forth's, and different to, say, Postscript's.

Re: Show HN: Cosh – concatenative command-line shell

#12

Earlier quoted context omitted.

That's specified right in the article title. The "concatenative" language family includes Forth, but also PostScript, Joy, etc. Languages in which expression reduction is expressed concatenatively via e.g. a stack, RPN syntax, etc. Consistent and powerful and terse, but IMHO hard to read. I think it's a great idea for a shell/script language, maybe, but not universally easily readable.

> That's specified right in the article title. My point was that a lot of the grammar seems exactly the same as Forth's, and different to, say, Postscript's.

Ah, ok, fair point

Re: Show HN: Cosh – concatenative command-line shell

#15
post #5
post #3

Seems interesting, but I’m already lost at the first example: lsr; [test m] grep; [f I’m guessing the lsr is a recursive ls, and presumably map is a HOF (functional) map. I know what grep means. So that means “test” and “data” are strings, and I have no idea what “m” is for. And “f Perhaps it’s more parseable to someone who speaks lisp, but I still think not having clear (simple) examples is a nonstarter for a projec…

The 'sh' command that it corresponds to is above it: find . -iname '*test*' -print0 | xargs -0 grep data but possibly a bad assumption on my part that the mapping was clear. In any event, 'm' is for regex string matching, and 'f<' is for reading a file into a generator (basically an iterator over the lines in the file). It's a good point that more, simpler examples would help.

I love the premise. I've got be your market audience, but the examples are too hard for me: both sh & cosh

I don't use `find` and I would have to look up `-0`

Why does cosh use ; the syntax kinda looks like they're not needed?

Re: Show HN: Cosh – concatenative command-line shell

#16
post #8
post #7

Earlier quoted context omitted.

The examples in the README are really not the best. Anyway, given from the examples for me this reads as a language to write hacky onliners of code which are probably easy to write once but hard to read anytime after. One moment... we had such a language in the past: Perl! :-D Perl5 onliners were infamous for their expressive power but sometimes crazy to understand even if you thought you were fluent in perl ;-)

We have 2 now, perl and jq

Even after perusing jq's manual multiple times and having written several complex incantations, I still have no idea how to properly combine `|` and `.[]` except by trial and error, or why `select()` needs to be used inside `map(select(...))`

Recently I needed to extract some data, and after fighting with jq and its manual for half an hour, I solved the problem in 30 seconds with node.js

I appreciate the idea behind jq, but its language is horrible. Even XPath was easier and cleaner.

Post reply on HN