The author

XForms: in ODF

Steven Pemberton, CWI/W3C, Amsterdam

Abstract

The Web has turned into a programming environment, turning its back on its earlier roots of simplicity and ease-of-use. And in the process many properties of the early web have been lost. This talk will examine some of the desirable properties of a future web, such as accessibility, usability, semantics, decentralisation, privacy, aggregation and even what to do about the password problem.

Contents

  1. Abstract
  2. Contents
  3. 1957: The first municipal computer (Norwich, UK)
  4. 2015: The Raspberry Pi
  5. How much faster?
  6. How much faster?
  7. Compare
  8. Compare
  9. How big is a million million?
  10. A million million seconds
  11. Let's go back to 1957
  12. The design of programming languages
  13. The Design of Programming Languages
  14. Moore's Switch
  15. Then and now
  16. Declarative programming
  17. The first declarative definition
  18. Procedural code
  19. What does 'Declarative programming' mean?
  20. A Declarative Clock
  21. A Running Declarative Clock
  22. XForms
  23. Example: 150 person years becomes 10!
  24. Example: Insurance Industry
  25. Example: NHS
  26. Conclusion

1957: The first municipal computer (Norwich, UK)

The First Computer in Norwich
Just one of 21 cabinets that were installed.

2015: The Raspberry Pi Zero

Raspberry Pi in Norwich
The first computer so cheap that it was given away free with a magazine.
Yep, that's the same buillding.

How much faster?

Want to guess if and by how much faster the Raspberry Pi is than the Elliott?

The same? 10? 100? 1000 times?

How much faster?

About ONE MILLION times faster...

Compare

Elliott 405 Raspberry Pi Zero Factor
Year 1957 2015 58
Price £85,000 (1957) (£2M-7M in 2015 money) £4 (~ £0.15 in 1957 money) ½M-2M
Instruction cycle time 10.71-0.918 ms (93-1089 Hz) 1 ns (1 GHz clock) 1M
Main memory 1280 bytes (nickel delay lines) 512 MB LPDDR2 SDRAM ½M
Secondary memory 16 kB drum store 8 GB (typical micro SD flash card - not included) ½M
Tertiary memory 1.2MB (300,000 word magnetic film) 1TB (Typical external disk - not included) 1M
Output bandwidth 25 characters/s 373 MB/s (HDMI) 60MB/s (USB) 2M-10M
Weight 3-6 tons 9 g ½M
Size 21 cabinets, each 2m x 77cm x 77cm 65mm x 30mm x 5.4mm 2.3M
Median UK wage Around £250 (men), £125 (women) Around £30000 (men), £25000 (women) 120-200

Compare

So the Raspberry Pi is:

A factor of a million million (billioen in Dutch, trillion in English).

Funnily enough, that is almost exactly what Moore's Law would have us expect for that length of time (even though 1957 is before Moore's Law was thought of, and predates integrated circuits).

How big is a million million?

A terabyte is a million million bytes.

Nowadays we talk in terms of very large numbers.

Want to guess how long a million million seconds is?

A year? Ten years? A century?

A million million seconds

Is 30,000 years...

In other words, a really big number...

Back to 1957

In the 50's, computers cost in the millions. Nearly no one bought them, nearly everyone leased them.

To rent time on a computer then would cost you of the order of $1000 per hour: several times the annual salary of a programmer!

When you leased a computer in those days, you would get programmers for free to go with it. Programmers were essentially free (in comparison with the cost of the computer).

The design of programming languages

TypingIn the 50's the computer's time was expensive.

So a programmer would write the program, copy it to special paper, give it to a typist, who would type it out, then give the result to another typist who would then type it out again to verify that it had been typed correctly the first time.

Why all this extra work? Because it was much cheaper to let 3 people do this work, than to let the computer discover the errors for you.

The Design of Programming Languages

