Live data from Hacker News

Homoiconic Spreadsheets: What, How and Why [video]

youtube.com

21–24 of 24 posts

Re: Homoiconic Spreadsheets: What, How and Why [video]

#21
post #5

I am not a fan of anonymous functions. I think they are evocative of maths culture tendency to remove and make meaningless names(for example, using greek letters). Yes I know naming things is hard, but names are important, they are critical labels about the inner inner working of the machine. Nothing wrong with functional programing, in fact it is pretty great, But I wish people would name their functions.

Have you checked the interface that Google Sheets came up for custom functions? It's in the menu of every spreadsheet in Data > Named Functions. It's pretty good and encourages not only extensive naming but documentation & examples of the function and each argument. These descriptions are then displayed piece-meal as you edit a formula, just like native documentation.

I also love good names! I hated not being able to have names in formulas and the name part of Named Functions is alone a big quality of live improvement for me.

As to lambdas, perhaps calling them anonymous functions is giving the wrong impression here. What lambdas really are is a simple, native way to create a context with local names. They can be a great boon to clarity through naming!

Spreadsheets have been historically so limited that programmers have resorted to hacky ways to have names/comments. The N function for numerical values is used sometimes for this since N of a string defaults to 0: so N("Name/comment") = 0 and can be added to a formula without changing it.

As to the cultural practice of ultra-short, likely meaningless variable names, like single letters. I do agree it's a "mathy" thing and can quickly descend into maddening opaqueness. The trick though is that sometimes it's very useful to have as compact a symbolic representation as you can manage (such a process of abbreviation gave us algebra!). Naming things is hard, perhaps one of the truly hard things in thinking/programming as the saying goes :)

Re: Homoiconic Spreadsheets: What, How and Why [video]

#22

intriguing presentation! So I have 1 prediction and 1 question. prediction: even though lambdas bring "code programming" into spreadsheets, and it's a huge leap in functionality for the spreadsheet, the dominant programming mode in the spreadsheet will still be interactive programming in the "traditional" spreadsheet sense. I claim this because the mental model of code programming is different from interactive progra…

Thanks for the kind words whacked_new!

I agree entirely with your prediction: spreadsheet programming is different from interactive "control flow" programming... and it should remain different! The spreadsheet model of programming is easier to grasp and incredibly flexible. I think the key is that spreadsheets are time-less & space-full, I hint at this in the talk & see also my root comment for more elaboration on this.

What's exciting to me about lambdas is that they can be used to enhance this time-less, space-based style, like in the examples I elaborate around 18m47s: the habit tracker, timesheets & a spatialized Game of Life.

I imagine/hope that in a few years we will have a culture of casually importing magical custom functions that will become polished through mass use and eventually become standard. These native functions are much safer than macros so you can be as casual with them as copy-pasting formulas. There's no permissions fuss to wade through, as there is for AppScript. (I even think there will soon be libraries of custom functions, I might even publish one myself in a couple of months.)

* * *

As to your question, I interpret it as: why are lambdas coming inside spreadsheets instead of spreadsheets becoming incorporated into programming languages, right?

I have come across many extensions of spreadsheets over the years. Spreadsheets are so ubiquitous there's many kinds of wrappers for them, many hybrids. Since the birth of spreadsheets in 1979 there has been a flood of drastic alternatives & variations that have been tried. The most famous variant so far has been pivot tables, which has become a useful, somewhat infamously intimidating feature of spreadsheets but not the revolution once expected. One of the more interesting extensions is TreeSheets https://strlen.com/treesheets/ But nothing yet has beaten the simplicity & power of a flexible grid sprinkled with formulas & references through the value rule.

