News for hackers. Stuff that matters.
Re:Pipelining might be my favorite programming language feature by SimonDorfman on Monday April 21, 2025 @08:41AM (#43751346)
The tidyverse folks in R have been using that for a while: https://magrittr.tidyverse.org/reference/pipe.html
Re:Pipelining might be my favorite programming language feature by madcaptenor on Monday April 21, 2025 @09:11AM (#43751631)
And base R has had a pipe for a couple years now, although there are some differences between base R's |> and tidyverse's %>%: https://www.tidyverse.org/blog/2023/04/base-vs-magrittr-pipe...
Re:Pipelining might be my favorite programming language feature by thom on Monday April 21, 2025 @09:13AM (#43751649)
I've always found magrittr mildly hilarious. R has vestigial Lisp DNA, but somehow the R implementation of pipes was incredibly long, complex and produced stack traces, so it moved to a native C implementation, which nevertheless has to manipulate the SEXPs that secretly underlie the language. Compared to something like Clojure's threading macros it's wild how much work is needed.
Re:Pipelining might be my favorite programming language feature by flobosg on Monday April 21, 2025 @09:03AM (#43751556)
Base R as well: |> was implemented as a pipe operator in 4.1.0.
Re:Pipelining might be my favorite programming language feature by tylermw on Monday April 21, 2025 @02:55PM (#43755212)
Importantly, the base R pipe implements the operation at the language parsing level, so it has basically zero overhead.
Re:Pipelining might be my favorite programming language feature by zelphirkalt on Monday April 21, 2025 @11:50PM (#43758938)
I would assume, that most languages do that, or alternatively have a compiler, that is smart enough to ensure there is no actual overhead in the compiled code.
Re:Pipelining might be my favorite programming language feature by steine65 on Monday April 21, 2025 @05:45PM (#43756857)
R, specifically tidyverse, has a special place in my heart. Tidy principles makes data analysis easy to read and easy to use new functions, since there are standards that must be met to call a function "tidy."

Recently I started using Nushell, which feels very similar.

Re:Pipelining might be my favorite programming language feature by mvieira38 on Tuesday April 22, 2025 @09:41AM (#43762065)
R + tidyverse is the gold standard for working with data quickly in a readable and maintainable way, IMO. It's just absolutely seamless. Shoutout to tidyverts (https://tidyverts.org/) for working with time series, too