Live data from Hacker News

Dgsh – Directed graph shell

www2.dmst.aueb.gr

31–40 of 61 posts

Re: Dgsh – Directed graph shell

#31
post #22
post #10

This would have been great 10-20 years ago, or even at the coining of Unix pipes. By today's standards, however, the syntax feels clunky and dated. I'd like to see contemporary shells like nushell and elvish copy these ideas, with attribution of course, in a more modern way. That is the best way I can see to honor this stagnant project: https://github.com/dspinellis/dgsh

Frankly, I find that anything more than some preparatory `exec {my_fd} should be implemented in bash.

Manually playing around with fds is definitely unmaintainable. My hope is that a clean syntax can help create maintainable complex pipelines.

Re: Dgsh – Directed graph shell

#32

Hello. In English this makes me think of the phrase “dog shit”. Not sure if that’s intentional or not.

Now I can't unconnect this, I hope OP was aware because now he wont forget too.

and no matter how much i try, i can't make the connection. best i can come up with is dogshell, and even that is a stretch. phew...

Re: Dgsh – Directed graph shell

#33
post #28

Earlier quoted context omitted.

I went through two iterations before adopting the current syntax. Truth is neither me nor Doug McIlroy, the inventor of Unix pipes, who kindly and generously provided feedback during dgsh's development, had something better to propose. What syntax would you propose?

Greetings, Diomidis. I would suggest a familiar notation like "[a, b] -> c" in a dedicated dag block: dag text_stats { tee -> [ split_words, count_chars ] # word-based frequencies split_words -> tee_words tee_words -> ngram2 -> save_digram tee_words -> ngram3 -> save_trigram tee_words -> ranked_frequency -> save_words # character-based frequencies count_chars -> add_percentage chars_to_lines -> ranked_frequency -> ad…

The closeness of this syntax to graphviz dot is very interesting.

having dgsh output a graphvis file in dry-run mode would be a neat feature.

Re: Dgsh – Directed graph shell

#34
post #19
post #13

Earlier quoted context omitted.

I could not find any mention of DAGs or directed acyclic graphs in the documentation.

Yeah it’s not technically DAG since it uses iteration, but then dgsh will use iteration under the hood too. However Murex does support CSP-style concurrency. So while there’s no syntax sugar for writing graphs, you can very easily create adhoc pipes and pass them around instead of using stdout / stderr. So it wouldn’t actually take much to refine that with some DAG-friendly syntax. In fact maybe that can be my next p…

I'm curious: what do you mean by "dgsh will use iteration under the hood too"? Dgsh does several things under the hood, but I wouldn't characterize any of them as iteration.

Re: Dgsh – Directed graph shell

#35
post #19

Earlier quoted context omitted.

Yeah it’s not technically DAG since it uses iteration, but then dgsh will use iteration under the hood too. However Murex does support CSP-style concurrency. So while there’s no syntax sugar for writing graphs, you can very easily create adhoc pipes and pass them around instead of using stdout / stderr. So it wouldn’t actually take much to refine that with some DAG-friendly syntax. In fact maybe that can be my next p…

I'm curious: what do you mean by "dgsh will use iteration under the hood too"? Dgsh does several things under the hood, but I wouldn't characterize any of them as iteration.

Yes you’re right. My apologies. I was glancing at the examples while cooking, specifically the git example (https://www2.dmst.aueb.gr/dds/sw/dgsh/#commit-stats) thinking that it was iterating over the lines output from git, but clearly that’s not even how bash would work. That will teach me for commenting without giving something my full attention first doh!

Looking properly at this, I can see no iteration is needed. Which actually makes the Murex implementation even easier because Murex already has tee pipes just like dgsh. It’s just not (yet) particularly well documented.

Re: Dgsh – Directed graph shell

#36
post #19
post #13

Earlier quoted context omitted.

I could not find any mention of DAGs or directed acyclic graphs in the documentation.

Yeah it’s not technically DAG since it uses iteration, but then dgsh will use iteration under the hood too. However Murex does support CSP-style concurrency. So while there’s no syntax sugar for writing graphs, you can very easily create adhoc pipes and pass them around instead of using stdout / stderr. So it wouldn’t actually take much to refine that with some DAG-friendly syntax. In fact maybe that can be my next p…

would you be able to share or point to some examples? i am curious.

Re: Dgsh – Directed graph shell

#37

Hello. In English this makes me think of the phrase “dog shit”. Not sure if that’s intentional or not.

Second English speaker here who didn't make that connection at all

Another English speaker data point here & I actually read dogshit before I read dgsh.

Re: Dgsh – Directed graph shell

#38
post #35

Earlier quoted context omitted.

I'm curious: what do you mean by "dgsh will use iteration under the hood too"? Dgsh does several things under the hood, but I wouldn't characterize any of them as iteration.

Yes you’re right. My apologies. I was glancing at the examples while cooking, specifically the git example ( https://www2.dmst.aueb.gr/dds/sw/dgsh/#commit-stats ) thinking that it was iterating over the lines output from git, but clearly that’s not even how bash would work. That will teach me for commenting without giving something my full attention first doh! Looking properly at this, I can see no iteration is neede…

Admiring your multi-tasking!
Post reply on HN