The beginning (of my notes, and of his talk) is more detailed in order to show the development of the idea.
- Driving question: "How did APIs develop in the history of programming?"
- Who invented the API?
- 00:59 "Subroutine library" gave idea of re-using code for common operations (von Neumann & Goldstine, design for EDVAC, 1948)
- 02:26 ACM awarded Turing Award to Maurice Wilkes (1967)
- Why not awarded to von Neumann & Goldstine?
- 03:16 Wilkes got the credit because von Neumann and Goldstine had an idea, but hadn't implemented it.
- Theory --> Practice
- 04:47 Wilkes' machine, EDSAC, came online in 1951 and was immediately useful.
- 06:40 Wilkes' machine was immediately useful because he prioritized simplicity over performance.
- Goal: produce a working machine quickly, rather than to create a more refined machine that would take longer to build.
- [Agile process. Win! :)]
- 08:45 First programs to run were toys, and their architecture was:
- first 30 words were "initial orders" (boot loader)
- Pressing start button [heh, 44 years before Windows 95] loaded initial orders to memory and began execution.
- program was loaded from tape into memory, starting at location 30
- programs were written in assembly
- 09:52 Wilkes' first real program: he realized that a good part of the remainder of his life was going to be spent debugging.
- Saw subroutines as the solution, assigned it to his grad student, Wheeler.
- 11:13 Wheeler architected working subroutines that required no manual intervention within three(!) months.
- "coordinating orders" augmented "initial orders"
- "pseudo-orders" for relocation of subroutines, parameter assignment, etc.
- initial orders ran coordinating orders interpretively
- 12:25 subroutine linkage technique allowed for
- self-modifying code (good idea when you're working with 512 words of memory, 1024 bytes)
- subroutines could invoke other subroutines ad infinitum (recursion didn't come for another decade)
- 13:41 categories of subroutines in the EDSAC subroutine library
- floating point arithmetic
- arithmetic on complex numbers
- checking (dynamic debugging!)
- division
- exponentials
- general routines relating to functions
- differential equations
- special functions
- power series
- logarithms
- misc.
- print & layout
- quadrature
- read (i.e., input)
- nth root
- trig functions
- counting operations
- vectors & matrices
- 14:37 The Preparation of Programs for an Electronic Digital Computer
- world's first computer programming text
- definitive until high level languages arose
- contained entire API
- cited in Wilke's Turing Award
- Tech report published: 1950
- Published as a book in 1951
- 16:08 Wheeler presented key ideas in 1952 paper to ACM; these had all been implemented:
- subroutine
- subroutine library
- generality vs. performance tradeoffs
- importance & difficulty of library documentation
- information hiding
- the interpretive routine (in order to squeeze your program into memory: write your programs in your own optimized mini-language, and then interpret that)
- the interpretive debugger
- higher-order functions
- 18:00 Quote from Wheeler's paper: "It should be pointed out that the preparation of a library sub-routine requires a considerable amount of work. This is much greater than the effort merely required to code the sub-routine in its simplest possible form. It will usually be necessary to code it in the library standard form and this may detract from its efficiency in time and space. It may be desirable to code it in such a manner that the operation is generalized to some extent. However, even after it has been coded and tested there still remains the considerable task of writing a description so that people not acquainted with the interior coding can nevertheless use it easily. This last task may be the most difficult."
- 18:35 Conclusion of Wheeler's paper: "The prime objectives to be borne in mind when constructing sub-routine libraries are simplicity of use, correctness of codes and accuracy of description. All complexities should—if possible—be buried out of sight."
- 19:41 Wheeler's paper was only two pages long.
- 20:12 Why didn't Wilkes and Wheeler discuss the API as distinct from the library?
- the two were largely isomorphic
- one machine [architecture]; no notion of portability
- no legacy programs; no notion of backward compatibility
- 20:58 reimplementation of existing subroutine libraries for new hardware and with better algorithms: APIs became independent from libraries
- 21:36 Bloch's own research: 1968 paper first to use the term "Application Program Interface"
- 23:33 Why did the term arise?
- goal of allowing implementations to be replaced without harm to clients
- needed a name for the concept
- libraries in practice give rise to APIs: APIs were discovered, more than invented
- What exactly is an API?
- 25:16 Bloch's proposed simple, working definition: "An application programming interface (API) specifies a component in terms of its operations, their inputs, and outputs. Its main purpose is to define a set of functionalities that are independent of their implementation, allowing the implementation to vary without compromising the users of the component."
- 25:41 If you can answer yes to these questions, it's an API:
- Does it provide a set of operations defined by their inputs and outputs?
- Does it admit reimplementation without compromising its users?
- 26:40 FORTRAN II standard library, 1958. The API still works in modern FORTRAN. (!!!!!)
- API? YES
- … Bloch reviews 12 other instruction sets, standard library documents, etc. to see if they pass his two-question API Test.
- 31:07 It seems that too many things meet Bloch's definition: Instruction Set Architectures, CLIs, wire-level protocols. Augment definition [augmentation in italics]:
- "An application programming interface (API) specifies a component in terms of its operations, their inputs, and outputs. Its main purpose is to define a set of functionalities that are independent of their implementation, allowing the implementation to vary without compromising the users of the component. An API augments a programming language (or set of languages with an interoperable calling convention). Alternatively an API may be described in an interface definition language."
- 31:50 Four lessons from quick tour:
- APIs come in all shapes and sizes (and keep getting bigger!)
- Many APIs live forever (outliving the platforms for which they were created)
- APIs can create entire industries above/beneath
- APIs are the methods of operation by which components in a system use one another.
- How does an API come to be?
- 32:49 People write software to address a pain point. If others like your software, they use it. BOOM. Now you have an API, whether you were ready for it, or not.
- "Necessity is the mother of the API."
- What makes an API successful?
- 33:20 Right thing (solves a real problem), right place (successful language or platform), right time, good enough
- 34:22 Success isn't everything!
- If your API is successful and not good, that's bad. If it's good and not successful, it may influence a successful API in the future.
- 34:48 Morals
- You can't know which APIs will take off, or when.
- Design all interfaces as if they were public APIs. (They might be!)
- Don't wait to design in the quality. (It might not be possible, later, and your API may take off while it still sucks.)
- Principles of API design are well known, as are the costs of ignoring them.
- A legal digression
- 35:40 We've always had the freedom to reimplement each others' APIs.
- Current (disfavorable) conclusion to the court case Bloch mentions: http://bits.blogs.nytimes.com/2015/06/29/supreme-court-declines-to-hear-appeal-in-google-oracle-copyright-fight/
No comments:
Post a Comment