├── README.md ├── comparisons ├── gc.md ├── lambda.md └── unicode-support.md ├── images ├── ijk-euler.jpg ├── ijk-fortran.png ├── ijk-fourier.jpg └── ijk-lagrange.jpg ├── languages └── clu.md ├── misc ├── char-names.md └── terms.md └── topics ├── assignment.md ├── branch-prediction.md ├── casting.md ├── fixme.md ├── floating-point.md ├── gc.md ├── index-variables.md ├── lambda.md ├── ports.md ├── purity.md ├── recursion.md ├── stack.md ├── subroutines.md ├── switch.md ├── tagged-pointers.md ├── trampolining.md └── virtual.md /README.md: -------------------------------------------------------------------------------- 1 | # History of Programming Language Topics 2 | 3 | Inspired by Cajori’s _A History of Mathematical Notations_, and/or *TV Tropes*. 4 | 5 | > [On computing as pop culture:] … But pop culture holds a disdain for history. Pop culture is all about identity and feeling like you're participating. It has nothing to do with cooperation, the past or the future — it's living in the present. I think the same is true of most people who write code for money. They have no idea where [their culture came from]… — [Alan Kay](http://www.drdobbs.com/architecture-and-design/interview-with-alan-kay/240003442) 6 | 7 | > It is frequently claimed in American philosophy departments that, in order to be a philosopher, it is not necessary to revisit the history of philosophy. It is like the claim that one can become a painter without having seen a single work of Raphael, or a writer without having ever read the classics. Such things are theoretically possible; but the ‘primitive’ artist, condemned to an ignorance of the past, is always recognizable as such and rightly labelled as a *naïf*. It is only when we reconsider past projects revealed as utopian or as failures that we are apprised of the dangers and possibilities for failure for our allegedly new projects. The study of the deeds of our ancestors is thus more than an antiquarian pastime, it is an immunological precaution. — Umberto Eco, _The Search for the Perfect Language_ 8 | 9 | ## Topic index 10 | 11 | * [Assignment](topics/assignment.md) 12 | * [Branch prediction](topics/branch-prediction.md) 13 | * [Casting](topics/casting.md) 14 | * [FIXME and other comment tags](topics/fixme.md) 15 | * [Floating point](topics/floating-point.md) 16 | * [Garbage collection](topics/gc.md) 17 | * [Index variables (i, j, k, …)](topics/index-variables.md) 18 | * [Lambda (anonymous) functions](topics/lambda.md) 19 | * [Pointer tagging](topics/tagged-pointers.md) 20 | * [Ports (networking)](topics/ports.md) 21 | * [Pure functions](topics/purity.md) 22 | * [Recursion](topics/recursion.md) 23 | * [Stack](topics/stack.md) 24 | * [Subroutines](topics/subroutines.md) 25 | * [Switches](topics/switch.md) 26 | * [Trampolining](topics/trampolining.md) 27 | * [Virtual methods, procedures, etc](topics/virtual.md) 28 | 29 | ## Language comparisons 30 | 31 | * [Garbage collection](comparisons/gc.md) 32 | * [Lambda (anonymous) functions](comparisons/lambda.md) 33 | * [Unicode support](comparisons/unicode-support.md) 34 | 35 | ## Miscellanea 36 | 37 | * [Character names](misc/char-names.md) 38 | * [Terminology](misc/terms.md) 39 | -------------------------------------------------------------------------------- /comparisons/gc.md: -------------------------------------------------------------------------------- 1 | ## Garbage Collection 2 | 3 | ### APL 4 | 5 | [Dyalog APL](http://help.dyalog.com/15.0/Content/UserGuide/Installation%20and%20Configuration/Workspace%20Management.htm) uses a traditional stop-the-world compacting collection when memory runs out. It also uses this opportunity to pack vectors or matrices into more compact representations. 6 | 7 | ### Go 8 | 9 | Finalization is supported (via [`runtime.SetFinalizer`](https://golang.org/pkg/runtime/#SetFinalizer)). 10 | 11 | Finalizers are invoked in dependency order. Accordingly, if a reference cycle contains finalizers, the objects in the cycle are not guaranteed to be finalized nor collected. 12 | 13 | Resurrection seems to be supported as finalization can be re-registered during finalization. 14 | 15 | ### Java 16 | 17 | Finalization is performed on non-user threads. Finalization order is not defined. Unhandled exceptions in finalizers are ignored. 18 | 19 | Object resurrection is supported. Finalizers are only ever invoked once, even if an object is resurrected. 20 | 21 | ### .NET 22 | 23 | .NET supports two GC modes: workstation (optimized for responsiveness) and server (optimized for throughput). 24 | 25 | Finalization is performed on (a) dedicated thread(s). Finalization order is not defined. 26 | 27 | Since .NET 2.0 (2005), unhandled exceptions in finalizers terminate the process. 28 | 29 | Objects may be resurrected during finalization by creating a reference to them somewhere that is considered ‘alive’ (such as a static field). Resurrected objects may re-register for finalization by calling [`GC.ReRegisterForFinalize`](https://msdn.microsoft.com/en-us/library/system.gc.reregisterforfinalize.aspx). 30 | 31 | Explicit finalizers should not be used in modern code. Classes that manage external resources should inherit from [`SafeHandle`](https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.safehandle.aspx). 32 | 33 | ### PHP 34 | 35 | PHP ≥ 5.3 (2009) uses a hybrid reference-counted/GC approach. Most objects are destroyed due to going out of scope, and have their destructors (methods named `__destruct`) invoked at that point. Destructors are called in dependency order unless the program is shutting down, in which case the order is undefined. 36 | 37 | Objects that are caught in a reference cycle are periodically collected by GC. It is not specified what happens to destructors in this case. 38 | 39 | ### Python 40 | 41 | The main implemention (known as ‘CPython’) uses a hybrid reference-counted/GC approach. All objects are refcounted and most are destroyed as soon as they go out of scope. This also means that finalizers (methods called `__del__`) are run on the thread on which the object became unreferenced (this [can cause unexpected deadlocks in unwary code](http://carefully.understood.systems/blog-2017-04-19-bounded-log-queue.html)). 42 | 43 | Objects that are caught in a reference cycle are periodically collected by GC. In CPython 2, if a cycle contains an object with a destructor, none of the objects are finalized or freed, and they are instead stored in a list ([`gc.garbage`](https://docs.python.org/2/library/gc.html)). In CPython ≥ 3.4 (2014), finalizers on all objects in a cycle are invoked in an arbitrary order. In addition, in CPython ≥ 3.4, finalizers are only ever invoked once, even if an object is resurrected. 44 | 45 | Other implementations such as PyPy implement full GC as in other languages, and so finalization occurs on non-user threads. In order to maintain parity with CPython finalization semantics, [PyPy performs finalization in a ‘topological’ manner](https://morepypy.blogspot.com.au/2008/02/python-finalizers-semantics-part-1.html). 46 | 47 | ### Ruby 48 | 49 | The main Ruby implementation (also known as ‘CRuby’ or ‘MRI’) uses a generational garbage collector as of version 2.1 (2013). Earlier versions used mark & sweep. 50 | 51 | Finalization is supported (via [`ObjectSpace.define_finalizer`](https://ruby-doc.org/core-2.2.3/ObjectSpace.html#define_finalizer-method)). For some reason, capturing a reference to `self` in the a finalizer `proc` allegedly [prevents the object from being collected](http://www.mikeperham.com/2010/02/24/the-trouble-with-ruby-finalizers/). -------------------------------------------------------------------------------- /comparisons/lambda.md: -------------------------------------------------------------------------------- 1 | ## Lambda functions/anonymous functions 2 | 3 | 4 | ### Language specifics 5 | 6 | #### C# 7 | 8 | The syntax is `(x, …) => …`, or `x => …` for single-parameter lambdas. The types of the arguments may be specified by `(T x) => …` (here, parentheses are required for single-parameter lambdas). The result type cannot be specified. 9 | 10 | Variables are captured by reference. 11 | 12 | Lambdas have no implicit type (so cannot be assigned to an automatically-typed variable) but are implicitly convertible to any compatible delegate type. 13 | 14 | #### C++ 15 | 16 | The syntax is [captures](T x, …) { … }. captures is a ‘capture list’ that explicitly states what is captured in the closure, and whether it is captured by reference or by value. The return type may be explicitly specified with `[](T x) -> ReturnT { … }`. 17 | 18 | The implicit type of a lambda is an unspeakable name, so in order to pass them to a function, it must be templated or take a type that hides the real type, such as `std::function`. 19 | 20 | #### F# 21 | 22 | The syntax is `fun x y … -> …`. Like normal functions they are curried. Type annotations can be added in the usual manner `fun (x : T) … -> …`. 23 | 24 | Variables are captured by reference. 25 | 26 | #### Haskell 27 | 28 | The syntax is `\x y … -> …`. Type annotations can be added in the usual manner `\(x :: T) -> …`. 29 | 30 | #### Java 31 | 32 | The syntax is `(x, y) -> …` or `x -> …` for single-parameter lambdas. Types can be supplied with `(T x, …) -> …`. The result type cannot be specified. 33 | 34 | #### Javascript 35 | 36 | Anonymous functions are simply declared without a name: `function (x, …){ … }`. 37 | 38 | Since ES6 (2015), the ‘arrow’ syntax can also be used: `(x, …) => …`, or `x => …` for single-parameter functions. 39 | 40 | #### Matlab 41 | 42 | The syntax is `@(x, …) …`. 43 | 44 | #### Python 45 | 46 | The syntax is `lambda x, …: …`. 47 | 48 | Variables are captured by reference. 49 | -------------------------------------------------------------------------------- /comparisons/unicode-support.md: -------------------------------------------------------------------------------- 1 | ## Unicode support 2 | 3 |
4 |
Identifiers
5 |
6 | 11 |
12 |
Char type
13 |
14 | 19 |
20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
LanguageIdentifiersChar type
C#L|Nl|'_' (L|Pc|Nd|Nl|Mn|Mc|Cf)*✗ (UTF-16 code unit)
HaskellLl|Lu|Lt (Ll|Lu|Lt|Nd|'_'|''')*
JavaL|Nl|Sc|Pc (L|Sc|Pc|Nd|Nl|Mn|Mc|Cf|Cc)*✗ (UTF-16 code unit)
Python 3💯 XID_Start XID_Continue*💯
Swift✓ (see link)✓ (can represent extended grapheme clusters as well)
-------------------------------------------------------------------------------- /images/ijk-euler.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Porges/programming-history/d36850d3d74a6816febed954b1bec98f3874d32c/images/ijk-euler.jpg -------------------------------------------------------------------------------- /images/ijk-fortran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Porges/programming-history/d36850d3d74a6816febed954b1bec98f3874d32c/images/ijk-fortran.png -------------------------------------------------------------------------------- /images/ijk-fourier.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Porges/programming-history/d36850d3d74a6816febed954b1bec98f3874d32c/images/ijk-fourier.jpg -------------------------------------------------------------------------------- /images/ijk-lagrange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Porges/programming-history/d36850d3d74a6816febed954b1bec98f3874d32c/images/ijk-lagrange.jpg -------------------------------------------------------------------------------- /languages/clu.md: -------------------------------------------------------------------------------- 1 | ## CLU (1979) 2 | 3 | 4 | ### Features 5 | 6 | * [exceptions](../topics/exceptions.md) 7 | * [iterators](../topics/iterators.md) 8 | * [parameterized types](../topics/generics.md) 9 | * [variant types](../topics/tagged-unions.md) 10 | 11 | ### References 12 | 13 | * [A History of CLU](http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-561.pdf) (1992) 14 | * [CLU Reference Manual](http://www.lcs.mit.edu/publications/pubs/pdf/MIT-LCS-TR-225.pdf) (1979) 15 | 16 | About: 17 | * [A critique of the programming language CLU](http://jklp.org/profession/papers/clu/paper.htm) (1978) -------------------------------------------------------------------------------- /misc/char-names.md: -------------------------------------------------------------------------------- 1 | ## Character names 2 | 3 | Collect these for cuteness. 4 | 5 | ### ASCII 6 | 7 | TODO: Jargon file? It's a bit silly 8 | 9 | | Char | Unicode | Other | 10 | |------|---------|-------| 11 | | `!` | exclamation mark | bang | 12 | | `/` | solidus | slash | 13 | | \ | reverse solidus | backslash, whack | 14 | | | | vertical line | bar, pipe | 15 | 16 | ### APL-specific 17 | 18 | | Char | Name | 19 | |------|------| 20 | | ↑ | pike | 21 | | ↓ | spike | 22 | | ⍤ | paw | 23 | | ⍥ | hoof | 24 | | ⌹ | domino | 25 | | ⍝ | lamp | 26 | -------------------------------------------------------------------------------- /misc/terms.md: -------------------------------------------------------------------------------- 1 | ## Terminology 2 | 3 |
4 | 5 |
bit
6 |
smallest unit of information (1/0, true/false, on/off...): Coined by John Tukey in 1946 (internal memo 1947). First published use by Claude Shannon in 1948.
7 | 8 |
byte
9 |
smallest usable data size for a processor: Coined by Werner Bucholz (internal memo 1956) to describe 1-6 bit bytes.
10 | 11 |
nybble
12 |
half a byte: unknown origin (referenced in IBM 360 documentation?).
13 | 14 |
word
15 |
native data size for a processor: Used by Alan Turing, *Proposed Electronic Calculator* (“The ACE Report”).
16 | 17 |
18 | 19 | 20 | ### References 21 | 22 | * bit 23 | * Shannon, Claude. 1948. “A Mathematical Theory of Communication”. *Bell System Technical Journal* 27 (3): 379–423. 24 | * Tropp, Henry. 1984. “Origin of the Term *bit*”. *Annals of the History of Computing* 6 (2): 152–155. 25 | 26 | * byte 27 | * Bucholz, Werner. 1977. “The Word ‘Byte’ Comes of Age...” *BYTE* 2 (2): 144. 28 | * ???, 1981. “???”. *Annals of the History of Computing* 3 (1): ???. 29 | -------------------------------------------------------------------------------- /topics/assignment.md: -------------------------------------------------------------------------------- 1 | ## Assignment 2 | 3 | 4 | ### See also 5 | 6 | * [Why does "=" mean assignment?](https://www.hillelwayne.com/post/equals-as-assignment/) 7 | -------------------------------------------------------------------------------- /topics/branch-prediction.md: -------------------------------------------------------------------------------- 1 | ## Branch prediction 2 | 3 | ### See also 4 | 5 | * https://danluu.com/branch-prediction/ 6 | -------------------------------------------------------------------------------- /topics/casting.md: -------------------------------------------------------------------------------- 1 | ## Downcasting and Upcasting 2 | 3 | The oldest reference I've found yet is from September 1990, in [a Usenet post](http://groups.google.com/group/gnu.g++.bug/msg/0f9930a029cf2657?dmode=source). This uses the term “castdown”. 4 | 5 | The library referenced there is the NIHCL ([available from the Software Preservation Group](http://www.softwarepreservation.org/projects/c_plus_plus/library/index.html#NIHCL)), which contains this code (`MI` is "multiple inheritance"): 6 | 7 | ```c++ 8 | #ifdef MI 9 | 10 | #define DECLARE_CASTDOWN(classname) \ 11 | static classname& castdown(Object& p) \ 12 | { return *(classname*)(&p ? p._safe_castdown(*desc()) : 0); } \ 13 | static const classname& castdown(const Object& p) \ 14 | { return *(const classname*)(&p ? p._safe_castdown(*desc()) : 0); } \ 15 | static classname* castdown(Object* p) \ 16 | { return (classname*)(p ? p->_safe_castdown(*desc()) : 0); } \ 17 | static const classname* castdown(const Object* p) \ 18 | { return (const classname*)(p ? p->_safe_castdown(*desc()) : 0); } \ 19 | 20 | #else 21 | 22 | #define DECLARE_CASTDOWN(classname) \ 23 | static classname& castdown(Object& p) { return (classname&)p; } \ 24 | static const classname& castdown(const Object& p) { return (const classname&)p; } \ 25 | static classname* castdown(Object* p) { return (classname*)p; } \ 26 | static const classname* castdown(const Object* p) { return (const classname*)p; } \ 27 | 28 | #endif 29 | ``` 30 | 31 | The book that this code was included with (*[Data Abstraction and Object-Oriented Programming in C++](http://books.google.co.nz/books?ei=S_kUT-rVEpCKmQXHrYXBAw&id=H5sZAQAAIAAJ&dq=%22Data+abstraction+and+object-oriented+programming+in+C%2B%2B%22+cast+down&q=%22castdown%22#search_anchor)*, 1990) also uses the term “castdown”. 32 | 33 | The term "castdown" also seems to predate “downcast”, [at least on Usenet](http://groups.google.com/groups/search?safe=off&q=%22castdown%22&btnG=Search&as_mind=1&as_minm=1&as_miny=1981&as_maxd=31&as_maxm=12&as_maxy=1990&as_drrb=b&sitesearch=). 34 | -------------------------------------------------------------------------------- /topics/fixme.md: -------------------------------------------------------------------------------- 1 | ## FIXME, TODO, HACK, BUGBUGBUG, etc 2 | 3 | [Juho Snellman found](https://www.snellman.net/blog/archive/2017-04-17-xxx-fixme/) that `XXX` to mark “fix me” was probably introduced by Bill Joy, working on BSD in 1981. He had earlier used `###` for the same. 4 | 5 | ### See also 6 | * [‘FixmeComment’ on the Wiki Wiki Web](http://wiki.c2.com/?FixmeComment) 7 | -------------------------------------------------------------------------------- /topics/floating-point.md: -------------------------------------------------------------------------------- 1 | ## Floating point 2 | 3 | ### See also 4 | * https://people.eecs.berkeley.edu/~wkahan/ieee754status/754story.html 5 | -------------------------------------------------------------------------------- /topics/gc.md: -------------------------------------------------------------------------------- 1 | ## Garbage Collection 2 | 3 | ### History 4 | 5 | Garbage collection was invented by John McCarthy [for the original LISP implementation on the IBM 704](http://www-formal.stanford.edu/jmc/recursive.html) (1958). 6 | 7 | ### Well-known implementations 8 | 9 | #### Boehm 10 | 11 | ### Distinguishing factors 12 | 13 | #### Concurrent vs. blocking (‘stop the world’) 14 | 15 | #### Support for finalization and resurrection 16 | 17 | #### GC triggers 18 | 19 | ##### Out of memory 20 | 21 | This is the traditional method. When the program tries to allocate some memory and cannot, a reclamation cycle is started to free up memory. 22 | 23 | This is simple but there are some disadvantages: 24 | 25 | * Memory must be reclaimed when the program is performing operations, rather than during any period of downtime. 26 | * There will be more memory to reclaim and more work to do than if it were reclaimed earlier. 27 | * In languages with finalizers, the finalizers may be delayed a long time before they are invoked, if the program is not allocating much memory. 28 | 29 | Generational GC counters these problems due to having a small initial generation. This will fill up faster and so there will be less work to do and finalizers will be invoked more promptly. 30 | 31 | ##### Incremental -------------------------------------------------------------------------------- /topics/index-variables.md: -------------------------------------------------------------------------------- 1 | ## Index variables (i, j, k, …) 2 | 3 | TLDR: First used—or at least popularized—by Fourier. 4 | 5 | ### Fortran 6 | 7 | Many people state that Fortran is is the reason that the *ijk* variables are so popular in programming languages. Here's a snippet from the *[Fortran Automatic Coding System for the IBM 704](http://www.fh-jena.de/~kleine/history/languages/FortranAutomaticCodingSystemForTheIBM704.pdf)* manual: 8 | 9 | ![](../images/ijk-fortran.png) 10 | 11 | In Fortran ([at least in 1957](https://web.archive.org/web/20150812002400/http://archive.computerhistory.org/resources/text/Fortran/102663113.05.01.acc.pdf)), integers are primarily used to index, not to calculate: 12 | 13 | > Integer quantities are somewhat restricted in their use and serve primarily as subscripts or exponents. 14 | 15 | This leads us to look further back, for a mathematical source. 16 | 17 | ### Mathematics 18 | 19 | The most common place (at least for non-mathematicians) to see *ijk* in mathematics is probably with *sigma notation*, when using the summation operator Σ. 20 | 21 | Florian Cajori’s *A History of Mathematical Notations* states that Σ was first used by Euler, in *[Institutiones calculi differentialis](http://books.google.co.nz/books?id=sYE_AAAAcAAJ)* (1755). 22 | 23 | ![](../images/ijk-euler.jpg) 24 | 25 | This reads (translation by [Ian Bruce](http://www.17centurymaths.com/)): 26 | 27 | > 26. Just as we have been accustomed to specify the difference by the sign Δ, thus we will indicate the sum by the sign Σ; evidently if the difference of the function y were z, there will be z = Δy; from which, if y may be given, the difference z is found we have shown before. But if moreover the difference z shall be given and the sum of this y must be found, y = Σz is made and evidently from the equation z = Δy on regressing this equation will have the form y = Σz, where some constant quantity can be added on account of the reasons given above; [] 28 | 29 | This doesn’t seem to be the Σ we’re looking for, as Euler uses it only in opposition to Δ (for finite differencing). In fact, Cajori notes that Euler’s Σ received little attention, and it seems that only Lagrange adopted it. Here is an excerpt from his *[Œuvres](http://www.archive.org/details/oeuvrespublies03lagruoft)* (printed MDCCCLXIX): 30 | 31 | ![](../images/ijk-lagrange.jpg) 32 | 33 | Again, we can see Σ is only used in opposition to Δ. Cajori next states that Σ to mean sum was used by Fourier, in his *[Théorie Analytique de la chaleur](http://www.archive.org/details/thorieanalytiq00four)* (1822), and here we find what are looking for: 34 | 35 | ![](../images/ijk-fourier.jpg) 36 | 37 | > The sign Σ affects the number i and indicates that the sum must be taken from i=1 to i=1/0. One can also contain the first term 1 under the sign Σ, and we have: [equation] 38 | > 39 | > It must then have all its integral values from -1/0 up to 1/0; that is what one indicates by writing the limits -1/0 and +1/0 next to the sign Σ, that one of the values of i is 0. This is the most concise expression of the solution. 40 | 41 | Since Fourier explains Σ several times in the book and not just once, we can assume that the notation is either new or unfamiliar to most readers. In any case, it doesnt really matter who invented it, because while we have found our Σ, Fourier doesnt explain why he uses *i*. In fact, since he uses it to index sequences in other places it appears it must be an already-existing usage. 42 | 43 | A quick skim of the text by Euler above shows that he uses indexing very rarely (despite the subject of the text being a prime candidate!), and when he does, he uses *m*. 44 | 45 | TBC! 46 | -------------------------------------------------------------------------------- /topics/lambda.md: -------------------------------------------------------------------------------- 1 | ## Lambda functions/anonymous functions 2 | 3 | ### See also 4 | 5 | * Annotated Turing, p. 283–284. (About Church, has references to more references as well.) 6 | -------------------------------------------------------------------------------- /topics/ports.md: -------------------------------------------------------------------------------- 1 | ## Ports 2 | 3 | ### See also 4 | 5 | * [How SSH port became 22](https://www.ssh.com/ssh/port) 6 | -------------------------------------------------------------------------------- /topics/purity.md: -------------------------------------------------------------------------------- 1 | ## “Purity” 2 | 3 | Mathematical functions have often been described as “pure” in terms of some specified variables. e.g.: 4 | 5 | > the first term is a pure function of x and the second term is a pure function of y 6 | 7 | Because of this, I think that finding a true “first” occurrence will be near-impossible. 8 | 9 | For programming languages, a little searching shows that [Ada 95](http://www.adacore.com/multimedia/Ada95_RM_HTML/RM-10-2-1.html) (`pragma Pure`), [High Performance Fortran](http://www.vcpc.univie.ac.at/information/mirror/HPFF/hpf1/hpf-v10/subsubsection2_5_3_1_1.html) (1993) (`PURE`) and [VHDL-93](http://www.vhdl.org/isac/IRs-VHDL-93/IR1083.txt) (`pure`) all contain formal notions of what 'pure functions' are. 10 | 11 | Haskell (1990) is fairly obvious, but purity isn't explicit (_impurity_ is marked by the `IO` type instead). GCC's C has [various function attributes](http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html) for various differing levels of 'pure'. 12 | 13 | A couple of books: [*Rationale for the C programming language*](http://books.google.com/books?id=yxLISD0TAbEC&lpg=PA48&dq=%22pure%20function%22&pg=PA48#v=onepage&q=%22pure%20function%22&f=false) (1990) uses the term, as does [*Programming Languages and their Definitions*](http://books.google.com/books?id=mCoN_I5vjX0C&lpg=PA139&dq=%22a%20pure%20function%22&pg=PA139#v=onepage&q=%22a%20pure%20function%22&f=false) (1984). However, both apparently only use it once! *Programming the IBM Personal Computer, Pascal* (also 1984) uses the term, but it isn't clear from Google's restricted view whether or not the Pascal compiler had support for it. (I suspect not.) 14 | 15 | An interesting note is that "Preliminary Green" (one of four candidates for Ada), [actually had a fairly strict 'function' definition](http://www.adahome.com/LRM/83/Rationale/Text/ratl-c8.hlp) – even memory allocation was disallowed. However, this was dropped before it became Ada, where functions can have side-effects (I/O or global variables), but can't modify their arguments. 16 | 17 | [C28-6571-3](http://www.bitsavers.org/pdf/ibm/360/pli/C28-6571-3_PL_I_Language_Specifications_Jul66.pdf) (the first PL/I reference manual, written before the compiler) shows that PL/I had support for pure functions, in the form of the `REDUCIBLE` (= pure) attribute, as far back as 1966 - when the compiler was first released. 18 | 19 | This last document specifically notes that it includes `REDUCIBLE` as a new change since document C28-6571-2. So REDUCIBLE, which is possibly the first incarnation of formal pure functions in programming languages, appeared somewhere between January and July 1966. 20 | 21 | The earliest instance of "pure function" on Google Groups in this sense [is from 1988](http://groups.google.com/group/comp.lang.c/browse_thread/thread/9ca30dbe495fe14/1afe80f3eef4a3fc?q=%22pure+function%22#1afe80f3eef4a3fc), which easily postdates the book references. 22 | 23 | ### Timeline 24 | 25 | * Jan–Jul 1966: PL/I (`REDUCIBLE`) 26 | * 1978: Preliminary Green (`function`) 27 | * 1993: High Performance Fortran (`PURE`), VHDL-93 (`pure`) 28 | * 1995: Ada 95 (pragma Pure) 29 | * 1990: Haskell (all functions) 30 | * 2010: .NET (`PureAttribute`, `[Pure]` in C# syntax) – introduced to support Code Contracts 31 | -------------------------------------------------------------------------------- /topics/recursion.md: -------------------------------------------------------------------------------- 1 | ## Recursion 2 | 3 | ### See also 4 | 5 | * [How recursion got into programming: a tale of intrigue, betrayal, and advanced programming-language semantics](https://vanemden.wordpress.com/2014/06/18/how-recursion-got-into-programming-a-comedy-of-errors-3/) 6 | * [On the origin of recursive procedures](http://www.fibonacci.org/GHE7.pdf) 7 | * [Recursion?](http://horningtales.blogspot.com.au/2006/07/recursion.html) 8 | * [The advent of recursion in programming](http://www.illc.uva.nl/Research/Publications/Reports/PP-2010-04.text.pdf) http://www.dijkstrascry.com/sites/default/files/papers/preprint_0.pdf 9 | * [The use of recursive procedures in ALGOL 60](http://www.sciencedirect.com/science/article/pii/S006641386380004X) 10 | -------------------------------------------------------------------------------- /topics/stack.md: -------------------------------------------------------------------------------- 1 | ## Stack 2 | 3 | ### See also 4 | 5 | * Possibly introduced by Turing as early as his [ACE report](http://www.alanturing.net/turing_archive/archive/p/p01/P01-030.html) (push/pop being `BURY`/`UNBURY`). 6 | -------------------------------------------------------------------------------- /topics/subroutines.md: -------------------------------------------------------------------------------- 1 | ## Subroutines 2 | 3 | ### See also 4 | 5 | * [Subroutine and procedure call support](https://people.cs.clemson.edu/~mark/subroutines.html) 6 | -------------------------------------------------------------------------------- /topics/switch.md: -------------------------------------------------------------------------------- 1 | ## Switches 2 | 3 | ### See also 4 | 5 | * [The curious case of the switch statement](https://eev.ee/blog/2016/09/18/the-curious-case-of-the-switch-statement/) 6 | -------------------------------------------------------------------------------- /topics/tagged-pointers.md: -------------------------------------------------------------------------------- 1 | ## Tagged pointers 2 | 3 | ### See also 4 | 5 | * [Numbers and tagged pointers in early Lisp implementations](https://www.snellman.net/blog/archive/2017-09-04-lisp-numbers/) 6 | -------------------------------------------------------------------------------- /topics/trampolining.md: -------------------------------------------------------------------------------- 1 | ## Trampolining 2 | 3 | 4 | ### See also 5 | 6 | * [SCHEME->C, a portable Scheme-to-C compiler](http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-89-1.pdf) (January, 1989) 7 | -------------------------------------------------------------------------------- /topics/virtual.md: -------------------------------------------------------------------------------- 1 | ## Virtual {methods, functions, procedures} 2 | 3 | Introduced by SIMULA-67. According to [1], the introduction of ‘virtual’ into SIMULA occurred just before May 1967, in time to be included in the paper [2] presented at the IFIP TC2 Conference on Simulation Programming Languages. 4 | 5 | 6 | ### See also 7 | 8 | 1. [The Birth of Object Orientation: the Simula Languages](http://www.olejohandahl.info/old/birth-of-oo.pdf). Ole-Johan Dahl, June 2001. 9 | 2. [Class and Subclass Declaration](https://web.archive.org/web/20150926032359/http://www.iai.uni-bonn.de/~manthey/SS06/Quellen/Dahl_hist.pdf). Ole-Johan Dahl and Kristen Nygaard, 1967. 10 | 3. [This answer by Steven Jeuris on the Software Engineering StackExchange](http://softwareengineering.stackexchange.com/a/47932/29599) 11 | --------------------------------------------------------------------------------