5 ms·
Glad to see that Elixir's pipe operator is beginning to spread to other languages!
by pg_bot 9y ago
Glad to see that Elixir's pipe operator is beginning to spread to other languages!
- nerdponx 9y agoWas it in Elixir or F# first?
- scns 9y agoBash?
- pg_bot 9y agoTechnically yes, but it is interesting that "|>" seems to be the syntax that is being adopted amongst multiple languages.
- chickenfries 9y agoWell, we can't use "|".
- Pxtl 9y agoAlthough 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.
- yorwba 9y agoSurely you mean OCaml's pipe operator? They have had it since at least 2013: http://ocaml.org/releases/4.01.0.html 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.
- pg_bot 9y agoThey 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.
- hk__2 9y ago> 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.
- scns 9y agohttps://en.m.wikipedia.org/wiki/Pipeline_(Unix) https://en.m.wikipedia.org/wiki/Pipeline_(Unix) First implemented in Unix V3 1973, acording to wikipedia.
- djedr 9y agoSee also: https://en.wikipedia.org/wiki/Forth_(programming_language) https://en.wikipedia.org/wiki/Forth_(programming_language) Or even: https://en.wikipedia.org/wiki/Reverse_Polish_notation https://en.wikipedia.org/wiki/Reverse_Polish_notation
- grndn 9y agoHere 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/archeological-semiotics-the-birth-of-the-pipeline-symbol-1994/ 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 https://github.com/elixir-lang/elixir/pull/751) 2013: OCaml (https://ocaml.org/releases/4.01.0.html https://ocaml.org/releases/4.01.0.html)
- aetherspawn 9y agoHaskell has had the dot (.) operator which does the same thing for probably longer, but I have no reference sorry. Haskell is >30 years old.