Hacker News new | ask | show | jobs
by ridiculous_fish 1934 days ago
Can you say more about that? So for example if I pipe to `grep`, murex will write some additional metadata info to the pipe? Won't that confuse grep?
1 comments

murex breaks POSIX compliance massively because it acts as a proxy between each command in the pipeline. This means it can forward type information to processes within murex (eg builtins) but read and write byte streams to external commands.

As mentioned to one of your other replies, this causes a few issues (eg forking). But processes are still run in parallel like with a traditional shell and 99% of time this massive cheat is transparent to both the running processes and the users too.

This cheat does allow for some additional features though, like

- colourisation of STDERR (so it stands out)

- STDERR byte count used to judge if a process has failed

(possibly a few others I've forgotten but have to dash now for a lockdown Zoom party....sorry)

PowerShell maps plaintext to objects without issue. No need to drop down into bytestreams.

In the following example, 'choco' (Chocolatey) outputs a list of outdated packages in a consistent format (--limit-output). The text output is piped to the ConvertFrom-CSV PowerShell CmdLet, which maps the text output from choco into a PowerShell object.

```ps1 choco outdated --limit-output | ConvertFrom-csv -Delimiter '|' -Header 'name','version','v-new','pin' ```

For what it's worth, STDERR is already colorized in PowerShell too.

PowerShell is also unnecessarily verbose for me and wasn't even available on non-Windows systems until midway through murex's life.

Plus it's easy to cherry pick specific features between different solutions and argue they're equivalent if you're going to ignore all the other aspects where they differ. For example a big part of murex is the REPL environment:

- murex parses man pages for smarter auto-competions

- murex integrates well with `tmux` for those who want a richer tiled TUI

- murex supports vim keys

- murex give context sensitive hints upon every keystroke

- murex has an events system baked in. So you can assign your own shortcut keys or run scripts upon filesystem changes

- murex supports regex searches through auto-completions. Which makes navigating directories quicker. It makes finding application names in `kill` quicker. etc

I'm not saying any of this to be critical against PowerShell - it's a sophisticated piece of engineering and a great solution for a great many people. But the differences between what I've built and PS are far greater than the properties they share.