Live data from Hacker News

Show HN: Cosh – concatenative command-line shell

github.com

1–10 of 39 posts

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

#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 “fPerhaps it’s more parseable to someone who speaks lisp, but I still think not having clear (simple) examples is a nonstarter for a project like this.

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

#4
Consider JSON output formats, and jq as your swiss army knife between operations.

The disadvantage of "first class values" is that now you need a type system to help determine what values can be used in what way, and it becomes complicated to use a data stream in a manner which was not anticipated when it was authored.

If you keep the exchange format as close to plain text as possible, it's much more straightforward to do new things with it.

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

#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.

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

#6
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…

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

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

#7
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.

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 ;-)

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

#8
post #7
post #5

Earlier quoted context omitted.

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.

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

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

#9
post #2

It's the same idea as Powershell, no ?

Yep, at least as far as working with structured data rather than streams of text is concerned. Apart from the syntax differences, this is generally much lighter weight, though, in that it doesn't have classes, in-depth system integration, or similar (not that those features are bad in Powershell).

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

#10
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…

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.

Post reply on HN