Live data from Hacker News

For the Love of Pipes

blog.jessfraz.com

201–210 of 323 posts

Re: For the Love of Pipes

#201
post #102

Earlier quoted context omitted.

It seems "white-space: pre-wrap" on code block would solve most of the problem. There is also additional "max-width" on the pre that I think is not needed.

That would break actual code snippet. What would solve most of the problems is HN actually implementing markdown instead of the current half-assed crap.

What is it with so many products (HN, Discord, Slack) building half assed markdown implementations that aren't actually markdown?

Re: For the Love of Pipes

#202
post #102

Earlier quoted context omitted.

It seems "white-space: pre-wrap" on code block would solve most of the problem. There is also additional "max-width" on the pre that I think is not needed.

That would break actual code snippet. What would solve most of the problems is HN actually implementing markdown instead of the current half-assed crap.

That would break any existing comments that happened to be using markdown syntax as punctuation. Although I suppose you could have a flag day for the changeover and format differently based on comment creation time.

But I think the very limited formatting is just fine anyway. For the above comment as an example, I agree the code formatting looks awful, especially on mobile. But the version with >'s is ok, and I don't think proper bullet points or a quote bar would have improved it dramatically.

Re: For the Love of Pipes

#203
post #188

Earlier quoted context omitted.

You can if input is a file. It might be a program with no arguments or something else.

In your original command, how can 'input' be a program with no arguments?

Oh, damn. You're exactly right.

OK, to save some of my face, this will work:

    grep 'foo' 
... at least in zsh and probably bash.

Re: For the Love of Pipes

#204
I wish there was an operator to allow a branch then join. Like send output to a lookup, do the lookup, join results

Can do with named pipes, but an operator would be nice

Re: For the Love of Pipes

#205
In Unix, everything is a file. /dev/null is a file but not an executable so it can't even become a process. So you can't pipe anything into it. If you consider this last sentence as a "figure of speech" then you should have probably avoided the use of "pipe" vs "redirect" and used send them to /dev/null.

Re: For the Love of Pipes

#206

Earlier quoted context omitted.

That would break actual code snippet. What would solve most of the problems is HN actually implementing markdown instead of the current half-assed crap.

What is it with so many products (HN, Discord, Slack) building half assed markdown implementations that aren't actually markdown?

What's Markdown?

- Slack product development

(that was a joke but is likely the answer to your question)

Re: For the Love of Pipes

#207

I have wondered for a long time why pipes are not used more often in production-grade applications. I have seen plenty pipe use in bash scripts, especially for build and ETL purposes. Other languages, have ways to do pipes as well (e.g. Python https://docs.python.org/2/library/subprocess.html#replacing-... ) but I have seen much less use of it. It appears to me, that for more complex applications one rather opts for…

The biggest issue is that pipes are unidirectional, while not all data flow is unidirectional. Some functional programming styles are pipe-like in the sense that data-flow is unidirectional: Foo(Bar(Baz(Bif(x)))) is analagous to: cat x | Bif| Baz |Bar| Foo Obviously the order of evaluation will depend on the semantics of the language used; most eager languages will fully evaluate each step before the next. (Actually…

Pipes are not unidirectional on FreeBSD, interestingly.

Re: For the Love of Pipes

#209
post #104

Earlier quoted context omitted.

In Julia, this would be: 1:3 |> x->x+1 |> x->join(x,",") |> length

Small correction (or it won't run on my system): 1:3 |> x -> map(y -> y+1, x) |> x -> join(x, ",") |> length All those anonymous functions seem a bit distracting, though https://github.com/JuliaLang/julia/pull/24990 could help with that.

Maybe a bit nicer

    (1:3 .|> x->x+1) |> x->join(x,",") |> length

Re: For the Love of Pipes

#210
post #33

Earlier quoted context omitted.

> When was the last time your Unix workstation was as useful as a Macintosh? Some of that discussion has not aged well :)

MacOs is layered on a UNIX-like OS. You can use pipes in your command windows.

You can also drop the "-like". (-:

* https://unix.stackexchange.com/questions/1489/

Post reply on HN