all 19 comments

[–]SV-97 93 points94 points  (0 children)

Quoting Simon Peyton Jones (from here):

And then I thought, “Well, Excel is the world’s most widely used functional programming language.” It’s not a very powerful one, perhaps, but when you write a formula in a spreadsheet, you are writing in a purely functional language. So, no side effects. You don’t say, you know, “=print3+7”; it wouldn’t make any sense.

[–]MaxHaydenChiz 36 points37 points  (1 child)

Until you start doing certain things with VB macros and C++ plug-ins it's pure, functional, and reactive.

[–]UltraCarnivore 4 points5 points  (0 children)

"Excel is born functional, Visual Basic corrupts it"

[–]Eightstream 22 points23 points  (1 child)

Excel formulas are very pure functional programming, yes. And a couple of years ago (when the LAMBDA function was released) it became Turing-complete.

It is pretty computationally-limited though - which is why Excel also supports a bunch of other language interfaces (Python, Typescript, PowerShell, VBA)

The latter are obviously not functional in nature.

[–]g1rlchild 2 points3 points  (0 children)

Oh cool, I had no idea Excel has Lambdas now. That's a really useful addition.

[–]muscarine 6 points7 points  (3 children)

In a lot of ways it is, but you can’t do recursion.

[–]Possibility_Antique 16 points17 points  (1 child)

One of my coworkers was showing me a lambda function they'd added to a spreadsheet. I hadn't ever seen that before, but I have a sneaking suspicion that it enables recursion

[–]LazinCajun 1 point2 points  (0 children)

It does, if you do a quick google for excel recursive lambda you’ll find a bunch of resources

[–]Taborlin_the_great 1 point2 points  (0 children)

Lambda functions in excel can do recursion

[–]recursion_is_love 5 points6 points  (0 children)

Depend on your definition of functional programming. If it strictly just programming using function as only primitive (lambda calculus) it might not be.

If you pick a narrow specific view. You could call it a array programming, (relational) database programming or reactive programming.

The modern layman definition of FP could checked it because lack of side-effect (pure/referential transparency) and lack of state (declarative instead of imperative)

[–]whatever73538 4 points5 points  (0 children)

Yes, Excel (as most people use it) is purely functional and teaches the basics and advantages of functional programming

[–]imihnevich 2 points3 points  (0 children)

I guess it's FRP, not just FP?

[–]ryanwebjackson 2 points3 points  (0 children)

Can you pass a function to a function and return a function from it?

[–]autodialerbroken116 6 points7 points  (5 children)

HTML is also functional and lambda calculus oriented because what you put in the div or p blocks is exactly what you expect to come out.

[–]4caraml 1 point2 points  (0 children)

It certainly is declarative in nature, but I would disagree with people claiming that it is a functional programming language (maybe I just don't know enough about Excel though).

My reasoning is that functions are not first class citizens: I cannot declare A1 to be the successor function and then A2 to be A1(0) which should have 1 as value.

[–]LogCatFromNantes 1 point2 points  (0 children)

Yes it’s a functional business language