Is Excel the most used -- and fucntional -- programming lanuage on Earth?

Heard that statement recently -- that Excel is a functional programming language, and the most used one -- of any programming languages -- on Earth! Is it true? Are there good examples of typical FP style in Excel? Cheers, Alexy

Hi Alexy,
Heard that statement recently -- that Excel is a functional programming language, and the most used one -- of any programming languages -- on Earth! Is it true? Are there good examples of typical FP style in Excel?
You can't define functions in Excel, hence its not really a functional language. I'd go as far as saying its an expression-based programming language, but that's it. It also has mutable state (if you use circular references) so its not pure. That said, the quote almost certainly comes from this paper (in the title): http://research.microsoft.com/~simonpj/Papers/excel/index.htm Thanks Neil

Excel is what I like to call a 0:th order functional language, i.e., you can't even define functions, just values. :) -- Lennart On Jan 30, 2007, at 21:58 , Neil Mitchell wrote:
Hi Alexy,
Heard that statement recently -- that Excel is a functional programming language, and the most used one -- of any programming languages -- on Earth! Is it true? Are there good examples of typical FP style in Excel?
You can't define functions in Excel, hence its not really a functional language. I'd go as far as saying its an expression-based programming language, but that's it. It also has mutable state (if you use circular references) so its not pure.
That said, the quote almost certainly comes from this paper (in the title): http://research.microsoft.com/~simonpj/Papers/excel/index.htm
Thanks
Neil _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 1/30/07, Lennart Augustsson
Excel is what I like to call a 0:th order functional language, i.e., you can't even define functions, just values. :)
Every cell with an expression in Excel is a function. The problem is that the domains and codomains of these functions don't usually contain functions. Maybe that makes it a first order functional language. But...suppose we had a spreadsheet a little like Haskell where each cell has a static type, and the values can be Haskell functions. What interesting things could we do with it that we couldn't do with Excel? -- Dan

There is a Maple plug-in for Excel. If you have Maple (on Windows), just start Excel and you'll see extra buttons. This allows you to have cells containing symbols, as well as access to all of Maple's functions. This easily gets you a (very impure!) higher-order functional language inter-operating very closely with Excel. Jacques

I think you're using a somewhat non-standard definition of function. Say that I have the Haskell expression let x = 5 y = x + 2 z = x * y ... Would you call y and z functions? I wouldn't, I would call them definitions with free variables in the rhs. But that's beside the point. When you ask what you could do with functions in Excel do you mean from a practical or theoretical perspective? From a practical perspective I'd say the difference is immense. In Excel today, if you want to do, e.g., a map you do it by copying a formula. So any change in that formula needs N changes in the spreadsheet. With functions, you could do the change in one place. Furthermore, if you add some kind of lists/arrays (which Excel sort of has), you can express things in a much easier way. At work we have added a way to define functions in Excel. It's quite clunky since you have to shoehorn it into Excel, but even so it's been quite popular and change the way people use Excel. From a theoretical perspective, it would increase the class of problems expressible in Excel. I'm not sure if these complexity classes have any names, though. Assuming unit time for the basic Excel functions (+, -, etc), today you can only express formulas that take at most linear time, in the size of the formula, to calculate. With functions, this would increase to at least exponential (at least that's my gut reaction). -- Lennart On Jan 30, 2007, at 23:59 , Dan Piponi wrote:
On 1/30/07, Lennart Augustsson
wrote: Excel is what I like to call a 0:th order functional language, i.e., you can't even define functions, just values. :)
Every cell with an expression in Excel is a function. The problem is that the domains and codomains of these functions don't usually contain functions. Maybe that makes it a first order functional language.
But...suppose we had a spreadsheet a little like Haskell where each cell has a static type, and the values can be Haskell functions. What interesting things could we do with it that we couldn't do with Excel? -- Dan

On 1/31/07, Lennart Augustsson
I think you're using a somewhat non-standard definition of function. let x = 5 y = x + 2 z = x * y ... Would you call y and z functions?
Ah...we don't disagree on what a function is, I'm just parsing spreadsheets differently from you. I was imagining a spreadhseet along the lines of http://sigfpe.blogspot.com/2006/11/from-l-theorem-to-spreadsheet.html where every cell is a function of the entire spreadsheet.