And so programming languages were designed around the needs of the computer, not the programmer. It was much cheaper to let the programmer spend lots of time producing a program than to let the computer do some of the work for you.

Programming languages were designed so that you tell the computer exactly what to do, in its terms, not what you want to achieve in yours.

Moore's Switch

Moore's Switch illustrated
Costs of computers vs programmers
1957-2016

It happened slowly, almost unnoticed, but nowadays we have the exact opposite position:

Compared to the cost of a programmer, a computer is almost free.

I call this Moore's Switch.

But, we are still programming in programming languages that are direct descendants of the languages designed in the 1950's!

We are still telling the computers what to do, not what we want.

Then and now

1960: Algol60 Now: Python
for i := 99 step -1 until 1 do
begin
   bottles(i); 
   outstring(" on the wall, ");
   bottles(i); 
   outstring("\n");
   outstring("take 1 down,
       pass it around,");
   bottles(i - 1);
   outstring(" on the wall.\n");
    end;
end
for quant in range(99, 0, -1):
   if quant > 1:
      print quant, "bottles of beer on the wall,", quant, "bottles of beer."
      if quant > 2:
         suffix = str(quant - 1) + " bottles of beer on the wall."
      else:
         suffix = "1 bottle of beer on the wall."
   elif quant == 1:
      print "1 bottle of beer on the wall, 1 bottle of beer."
      suffix = "no more beer on the wall!"
   print "Take one down, pass it around,", suffix
   print "--"

Declarative programming

A new way of programming.

It describes what you want to achieve, but not how to achieve it.

The first declarative definition

Declarative approaches describe the solution space.

A classic example is when you learn in school that

The square root of a number n is the number r such that r × r = n

This doesn't tell you how to calculate the square root; but no problem, because we have machines to do that for us.

Procedural code

function f a: {
    x ← a
    x' ← (a + 1) ÷ 2
    epsilon ← 1.19209290e-07
    while abs(x − x') > epsilon × x: {
        x ← x'
        x' ← ((a ÷ x') + x') ÷ 2
    }
    return x'
}

What does 'Declarative programming' mean?

A Procedural Clock

A clock in C, 1000+ lines

1000 lines, almost all of it administrative. Only 2 or 3 lines have anything to do with telling the time.

And this was the smallest example I could find. The largest was more than 4000 lines.

A Declarative Clock

The Views System

type clock = (h, m, s)
displayed as 
   circled(combined(hhand; mhand; shand; decor))
   shand = line(slength) rotated (s × 6)
   mhand = line(mlength) rotated (m × 6)
   hhand = line(hlength) rotated (h × 30 + m ÷ 2)
   decor = ...
   slength = ...
   ...
clock c
c.s = system:seconds mod 60
c.m = (system:seconds div 60) mod 60
c.h = (system:seconds div 3600) mod 24

XForms

XForms is a declarative system that lets you define applications.

It is a W3C standard, and in worldwide use.

And it is in ODF!

Example: 150 person years becomes 10!

A certain company makes BIG machines (walk in): user interface is very demanding — traditionally needed 5 years, 30 people.

With XForms this became: 1 year, 10 people.

Do the sums. Assume one person costs 100k a year. Then this has gone from a 15M cost to a 1M cost. They have saved 14 million! (And 4 years)

Example: Insurance Industry

Manager: I want you to come back to me in 2 days with estimates of how long it will take your teams to make the application.

(Two days later)

Programming man: I'll need 30 days to work out how long it will take to program it.

XForms man: I've already programmed it!

Example: NHS

The British National Health Service started a project for a health records system.

One person then created a system using XForms.

Conclusion

In 60 years computers have got a million million times better, and programmers probably not even ten.

This is because people are still using programming languages that are based on the idea that the computer's time is more important than the programmer's.

Programs give a solution rather than describe the problem.

Declarative programming allows programmers to work ten times faster: what you now write in a week, would take a morning; what would take a month would now take a couple of days.