News for hackers. Stuff that matters.
Re:JS things I didn’t know existed by pg_bot on Saturday January 20, 2018 @08:08AM (#16193200)
Glad to see that Elixir's pipe operator is beginning to spread to other languages!
Re:JS things I didn’t know existed by scns on Saturday January 20, 2018 @09:01AM (#16193344)
https://en.m.wikipedia.org/wiki/Pipeline_(Unix)

First implemented in Unix V3 1973, acording to wikipedia.

Re:JS things I didn’t know existed by djedr on Saturday January 20, 2018 @09:10AM (#16193378)
Re:JS things I didn’t know existed by grndn on Saturday January 20, 2018 @02:23PM (#16194921)
Here is the history of the |> symbol as best as I can tell:

1994: Isabelle/ML (part of Isabelle proof assistant tooling) (https://blogs.msdn.microsoft.com/dsyme/2011/05/17/archeologi...)

2005 and earlier: F#

2012: Elm

2013: Elixir (https://github.com/elixir-lang/elixir/pull/751)

2013: OCaml (https://ocaml.org/releases/4.01.0.html)

Re:JS things I didn’t know existed by aetherspawn on Saturday January 20, 2018 @09:03PM (#16196501)
Haskell has had the dot (.) operator which does the same thing for probably longer, but I have no reference sorry. Haskell is >30 years old.
Re:JS things I didn’t know existed by yorwba on Sunday January 21, 2018 @12:02AM (#16196937)
Dot has the arguments swapped.

  f |> g = g . f
Re:JS things I didn’t know existed by scns on Sunday January 21, 2018 @03:42AM (#16197346)
The $-operator is Haskell's equivalent to |>
Re:JS things I didn’t know existed by yorwba on Saturday January 20, 2018 @08:34AM (#16193268)
Surely you mean OCaml's pipe operator? They have had it since at least 2013: http://ocaml.org/releases/4.01.0.html

I wouldn't be surprised if the syntax was even older. And the functionality has likely been used in some academic language from decades ago. It's just reverse function composition after all.

Re:JS things I didn’t know existed by pg_bot on Saturday January 20, 2018 @08:53AM (#16193314)
They seem to have been added around the same time. Another comment on the parent attributes it to F#, which based on a quick googling precedes both OCaml and Elixir. It wouldn't surprise me if the operator preceded that either, but I don't have enough time to explore its origin.
Re:JS things I didn’t know existed by hk__2 on Saturday January 20, 2018 @09:09AM (#16193372)
> F#, which based on a quick googling precedes both OCaml and Elixir

F# can’t precedes OCaml because it’s based on it. OCaml was first released in 1996 while F# appeared only in 2002.

Re:JS things I didn’t know existed by nerdponx on Saturday January 20, 2018 @08:30AM (#16193253)
Was it in Elixir or F# first?
Re:JS things I didn’t know existed by scns on Saturday January 20, 2018 @08:45AM (#16193297)
Bash?
Re:JS things I didn’t know existed by pg_bot on Saturday January 20, 2018 @08:56AM (#16193323)
Technically yes, but it is interesting that "|>" seems to be the syntax that is being adopted amongst multiple languages.
Re:JS things I didn’t know existed by chickenfries on Saturday January 20, 2018 @12:42PM (#16194325)
Well, we can't use "|".
Re:JS things I didn’t know existed by Pxtl on Saturday January 20, 2018 @03:27PM (#16195236)
Although to be fair, using | for "or" has always been silly. Also making the bitwise operator the short one since the logical one gets more usage in the real world. Hindsight is 20/20 of course.