Ensuring Technical Readiness For Copilot in Microsoft 365
Life and Work of Dr. John Backus | Turing100@Persistent
1. FORTRAN, BNF, FP
John Backus
Turing Award 1977
For profound, influential, and lasting
contributions to the design of practical high
level programming systems, notably through
his work on FORTRAN, and for seminal
publication of formal procedures for the
specification of programming languages.
Turing Centenary Celebrations
Persistent Systems Ltd.
February 2013
abhijatv@gmail.com
2. Our Story
Science & Technology in the 50s
High Level Language – HLL the ideas
The Backus-Naur-Form – BNF
Fortran and FP
abhijatv@gmail.com
3. History: The 1950s
Computer Science
Technology @ IBM
Backus' work in this talk
WW 2
1930 1940 1950 1960
abhijatv@gmail.com
4. History: Computer Science
Turing (1936) Grace Hart &
Shannon Levin
Hopper
(1937) (1962)
Turing (1952)
Machines McCarthy
Information (1958) Self hosting
First
Theory Compiler
Post (1936) Compiler
von Neumann + LISP (Lisp)
Post Architecture Idea of HLL
machines (1945)
BNF
Chomsky Fortran (1959)
Eckert &
(~ 1955) (1957)
Mauchly
Turing (1937) (1943) CFG
ENIAC
Equivalence
Proof
WW 2 ALGOL
1930 1940 1950 1960
abhijatv@gmail.com
5. History: Technology @ IBM
http://en.wikipedia.org/wiki/History_of_IBM
Type IV
Tabulator IBM 801
(1928) Cheque
Clearing
machine IBM 603
(1934) Multiplier
(1946)
IBM SSEC
(1948)
IBM 701
(1952)
IBM 1401
Transistor
Computer
(1959)
WW 2
1930 1940 1950 1960
abhijatv@gmail.com
6. History: Technology @ IBM
IBM 701 IBM 704
• 2048 words of 36 bits each • Full 36 bit instructions
• Williams tubes memory • Magnetic core memory, 4096 36-bit words
• 18 bit instructions • 4000 instructions per second
(Bits: 1 Sign, 5 Opcodes, 12 Address)
• 2 programmer accessible registers • 5 programmer accessible registers
• Fortran and Lisp available
(Lisp CAR/CDR originate here)
abhijatv@gmail.com
10. High Level Languages
The idea and the 1950s technology
John Backus and the SpeedCode interpreter
John Backus and FORTRAN for the IBM 704
The (probable) reasons for success
abhijatv@gmail.com
11. HLL: The Idea and Solution
Programs should be
written in a
language that is close
to English rather than
in machine code
or languages close
to machine code
abhijatv@gmail.com
12. Backus' SpeedCode HLL
Inspired by difficulties on the SSEC
– the Selective Sequence Electronic Calculator
First HLL on an IBM machine
Support floating point computation in decimal
Speedcode was an interpreter
– ease of use over system resources
Used about 30% of system memory!
Ran 10-20 times slower than machine code
abhijatv@gmail.com
13. HLL: Backus and FORTRAN
SpeedCode experience
Hardware costs override Software costs
Compile to machine code
NOTE: No scanner, parser, assembler, linker, etc.
Complete definition, design and implementation
abhijatv@gmail.com
17. HLL: The Idea and Solution
Example Fortran Program and its Compilation
C ---6-----------------------------------------------------------------|
C Compute the Madelung energy.
PROGRAM Madelung
IMPLICIT NONE
C Ref: Bagno et. al. Adv. Phys.
C ---|-----------------------------------------------------------------|
INTEGER*4 MaxAtm ! Max ions
PARAMETER (MaxAtm = 10)
REAL*8 SigmaC, SqrSigmaC, CellVol
COMPLEX*16 Ionic_structure_factor
REAL*8 XIon (MaxAtm), YIon (MaxAtm)
REAL*8 SqDist (MaxAtm, MaxAtm, 0:(MaxL - 1))
C Program start:
10 FORMAT (A50, F19.10) ! Display a STRING + DOUBLE PREC. number
CALL Initialise (XIon, MaxAtm)
Eii = 0.0D0
READ (5, *) nAtom
READ (5, *) Ks2Max
SqrSigmaC = SigmaC * SigmaC
CellVol = Box_length * Box_length * Box_length
DO I = 1, nAtom
READ (5, *) XIon (I), YIon (I), ZIon (I), Ion_Type (I)
ENDDO
CALL GPERMK (IGX, IGY, IGZ)
STOP
END
abhijatv@gmail.com
18. HLL: The Idea and Solution
Example Fortran Program and its Compilation
C ---6-----------------------------------------------------------------|
C Compute the Madelung energy.
PROGRAM Madelung
IMPLICIT NONE
C Ref: Bagno et. al. Adv. Phys.
C ---|-----------------------------------------------------------------|
INTEGER*4 MaxAtm ! Max ions
PARAMETER (MaxAtm = 10)
REAL*8 SigmaC, SqrSigmaC, CellVol
COMPLEX*16 Ionic_structure_factor Mark
REAL*8
REAL*8
XIon (MaxAtm), YIon (MaxAtm)
SqDist (MaxAtm, MaxAtm, 0:(MaxL - 1))
Individual
Tokens
C Program start:
10 FORMAT (A50, F19.10) ! Display a STRING + DOUBLE PREC. number
CALL Initialise (XIon, MaxAtm)
Eii = 0.0D0
READ (5, *) nAtom
READ (5, *) Ks2Max
SqrSigmaC = SigmaC * SigmaC
CellVol = Box_length * Box_length * Box_length
DO I = 1, nAtom
READ (5, *) XIon (I), YIon (I), ZIon (I), Ion_Type (I)
ENDDO
CALL GPERMK (IGX, IGY, IGZ)
STOP
END
abhijatv@gmail.com
19. HLL: The Idea and Solution
Example Fortran Program and its Compilation
C ---6-----------------------------------------------------------------|
C Compute the Madelung energy.
PROGRAM Madelung
IMPLICIT NONE
C Ref: Bagno et. al. Adv. Phys.
C ---|-----------------------------------------------------------------|
INTEGER*4 MaxAtm ! Max ions
PARAMETER (MaxAtm = 10) Organize
REAL*8 SigmaC, SqrSigmaC, CellVol
COMPLEX*16 Ionic_structure_factor
into
REAL*8 XIon (MaxAtm), YIon (MaxAtm) “sentences”
REAL*8 SqDist (MaxAtm, MaxAtm, 0:(MaxL - 1))
C Program start:
10 FORMAT (A50, F19.10) ! Display a STRING + DOUBLE PREC. number
Find
Structure
CALL Initialise (XIon, MaxAtm)
Eii = 0.0D0 and
READ (5, *) nAtom
READ (5, *) Ks2Max
Operations
SqrSigmaC = SigmaC * SigmaC
CellVol = Box_length * Box_length * Box_length
DO I = 1, nAtom
READ (5, *) XIon (I), YIon (I), ZIon (I), Ion_Type (I)
ENDDO
CALL GPERMK (IGX, IGY, IGZ)
STOP
END
abhijatv@gmail.com
20. HLL: The Idea and Solution
Example Fortran Program and its Compilation
C ---6-----------------------------------------------------------------| Map to H/W Ops
C Compute the Madelung energy.
PROGRAM Madelung
IMPLICIT NONE # STRUCTURE
C Ref: Bagno et. al. Adv. Phys. # ...
C ---|-----------------------------------------------------------------| # MaxAtm: 4 Bytes at 0x00AC89021
INTEGER*4 MaxAtm ! Max ions # …
PARAMETER (MaxAtm = 10) # Eii: 8 bytes at 0x00C098AF4
REAL*8 SigmaC, SqrSigmaC, CellVol # ...
COMPLEX*16 Ionic_structure_factor # I: 4 bytes at 0x00000001
REAL*8 XIon (MaxAtm), YIon (MaxAtm) # ...
REAL*8 SqDist (MaxAtm, MaxAtm, 0:(MaxL - 1)) #
# OPERATIONS
C Program start: #
10 FORMAT (A50, F19.10) ! Display a STRING + DOUBLE PREC. number call Initialise
movf 0x00C098AF4, 0
CALL Initialise (XIon, MaxAtm) ...
Eii = 0.0D0 mov 0x00000001, 1
READ (5, *) nAtom L1: cmp 0x00000001, nAtom
READ (5, *) Ks2Max je L2
SqrSigmaC = SigmaC * SigmaC # I/O Operations
CellVol = Box_length * Box_length * Box_length inc 0x00000001
DO I = 1, nAtom jmp L1
READ (5, *) XIon (I), YIon (I), ZIon (I), Ion_Type (I)
ENDDO L2: call GPERMK
CALL GPERMK (IGX, IGY, IGZ) # ...
STOP leave
END
abhijatv@gmail.com
21. HLL: FORTRAN Success – Why?
SpeedCode: Ease of use vs. Execution speed
Hardware costs > Software costs
In tune with: “Computers = Number crunching”
Solved a pressing problem of the users
Efficient use of investment in H/W
Large user base (and hence code) was created
abhijatv@gmail.com
33. BNF – Generative Grammars
The Problem
Produce “new symbols from finite symbols”
→ “a set of rules to how to”
abhijatv@gmail.com
34. BNF – Generative Grammars
The Solution
Describe the structure of production
BNF: Syntax to describe the structure
Given: “Set of alphabets” & “Set of punctuations”
Word :: concatenation of one or more alphabets
WordSeparators :: Subset (Space, comma, …)
Sentence :: One or more of Word + WordSeparators
SentenceSeparator :: Subset (Period, Question, …)
Paragraph :: One or more of
Sentence + SentenceSeparator
abhijatv@gmail.com
35. BNF – Some History
First known description: Panini for Sanskrit
BNF = PBF (CACM, 10(3), 137, 1967)
(www-history.mcs.st-and.ac.uk/Biographies/Panini.html)
Devised for Algol 58 by Backus and
simplified for Algol 60 by Peter Naur
Is NOT a “Normal” form
Linguists (e.g. Bloomfield, Chomsky):
formalizing language
Mathematicians (Thue, Post, Turing):
formal abstract rewrite systems
abhijatv@gmail.com
36. Grammar – Example
Example Grammar Fragment: (The C Programming Language, Appendix, K&R)
translation-unit := external-declaration | translation-unit external-declaration
external-declaration := function-definition | declaration
function-definition := declaration-specsopt declarator declaration-listopt compound-statement
declaration := declaration-specs init-declarator-listopt ;
declaration-list := declaration | declaration-list declaration
declaration-specs := storage-class-spec declaration-specsopt |
type-spec declaration-specsopt |
type-qualifier declaration-specsopt
storage-class-spec := one of [auto | register | static | extern | typedef ]
type-spec := one of [void | char | short | int | long | float | double | signed | unsigned …]
type-qualifier := one of [const | volatile]
...
abhijatv@gmail.com
37. Grammar – Example
Production rule
Example Grammar Fragment: (The C Programming Language, Appendix, K&R)
translation-unit := external-declaration | translation-unit external-declaration
external-declaration := function-definition | declaration
function-definition := declaration-specsopt declarator declaration-listopt compound-statement
declaration := declaration-specs init-declarator-listopt ;
declaration-list := declaration | declaration-list declaration
declaration-specs := storage-class-spec declaration-specsopt |
type-spec declaration-specsopt |
type-qualifier declaration-specsopt
storage-class-spec := one of [auto | register | static | extern | typedef ]
type-spec := one of [void | char | short | int | long | float | double | signed | unsigned …]
type-qualifier := one of [const | volatile]
...
abhijatv@gmail.com
38. Grammar – Example
Production rule
Example Grammar Fragment: (The C Programming Language, Appendix, K&R)
translation-unit := external-declaration | translation-unit external-declaration
external-declaration := function-definition | declaration
function-definition := declaration-specsopt declarator declaration-listopt compound-statement
declaration := declaration-specs init-declarator-listopt ;
declaration-list := declaration | declaration-list declaration
declaration-specs := storage-class-spec declaration-specsopt |
type-spec declaration-specsopt |
type-qualifier declaration-specsopt
storage-class-spec := one of [auto | register | static | extern | typedef ]
type-spec := one of [void | char | short | int | long | float | double | signed | unsigned …]
type-qualifier := one of [const | volatile]
...
Terminal
abhijatv@gmail.com
39. Grammar – Example
Non terminal Production rule
Example Grammar Fragment: (The C Programming Language, Appendix, K&R)
translation-unit := external-declaration | translation-unit external-declaration
external-declaration := function-definition | declaration
function-definition := declaration-specsopt declarator declaration-listopt compound-statement
declaration := declaration-specs init-declarator-listopt ;
declaration-list := declaration | declaration-list declaration
declaration-specs := storage-class-spec declaration-specsopt |
type-spec declaration-specsopt |
type-qualifier declaration-specsopt
storage-class-spec := one of [auto | register | static | extern | typedef ]
type-spec := one of [void | char | short | int | long | float | double | signed | unsigned …]
type-qualifier := one of [const | volatile]
...
Terminal
abhijatv@gmail.com
42. Backus and FP
The problem as Backus saw it
Some background to see Backus' solution
The FP language
abhijatv@gmail.com
43. Backus: Why FP
Scalar product program
c = 0
for i := 1 step 1 to n do
c := c + a[i] * b[i]
IP = (/ +) • (α *) • (Trans)
abhijatv@gmail.com
44. Backus: Why FP
Scalar product program Points to ponder
Statements operate on “invisible” state
according to complex rules.
Not hierarchical
Dynamic and Repetitive
c = 0 Word-at-a-Time computation using
repetition and modification
for i := 1 step 1 to n do
c := c + a[i] * b[i] Part of data (n) is in program. Hence no
generality (works for vectors of length n)
IP = (/ +) • (α *) • (Trans)
Names its arguments, i.e. works for
vectors a and b only.
“Housekeeping” is scattered
e.g. for i := …. Difficult to separate
abhijatv@gmail.com
45. Backus: Why FP
Scalar product program
Execute assignment many times to
gradually achieve desired result
Word-at-a-time thinking = Assignment!
Word-at-a-time transition rules
c = 0 von Neumann bottleneck = assignment
for i := 1 step 1 to n do Statements:
c := c + a[i] * b[i] Few useful mathematical properties
IP = (/ +) • (α *) • (Trans) PL = % framework + % changeable parts
Conventional PL: High, rigid % framework
Conventional PL
= High level von Neumann computer
abhijatv@gmail.com
46. Backus: Why FP
“In fact, conventional languages create
unnecessary confusion in the way we think
about programs.”
– John Backus
abhijatv@gmail.com
50. PRF: Core Idea
PRF: Partial (µ) Recursive Functions
How to get the set of all computable functions?
Functions =
Some simple functions +
Function forming operations
PRF: Set of all functions generated as prescribed
abhijatv@gmail.com
51. λCalculus: Core Idea
An algorithm requires answers to four questions:
1. Who are the participants? Variable
2. What is the transformation? Abstraction
3. When to transform? Application
4. How to transform? βReduction
Note: The “where” question is not relevant!
abhijatv@gmail.com
52. Backus' Language Proposal: FP
Build programs by combining functions as in PRF
Conventional programming: value level
manipulate values to eventually obtain result
Backus' proposal: function level
new programs from other programs & functionals
abhijatv@gmail.com
53. Backus' Language Proposal: FP
FP programs, f, map a value to another value
Functions are either primitive or built from
program forming operations – functionals
Some primitive functions:
constant functions - constant: x = x
selector functions - i:<x1, …,xi, …, xn> = xi
abhijatv@gmail.com
54. Backus' Language Proposal: FP
Some functionals:
composition - f∗g:x = f:(g:x)
construction - [f1,...,fn]:x = <f1:x,...,fn:x>
conditional - (h => f;g)
apply-to-all - αf:<x1, …, xn> = <f:x1, …, f:xn>
insert-right - /f: <x>=x
/f: <x1, …, xn>=f:<x1, /f:<x1, …, xn>>
/f: < > = unit f
abhijatv@gmail.com
55. Backus' Language Proposal: FP
Scalar product program Points to ponder
Statements operate on “invisible” state
according to complex rules.
Not hierarchical
Dynamic and Repetitive
c = 0 Word-at-a-Time computation using
repetition and modification
for i := 1 step 1 to n do
c := c + a[i] * b[i] Part of data (n) is in program. Hence no
generality (works for vectors of length n)
IP = (/ +) • (α *) • (Trans)
Names its arguments, i.e. works for
vectors a and b only.
(Trans): Transpose
(α *) : Apply “*” “Housekeeping” is scattered
e.g. for i := …. Difficult to separate
(/ +) : Insert “+”
abhijatv@gmail.com
56. Backus' Language Proposal: FP
Scalar product program How does IP work?
IP:<<1,2,3>, <6,5,4>>
= (/ +) • (α *) • Trans:
<<1,2,3>, <6,5,4>>
c = 0 = (/ +) • (α *):
for i := 1 step 1 to n do <<1,6>, <2,5>, <3,4>>
c := c + a[i] * b[i] = (/ +) •
<*:<1,6>, *:<2,5>, *:<3,4>>
IP = (/ +) • (α *) • (Trans) = (/ +) <6,10,12>
= +:<6, +:<10,12>>
(Trans): Transpose = +:<6,22>
= 28
(α *) : Apply “*”
(/ +) : Insert “+”
abhijatv@gmail.com
57. Backus' Language Proposal: FP
c = 0
for i := 1 step 1 to n do IP = (/ +) • (α *) • (Trans)
c := c + a[i] * b[i]
Statements operate on “invisible” state No hidden states or complex rules
according to complex rules.
Hierarchical: Built from simpler ones
Not hierarchical
Static and non-repetitive: structure helps
Dynamic and Repetitive understanding it; no mental execution
Word-at-a-Time computation using Operates on whole conceptual units
repetition and modification
No useless data is part of the program.
Part of data (n) is in program. Hence no Hence completely general.
generality (works for vectors of length n)
Does not name arguments.
Names its arguments, i.e. works for No extra substitution rules required.
vectors a and b only.
“Housekeeping” forms are minimal.
“Housekeeping” is scattered
e.g. for i := …. Difficult to separate
abhijatv@gmail.com
58. Backus: Why FP
“In fact, conventional languages create
unnecessary confusion in the way we think
about programs.”
– John Backus
abhijatv@gmail.com
59. John Backus & Computation Today
Fortran
Still in use – “Favourite” HPC language
Looks very much like C/C++ today
PBNF
In active use, but usually indirectly in
YACC/Bison code
FP
Encouraged R&D in functional programming
von Neumann bottleneck?
We still suffer from it
abhijatv@gmail.com