To me the most important thing I learned researching this talk was that it crystallized in my mind that spreadsheets are not just a table, not just a grid. They have a key constraint, they intertwine code and data through the value rule that Kay pointed out 5 years after dynamic spreadsheets were invented (see http://worrydream.com/refs/Kay%20-%20Computer%20Software%20-... ).

So my answer to your question is that spreadsheets have been incorporated into programming languages, they have long grown scripting languages like VBA or Google AppScript. Those are massively useful for top-down extensions of the functionality of spreadsheets.

But the other direction, lambdas in spreadsheets, has been much slower & difficult, yet it offers the promise of a more bottom-up revolution in usage. It has taken us decades to evolve the model of spreadsheets towards lambdas in a way that works well with their true nature and to the ton of other features & culture they've grown over the years. (My personal favorite feature, btw, is the incredibly flexible formatting we can give to a sheet, specially conditional formatting.) As mentioned in the talk, spilled arrays are a recent, crucial step to make lambdas possible & useful.

Re: Homoiconic Spreadsheets: What, How and Why [video]

#23
post #22

intriguing presentation! So I have 1 prediction and 1 question. prediction: even though lambdas bring "code programming" into spreadsheets, and it's a huge leap in functionality for the spreadsheet, the dominant programming mode in the spreadsheet will still be interactive programming in the "traditional" spreadsheet sense. I claim this because the mental model of code programming is different from interactive progra…

Thanks for the kind words whacked_new! I agree entirely with your prediction: spreadsheet programming is different from interactive "control flow" programming... and it should remain different! The spreadsheet model of programming is easier to grasp and incredibly flexible. I think the key is that spreadsheets are time-less & space-full, I hint at this in the talk & see also my root comment for more elaboration on th…

I believe Alan drew his observation of the 'value rule' from work on ASP, Analytical Spreadsheet Package - a part of Analyst, done in the Xerox Special Information Systems Group. This system is also interesting because it used blocks (aka. closures - the object version of lambdas) as the formulas for cells as pointed out by Kurt Piersol's article in the OOPSLA '86 proceedings, https://dl.acm.org/doi/10.1145/28697.28737 .

Spreadsheet rules (or formulas) in The Analyst are kept as Smalltalk blocks. A block is a common Smaiitalk object class which allows a section of compiled code to be kept as an object. They can be passed as arguments and stored as variables. Obviously, they are an ideal choice for rule storage and execution, since they allow the rules to be directly executed by Smalltslk at compiled speeds.

The description of ASP (and the Analyst package from which it was split out as a separate product) can be found at http://www.bitsavers.org/pdf/xerox/xsis/XSIS_Smalltalk_Produ... . Of interest is the example of dropping a bitmap image into a cell and having an adjacent cell display the next generation of the game-of-life run on that initial cell. (That as opposed to having each spreadsheet cell in a region represent a cell in a game-of-life automata.)

As to homoiconicity, I wouldn't be surprised if Alan didn't at some point have a Smalltalk project window running full screen that was imbedded in a cell of a spreadsheet which was running in a Smalltalk project window within the Smalltalk environment. It's the kind of thing I saw him demonstrate as an aside during presentations as he popped out of the full screen project window which the audience had assumed was the root Smalltalk environment rather than a nested environment. What is a cell or window but a live code object running in the language environment after all?

Re: Homoiconic Spreadsheets: What, How and Why [video]

#24
post #22

intriguing presentation! So I have 1 prediction and 1 question. prediction: even though lambdas bring "code programming" into spreadsheets, and it's a huge leap in functionality for the spreadsheet, the dominant programming mode in the spreadsheet will still be interactive programming in the "traditional" spreadsheet sense. I claim this because the mental model of code programming is different from interactive progra…

Thanks for the kind words whacked_new! I agree entirely with your prediction: spreadsheet programming is different from interactive "control flow" programming... and it should remain different! The spreadsheet model of programming is easier to grasp and incredibly flexible. I think the key is that spreadsheets are time-less & space-full, I hint at this in the talk & see also my root comment for more elaboration on th…

Thanks for the reply.

> As to your question, I interpret it as: why are lambdas coming inside spreadsheets instead of spreadsheets becoming incorporated into programming languages, right?

Let me extend this. The power of the spreadsheet programming model (and work environment) is indisputable. In recent years, we've seen many interesting attempts to bring that power directly into programming tools (examples in the Clojure space: witheve, javelin, hyperfiddle; I even think witheve's first iteration was in fact a programmable spreadsheet, but I can't find it anymore). Conceptually these tools have the potential to converge to the same sweet spot, being a merge of 2 similar tenets. But the programming-driven side is converging far more slowly.

I'm interested in this because I think most programming environments these days are still too serial, and there's a lot to gain from moving into a more 2D -- spreadsheet like -- programming environment. It seems obvious, but still far away. It looks like spreadsheets will reach the sweet spot faster. But I like navigating code in Emacs more than I do jumping around cells and hitting F2 to edit.

Post reply on HN