Show HN: Cosh – concatenative command-line shell
1–10 of 39 posts
Re: Show HN: Cosh – concatenative command-line shell
#2Re: Show HN: Cosh – concatenative command-line shell
#3 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
#4The 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
#5Seems 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…
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
#6Seems 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 docs: https://github.com/tomhrr/cosh/blob/main/doc/all.md
Re: Show HN: Cosh – concatenative command-line shell
#7Seems 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.
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
#8Earlier 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 ;-)
Re: Show HN: Cosh – concatenative command-line shell
#9It's the same idea as Powershell, no ?
Re: Show HN: Cosh – concatenative command-line shell
#10Seems 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
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.