Lambda the Ultimate

inactiveTopic Spreadsheet Languages
started 10/9/2003; 4:57:38 AM - last post 10/17/2003; 12:10:29 PM
Ehud Lamm - Spreadsheet Languages  blueArrow
10/9/2003; 4:57:38 AM (reads: 9174, responses: 13)
Spreadsheet Languages
An interesting set of slides about spreadsheets. Quite a few are dedicated to the question of whether spreadsheets are "languages", and contrast spreadsheets with functional languages.

A few tasty bits:

Spreadsheets are first-order functional languages

Spreadsheet languages ARE real programming languages

Design of a programming language is a Human-Computer Interaction (HCI) problem


Posted to general by Ehud Lamm on 10/9/03; 4:58:52 AM

Christian Lindig - Re: Spreadsheet Languages  blueArrow
10/10/2003; 1:11:44 AM (reads: 726, responses: 2)
Slide 6 lists Haskell and Lisp as "higher-order functional languages" and Pascal as a "higher-order procedural language". But isn't the cruical difference that Haskell and Lisp functions can return (anonymous) functions that they have constructed, while Pascal can't? It seems that the definitions given for first order and higher order fail to grasp this difference, but I am not sure at all.

Frank Atanassow - Re: Spreadsheet Languages  blueArrow
10/10/2003; 3:14:23 AM (reads: 733, responses: 1)
But isn't the cruical difference that Haskell and Lisp functions can return (anonymous) functions that they have constructed, while Pascal can't?

AFAIK, Pascal doesn't have higher-order functions. You can define functions locally, but not return (a pointer to) a function from a function.

To double-check this, I looked at the Extended Pascal standard here, and found no mention of anything resembling higher-order functions; in particular, there appears to be no way to denote the type of a value which is a function. Maybe one can represent functions, though, in a way that forgets the parameter and return types (besides representing them as, say, strings :).

It may well be the case that variants like Turbo Pascal support higher-order functions, though.

Ehud Lamm - Re: Spreadsheet Languages  blueArrow
10/10/2003; 4:41:31 AM (reads: 722, responses: 0)
I agree. From what I remember of Turbo Pascal (I guess, TP 6.0) it didn't support returning functions (i.e., closures). You can pass functions as parameters, though.

Isaac Gouy - Re: Spreadsheet Languages  blueArrow
10/10/2003; 8:35:09 AM (reads: 684, responses: 1)
You can define functions locally, but not return (a pointer to) a function from a function.
Both Modula-2 and Oberon-2 allow you to return a function from a function. The crucial detail is that they don't allow a local function to be returned - it must be top level in a module.
MODULE Test; IMPORT Out;
TYPE F = PROCEDURE (): INTEGER;
VAR f: F;
PROCEDURE Number(): INTEGER; BEGIN RETURN 1; END Number;
PROCEDURE FF(): F; BEGIN RETURN Number; END FF;
BEGIN
   f := FF(); Out.Int( f(), 1 );
END Test.
What about Ada?

Patrick Logan - Re: Spreadsheet Languages  blueArrow
10/10/2003; 10:50:31 AM (reads: 654, responses: 0)
Standard Pascal has downward funargs only and they have to be named.

Isaac Gouy - Re: Spreadsheet Languages  blueArrow
10/10/2003; 1:18:32 PM (reads: 632, responses: 0)
I wonder if the notion that Design of a programming language is a Human-Computer Interaction (HCI) problem (slide 18) is:
- too obvious to be worth comment (wasn't much of the design of Ada concerned with readability) ?
- an annoying distraction from real language design?
- outside our experience?
...

Ehud Lamm - Re: Spreadsheet Languages  blueArrow
10/11/2003; 6:39:28 AM (reads: 614, responses: 0)
What about Ada?

Ada (that's Ada95, of course) funargs have to be named routines, and you can't pass around pointers to routines of deeper scope ("downward closures"). Ada has very strict rules about the scope of access types and access values ("access" in Ada means "pointer"), so it's quite hard to take make a pointer to an inaccessible subroutine. However these restrictions are too extreme, and are the result of implementation difficulties in compilers that use displays.

There are proposals for fixing the restrictions of procedure parameters for the 200Y revision (I recommend reading the "!discussion" section if you are interested in the details of the Ada situation).

I hope the above is clear (I am bit tired at the moment), if not the link I gave contains all the gory details..

Frank Atanassow - Re: Spreadsheet Languages  blueArrow
10/12/2003; 5:24:43 AM (reads: 556, responses: 0)
Patrick: Standard Pascal has downward funargs only and they have to be named.

By `funarg' I guess you mean an argument which is a function. What is the type of such an argument? I didn't see anything in the (Extended) Pascal type syntax which would allow this.

Patrick Logan - Re: Spreadsheet Languages  blueArrow
10/12/2003; 9:00:23 AM (reads: 534, responses: 0)
Well, I found out Standard Pascal is poorly document on the web. But the GNU Pascal manual does refer to Standard Pascal's procedural parameters...

GNU Pascal supports Standard Pascal's procedural parameters:

procedure DrawGraph (function f (x : Real) : Real);

and

An important feature of Standard Pascal (but not BP) that GPC also supports is the possibility to pass local routines as procedural or functional parameters, even if the called routine is declared far remote. The called routine can then call the passed local routine and it will have access to the original caller's local variables.

program LocalProceduralParameterDemo;
procedure CallProcedure (procedure Proc);
begin
  Proc
end;
procedure MainProcedure;
var LocalVariable: Integer;
  procedure LocalProcedure;
  begin
    WriteLn (LocalVariable)
  end;
begin
  LocalVariable := 42;
  CallProcedure (LocalProcedure)
end;
begin
  MainProcedure
end.

Patrick Logan - Re: Spreadsheet Languages  blueArrow
10/12/2003; 9:17:40 AM (reads: 538, responses: 0)
The ANSI Standard for Extended Pascal makes clear that procedural (and functional) parameters were part of the 1983 ANSI Standard for (non-extended) Pascal...

See sections 6.7.3.4 and 6.7.3.5 on these parameters. They do not appear to be defined as "types" in the manual, but they are listed as allowed parameters.

The text about "the procedure shall be one contained by the activation" is the explanation about these being downward funargs, i.e. they are functional arguments but cannot escape the dynamic extent of their activation record on the stack.

Patrick Logan - Re: Spreadsheet Languages  blueArrow
10/12/2003; 5:50:14 PM (reads: 499, responses: 0)
Finally, I should have looked in the historical documents when Google failed to produce the Standard Pascal reference.

Here's the document straight from the source which also describes procedure and function parameters. (And has an alarming number of holes in general, on just glancing through it.)

Kimberley Burchett - Re: Spreadsheet Languages  blueArrow
10/14/2003; 2:15:36 PM (reads: 402, responses: 0)
To get back to the subject, does anybody have any comments on the concept of spreadsheet languages (as opposed to pascal)?

It seems like there are several aspects worth considering:

* The visual-widget aspect. For example, the output is assumed to be a gui, and may include things like charts.

* The visual-editing aspect. For example, you can point at a spreadsheet and start typing expressions -- kind of like a repl on steroids.

* The dataflow aspect.

Anybody have any thoughts on these ideas? Experience with a language that incorporated one or more of these ideas in an interesting way?

Darius Bacon - Re: Spreadsheet Languages  blueArrow
10/17/2003; 12:10:29 PM (reads: 382, responses: 0)
Boxer has an interesting take on the visual-editing aspect. I've only just started playing with it.