Re: [Haskell-cafe] Speculation, OT: Program a Spreadsheet

Hello Trent, let me suggest to step back and think about why people use spreadsheets. They provide access to data analysis functions, statistics and graphing that is otherwise missing (at least on) Windows systems. Serious number crunching is not done in spreadsheets, though. There is R, Matlab and the like. You should not try to comptete with that. The big selling point (in my eyes) of spreadsheets over scripting languages like R is that the data as well as the formulae and intermediate results are, well, spread out in front of your eyes. That is e.g. desirable when you need someone else to understand what you did and how you arrived at the answer given. But is it important that the intermediate result resides in cells C2 to C13? Certainly not. I wrote a small financial application in Haskell that would otherwise be done in spreadsheets. Haskell provided, via its type system, extra sanity checks and much more that spreadsheets don't provide. However, I often wished that there was a way to disassemble the computation into logical bits that can be formatted neatly and be presented to a human inspector. Haskell provides ways to do this, e.g. by mixing Haskell and LaTeX, or writing a small DSL with two interpreters, one for calculations, one for layout. So instead of enhancing a spreadsheet format I'd rather have a scripting language with a workbook file format à la Mathematica, where comments, code and results of computations are displayed together. Changing a formula triggers change in the results. (The workbooks I've seen don't do that.) Input data and intermediate results can be hidden or expanded via mouse click. Results can be traced back through the workbook's formulae up to the input data. (The latter is not always easy in spreadsheets.) One would need to research whether such a language exists. If not, I'd be happy to help develop it. Olaf

Hi Olaf,
I must say you haven't convinced me that there is no use for a spreadsheet
functional language. Nor have you convinced that important, mission
critical work is not done in spreadsheets.
However, what you want certainly seems worthwhile. Where can I see an
example of what Mathematica does. It costs the Earth, and I've never played
with it.
For simplicity I will assume serial code, not parallel.
Code is linear in almost all programming models. Code flows left to right
and down the page (screen, at least in English).
So what I imagine you want is something like a persistent code tracer, that
by default reruns the code as changes are made.
| Input | Code | Result | Comment | LaTeX | Etc | Many
Possible Columns
----------------------------------------------------------------------------
0001 | input1 | expression1 | result1 | comment1 | formula1 | etc1 |
-----------------------------------------------------------------------
And so on to the end of the program.
Like so?
A tabular view of the program and it's execution. You can program in the
table. The table auto-updates when you change stuff. Works best with LOTS
of screen real estate.
That would be kinda cool.
You might want to refine your idea and start another thread about that.
It's cool, but it's not a functional spreadsheet like in
https://www.microsoft.com/en-us/research/publication/a-user-centred-approach...
and
some of the article's citations, which is very much what I'm talking about.
It looks like I could have plagiarized most of my ideas from that article,
even though I've never read it before. (I was aware of comparisons of
spreadsheets to functional programming before.)
On Sun, Nov 19, 2017 at 1:39 PM Olaf Klinke
Hello Trent,
let me suggest to step back and think about why people use spreadsheets. They provide access to data analysis functions, statistics and graphing that is otherwise missing (at least on) Windows systems. Serious number crunching is not done in spreadsheets, though. There is R, Matlab and the like. You should not try to comptete with that. The big selling point (in my eyes) of spreadsheets over scripting languages like R is that the data as well as the formulae and intermediate results are, well, spread out in front of your eyes. That is e.g. desirable when you need someone else to understand what you did and how you arrived at the answer given. But is it important that the intermediate result resides in cells C2 to C13? Certainly not. I wrote a small financial application in Haskell that would otherwise be done in spreadsheets. Haskell provided, via its type system, extra sanity checks and much more that spreadsheets don't provide. However, I often wished that there was a way to disassemble the computation into logical bits that can be formatted neatly and be presented to a human inspector. Haskell provides ways to do this, e.g. by mixing Haskell and LaTeX, or writing a small DSL with two interpreters, one for calculations, one for layout. So instead of enhancing a spreadsheet format I'd rather have a scripting language with a workbook file format à la Mathematica, where comments, code and results of computations are displayed together. Changing a formula triggers change in the results. (The workbooks I've seen don't do that.) Input data and intermediate results can be hidden or expanded via mouse click. Results can be traced back through the workbook's formulae up to the input data. (The latter is not always easy in spreadsheets.) One would need to research whether such a language exists. If not, I'd be happy to help develop it.
Olaf

On Sun, Nov 19, 2017 at 4:50 PM, trent shipley
I must say you haven't convinced me that there is no use for a spreadsheet functional language. Nor have you convinced that important, mission critical work is not done in spreadsheets.
I am pretty sure you're talking past each other at this point. Step back and take a deep breath, both of you. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Hi Brandon, Olaf,
I did not mean to be a jerk. I think Olaf has an itch and a good idea of
how to scratch it, and it could be the basis for a great project. I've
never used Mathematica, so I have a hard time visualizing what he is
driving at. My apologies if I was inappropriate.
It is reasonable to ask whether there would be a reasonable user base for a
functional programming language/spreadsheet. My intuition is that there
would be among more advanced spreadsheet users. So that is obviously a
point of disagreement, but that is OK. We should probably debate that.
I also think he is talking about a different thing than I am, and what this
thread has been apart thus far. It is a Bad Thing (in the Winnie the Pooh
sense) when threads turn into fibers. I think Olaf's idea/itch is actually
quite good, and deserves a thread of its own.
With apologies,
Trent.
On Sun, Nov 19, 2017 at 4:38 PM Brandon Allbery
On Sun, Nov 19, 2017 at 4:50 PM, trent shipley
wrote: I must say you haven't convinced me that there is no use for a spreadsheet functional language. Nor have you convinced that important, mission critical work is not done in spreadsheets.
I am pretty sure you're talking past each other at this point. Step back and take a deep breath, both of you.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

People interested in implementing spreadsheets could give a look at "Spreadsheet Implementation Technology: Basics and Extensions", Peter Sestoft, MIT Press. It's the only book on the topic, as far as I know, and it's an interesting reading (even if they use C#, but we can't have everything).

On 2017-11-19 01:39 PM, Olaf Klinke wrote: So instead of enhancing a spreadsheet format I’d rather have a scripting language with a workbook file format à la Mathematica, where comments, code and results of computations are displayed together. Changing a formula triggers change in the results. (The workbooks I’ve seen don’t do that.) Input data and intermediate results can be hidden or expanded via mouse click. Results can be traced back through the workbook’s formulae up to the input data. (The latter is not always easy in spreadsheets.) Olaf, have you looked at Jupyter http://jupyter.org/ at all? This now has a backend for Haskell and supports many of the things you mention.
participants (5)
-
Brandon Allbery
-
Neil Mayhew
-
Olaf Klinke
-
Pierpaolo Bernardi
-
trent shipley