Dan Piponi: On 1/30/07, Lennart Augustsson
wrote: Excel is what I like to call a 0:th order functional language, i.e., you can't even define functions, just values. :)
Every cell with an expression in Excel is a function. The problem is that the domains and codomains of these functions don't usually contain functions. Maybe that makes it a first order functional language.
Or maybe not. Yes, every cell in isolation contains an expression possibly with free variables, and so can be seen as a function in those variables. But these variables are not unbound since they are defined elsewhere in the spreadsheet. Thus, the sheet is rather a system of equations defining values, not functions. I think 0:th order is a good term :-)
But...suppose we had a spreadsheet a little like Haskell where each cell has a static type, and the values can be Haskell functions. What interesting things could we do with it that we couldn't do with Excel?
I had a MSc student doing something in this direction some years ago. He made a Haskell interface which was intended to work like a spreadsheet. In this interface, every declaration has a value window (if the entity declared has a showable type) and a declaration window. A designated button triggers a recompilation, and thus also a recalculation of all declared values - this, I think, captures the essence of spreadsheets which is to be able to make changes and quickly see the results. In order to support the kind of array omputations often done in spreadsheets, an extended array module was defined which declares a number of array functions and other conveniences. See http://www.mrtc.mdh.se/index.php?choice=projects&id=0041. Björn Lisper

I think Pivotal (http://www.cs.kent.ac.uk/projects/pivotal/) has
the "live update" behavior of spreadsheets.
I haven't played with it yet, but I saw Keith Hanna show off his
earlier Vital system; it even updates "backwards" in some sense; see
the "Direct manipulation" section at his site (
But...suppose we had a spreadsheet a little like Haskell where each cell has a static type, and the values can be Haskell functions. What interesting things could we do with it that we couldn't do with Excel?
I had a MSc student doing something in this direction some years ago. He made a Haskell interface which was intended to work like a spreadsheet. In this interface, every declaration has a value window (if the entity declared has a showable type) and a declaration window. A designated button triggers a recompilation, and thus also a recalculation of all declared values - this, I think, captures the essence of spreadsheets which is to be able to make changes and quickly see the results. In order to support the kind of array omputations often done in spreadsheets, an extended array module was defined which declares a number of array functions and other conveniences.
See http://www.mrtc.mdh.se/index.php?choice=projects&id=0041.

On Tue, Jan 30, 2007 at 22:20:14 +0000, Lennart Augustsson wrote:
Excel is what I like to call a 0:th order functional language, i.e., you can't even define functions, just values. :)
Ah, that would explain why the presentation from Credit Suisse at CUFP[1] has that expression in it :-) /M [1]: http://www.galois.com/cufp/ -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus.therning@gmail.com http://therning.org/magnus

The cool thing about Excel is that it's like Function Reactive Programming. When you update the value of a cell, all the other cells that reference to it get updated too. That's pretty cool to have in GUI's as well, and Haskell has that too. See [1]. -chris [1]: http://www.haskell.org/frp/ On 30 Jan, 2007, at 22:46 , Alexy Khrabrov wrote:
Heard that statement recently -- that Excel is a functional programming language, and the most used one -- of any programming languages -- on Earth! Is it true? Are there good examples of typical FP style in Excel?
Cheers, Alexy _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hello Alexy, Wednesday, January 31, 2007, 12:46:33 AM, you wrote:
Heard that statement recently -- that Excel is a functional programming language, and the most used one -- of any programming languages -- on Earth! Is it true?
that's true and breaks any words that FP thinking is "unnatural" for peoples :) what matters here is that in Excel you *don't* define calculation order which makes it a functional rather than imperative approach to computations -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (10)
-
Alexy Khrabrov
-
Bjorn Lisper
-
Bulat Ziganshin
-
Chris Eidhof
-
Dan Piponi
-
Fritz Ruehr
-
Jacques Carette
-
Lennart Augustsson
-
Magnus Therning
-
Neil Mitchell