# \[RFC\] PipelessPipes.jl (now Chain.jl)

**URL:** https://discourse.julialang.org/t/rfc-pipelesspipes-jl-now-chain-jl/50448
**Category:** Package Announcements
**Created:** [November 19, 2020, 4:25pm UTC](https://discourse.julialang.org/t/rfc-pipelesspipes-jl-now-chain-jl/50448 "2020-11-19T16:25:38Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Marc.Cox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marc.cox/32/7514_2.png) [@Marc.Cox](https://discourse.julialang.org/u/Marc.Cox)
#### Post date: [November 19, 2020, 8:21pm UTC](https://discourse.julialang.org/t/rfc-pipelesspipes-jl-now-chain-jl/50448/5 "2020-11-19T20:21:29Z")

</div>

**Julius @jules ,** Thank You very much for this RFC around enhancing the previous Linux/Unix Pipe syntax which is a very helpful foundation and a natural fit for distributed processing, but in this iteration I hope we can elevate (or is that continue ? See below \*\***)** the language syntax to a slightly higher abstraction layer using **mathematical notation,** while simultaneously keeping the super fast and efficient **Automatic vectorization** gears hidden/encapsulated to achieve this \>\> [Automatic vectorization - Wikipedia](https://en.wikipedia.org/wiki/Automatic_vectorization)

So also request support syntax for Function Composition (computer science) described here \>\>

> **[Function composition (computer science)](https://en.wikipedia.org/wiki/Function_composition_%28computer_science%29)**
>
> In computer science, function composition is an act or mechanism to combine simple functions to build more complicated ones. Like the usual composition of functions in mathematics, the result of each function is passed as the argument of the next, and the result of the last one is the result of the whole.
> Programmers frequently apply functions to results of other functions, and almost all programming languages allow it. In some cases, the composition of functions is interesting as a function in ...

" _The ability to_ _**easily compose functions encourages [factoring](https://en.wikipedia.org/wiki/Code_refactoring) (breaking apart) [functions](https://en.wikipedia.org/wiki/Subroutine) for maintainability and [code reuse](https://en.wikipedia.org/wiki/Code_reuse). More generally, big systems might be built by composing whole programs**_ **."**

And so here is another example in a similar proposal that seems to have come out of some previous RFC / design work :

It’s especially important ( to provide an alternative to current **|\>** syntax ) when you are using Julia for data analysis, where you commonly have data transformation pipelines.

In particular, Pandas in Python is convenient to use because you can write things like _**df.groupby(“something”).aggregate(sum).std().reset\_index()**_ , which is **a**  **nightmare to write with the current |\> syntax.**

@@ [Function chaining · Issue #5571 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/5571#issuecomment-33437023)

\*\*(or continue ? See this \>\> **)** IF this \>\> [My mental load using Julia is much higher than, e.g., in Python. How to reduce it? - #5 by rdeits](https://discourse.julialang.org/t/my-mental-load-using-julia-is-much-higher-than-e-g-in-python-how-to-reduce-it/18902/5) \<\< is already implemented as it appears to be , it would already address what I’m requesting here per this statement :

I think what you’re talking about is “fluent interfaces”, and it’s true that we don’t really do that in Julia, at least not in the same way. You might find the `|>` operator useful, since you can do:

```julia

> x |> f |> g

```

as an alternative notation for g(f(x)) **.**

**.**

**However**  **as**  **@rdeits has previously**  **NOTED there is a**  **“missing” functionality**  **\>\>** Notably, in a fluent interface, there is no way to chain a function that _isn’t_ a method of the returned object. So if **sort()** is a generic function (and not a method of whatever drawInContext returns), then **you can’t do:**

```julia
	line.mirror.drawIncontext(ctx).sort()

```

So if all ^the above^ has been said and done and the `g(f(x))` `notation `is  
in place , then for this RFC I’d like the proposed **new** _ **PipelessPipes.jl** _ Package Design to be mostly about Julia compiler / LLVM optimizations similar to [JuliaFolds · GitHub](https://github.com/JuliaFolds) for optimizing compilation of the new **functional composition syntax** to **automatically**  **evaluate**  **how**  **to**  **/if** can SIMD / Vectorize \*\* / Parallelize / Thread the Nested functions – As a starter for more background consider searching reading about SIMD designs \>\>

> **[Single instruction, multiple data](https://en.wikipedia.org/wiki/SIMD)**
>
> Single instruction, multiple data (SIMD) is a type of parallel processing in Flynn's taxonomy. SIMD can be internal (part of the hardware design) and it can be directly accessible through an instruction set architecture (ISA), but it should not be confused with an ISA. SIMD describes computers with multiple processing elements that perform the same operation on multiple data points simultaneously.
> Such machines exploit data level parallelism, but not concurrency: there are simultaneous (parallel...

The hardware handles all alignment issues and “strip-mining” of loops. Machines with different vector sizes would be able to run the same code.[[6]](https://en.wikipedia.org/wiki/SIMD#cite_note-6) **Clang LLVM** ( used by Julia which ) calls this vector type “ **vscale** ”.

-and-

[https://discourse.julialang.org/search?q=SIMD](https://discourse.julialang.org/search?q=SIMD)

Re: Existing Vectorize syntax \*\* ( highly desirable to keep compatible with proposed new **functional composition syntax** Package Design )

[https://docs.julialang.org/en/v1/manual/functions/#man-vectorized](https://docs.julialang.org/en/v1/manual/functions/#man-vectorized)

`HTH`

`Ps` `>` `CCing Some others in for possible ` `interest or ` `additional insight ` `(like is this possible ? LOL ; and would it help them` `)` `:`  
@rdeits@MikeInnes @tkf

---

_[View the full topic](https://discourse.julialang.org/t/rfc-pipelesspipes-jl-now-chain-jl/50448)._
