Really Weird Shell - the structural regular expression shell - Programming On Unix
zge
(12-05-2019, 11:32 AM)z3bra Wrote: I disagree with that. The shell's job is to handle IPC, and that's it. Text processing is done by the processes themselves, the shell only connects outputs to the next process input.

What it's "job" is is quite secondary, as compared to what makes it useful as a tool. A shell that only would handle IPC would have no variables, aliases, functions, built-in commands and would hence be an all around pain to work with -- even more than a standard "minimalist shell". If there's no real reason to restrict yourself (such as having a typewriter instead of a screen, a PDP7 instead of *any modern day computer*), it's nonsense to reject developments and advances on the grounds of something that's basically a naturalistic fallacy of computing.

(12-05-2019, 11:32 AM)z3bra Wrote: Otherwise, you're creating a full blown text processor, that happens to have a way to start processes.

And what is the problem with that? I don't mean to be rude, but I honestly don't understand the problem. Especially considering the history that Unix has with text processing.
z3bra
(18-05-2019, 01:12 PM)zge Wrote:
(12-05-2019, 11:32 AM)z3bra Wrote: I disagree with that. The shell's job is to handle IPC, and that's it. Text processing is done by the processes themselves, the shell only connects outputs to the next process input.

What it's "job" is is quite secondary, as compared to what makes it useful as a tool. A shell that only would handle IPC would have no variables, aliases, functions, built-in commands and would hence be an all around pain to work with -- even more than a standard "minimalist shell". If there's no real reason to restrict yourself (such as having a typewriter instead of a screen, a PDP7 instead of *any modern day computer*), it's nonsense to reject developments and advances on the grounds of something that's basically a naturalistic fallacy of computing.
(12-05-2019, 11:32 AM)z3bra Wrote: Otherwise, you're creating a full blown text processor, that happens to have a way to start processes.

And what is the problem with that? I don't mean to be rude, but I honestly don't understand the problem. Especially considering the history that Unix has with text processing.

Don't get me wrong, I do not reject it at all! I love structural expression, and find such a tool to be a godsend actually, as I don't know any of awk, and sed is a pain to work with multi-line patterns.

What I meant is that handling processes and processing text are two different tasks, and I do believe in the "one tool for each task" moto.
There are plenty of shells out there that are pretty good at managing jobs. We do lack a good structural expression tool though, so I would advise focusing on this part, and have it integrate well with other tools, rather than implementing missing features inside it.

Also, I really want to use it, but I don't wanna swap my shell :)
Now to use it from another shell in a pipeline, you need something like (I suppose):
Code:
echo "I run Linux" | rwsh -c 'cat |> ,x/[lL]inux/ c/GNU+Linux/ |> ,p' | tee linux.txt

In this fashion, I think it will have difficulties gaining adoption (and I hope it would get adopted!)

I didn't mean to be rude or rant about the tool. I though about how I'd use it myself and the little irks I would have with it (again, regarding my workflow, and I think Unix workflows in general).

Sorry if I hurt anyone, I didn't mean to
tudurom
z3bra Wrote:Also, I really want to use it, but I don't wanna swap my shell :)
Now to use it from another shell in a pipeline, you need something like (I suppose):

Code:
echo "I run Linux" | rwsh -c 'cat |> ,x/[lL]inux/ c/GNU+Linux/ |> ,p' | tee linux.txt

That's actually useless use of cat, if the pizza pipe doesn't have anything on its left, it reads from stdin. I also want to make the p at the end implicit, and add formatting capabilities so it doesn't become useless. With these two optimizations, it doesn't feel awkward anymore.

It is also one of my points to make it embeddable in other workflows, to be as versatile as awk.

Anyway, another point of this project is to learn from it and have fun. It's the first time I implement any kind of scripting language, and the first time I'm playing with Rust. I am also writing this to compete in a national software competition for high school students, for pride and accomplishment!

A more polished tool will be the result of this effort. It's all opensource, everyone can look, learn, share, contribute, fork.

Thank you z3bra and zge for contributing to the discussion, more to come!




Members  |  Stats  |  Night Mode