# Functional programming is not capable of achieving absolute top performance

**URL:** <https://discourse.julialang.org/t/functional-programming-is-not-capable-of-achieving-absolute-top-performance/119233>\
**Category:** Performance\
**Created:** [September 10, 2024, 2:09am UTC](https://discourse.julialang.org/t/functional-programming-is-not-capable-of-achieving-absolute-top-performance/119233 "2024-09-10T02:09:04Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Post date:** [September 12, 2024, 12:43am UTC](https://discourse.julialang.org/t/functional-programming-is-not-capable-of-achieving-absolute-top-performance/119233/21 "2024-09-12T00:43:47Z")

</div>

> [@Compilers, purity, and variance computation](https://discourse.julialang.org/t/compilers-purity-and-variance-computation/119254/11):
>
> > [@jar1](#):
> >
> > but using alias analysis the compiler can determine that it’s safe to mutate an array in place under the hood.
> 
> I don’t know whether I misunderstood you here, but: This is probably a really really terrible idea.

To be fair, I don’t think that absolute peak performance is one of the goals of the Roc language. You can read what they mean by “fast” here:

> **[Fast | Roc](https://www.roc-lang.org/fast)**
>
> What does it mean that the Roc programming language is fast?

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [September 12, 2024, 12:57am UTC](https://discourse.julialang.org/t/functional-programming-is-not-capable-of-achieving-absolute-top-performance/119233/22 "2024-09-12T00:57:33Z")

</div>

> [@Compilers, purity, and variance computation](https://discourse.julialang.org/t/compilers-purity-and-variance-computation/119254/11):
>
> In-place mutating and return-new-object APIs are quite differentthat is terrible!

I think the idea is with pure functions there are no mutating APIs – mutation isn’t even a user-visible property. That way you don’t need pointer-heavy persistent data structures, you can use normal ones (with good cache locality).

It’s explained in more detail on the “functional” page.

> **[Functional | Roc](https://www.roc-lang.org/functional)**
>
> What does it mean that the Roc programming language is functional?

[Previous page](https://discourse.julialang.org/t/functional-programming-is-not-capable-of-achieving-absolute-top-performance/119233.md?page=1)
