<p>As far as I can tell pattern matching was first proposed as a language feature by <a href="https://doi.org/10.1093/comjnl/12.1.41" rel="noreferrer">Burstall (1969)</a>. However, it was a proposal for a feature in the language ISWIM, which itself never had a completed implementation.</p>
<p><a href="https://personal.cis.strath.ac.uk/conor.mcbride/FVMcB-PhD.pdf" rel="noreferrer">F. V. McBride’s Ph.D. dissertation (1970)</a> presented an implementation of a pattern matcher based on a modification of the Lisp 1.5 metacircular interpreter.</p>
<p>Are there any earlier implementations of pattern matching as a programming language feature than this?</p>
<p>(Note I am not interested in pattern matching in the sense of regular expressions on strings, whose history is basically well known.)</p>

<implementation><history><pattern-matching>
Earliest implementation of pattern matching as a programming language feature
CC BY-SA 4.0
2023-11-07T18:57:00.720Z
This is definitely a programming language design question, and history questions are on-topic here. That said, if it was definitely first proposed in 1969, then even if an implementation in 1970 isn't the first one, other implementations can't have beaten it by much.
kaya3
CC BY-SA 4.0
2023-11-07T20:49:05.763Z
It’s possible I’m wrong that Burstall’s paper was the first proposal. I’d be equally interested in documentation earlier than 1969.
Daphne Preston-Kendal
<p>The <a href="https://en.wikipedia.org/wiki/SNOBOL" rel="noreferrer">SNOBOL</a> series of languages were developed between 1962 and 1967. Pattern matching is one of its basic operations, and patterns are a first-class data type.</p>
<p>There were other string-processing languages COMIT and TRAC developed in the 1950's, but from what I can find they didn't have pattern matching.</p>

CC BY-SA 4.0
2023-11-07T21:12:17.420Z
2023-11-07T21:12:17.420Z
Barmar
CC BY-SA 4.0
2023-11-07T22:54:53.947Z
I feel like SNOBOL pattern matching fits more under the "regular expressions on strings" bucket (even though they're not regular expressions) than the sense of the pattern matching used in the examples in the question. It's sufficiently complex that I'm not certain it's ruled out, though.
Michael Homer
CC BY-SA 4.0
2023-11-08T16:39:28.617Z
I haven't read the references he linked to. Is this more like the structural pattern matching in Scheme macros, or Python's `match/case` statements?
Barmar
CC BY-SA 4.0
2023-11-08T21:05:01.847Z
Indeed, SNOBOL pattern matching is an interesting precedent (especially since it goes beyond regular expressions to context-free grammars, something I don’t think was tried again at that scale until Perl 6/Raku) but I’m looking for pattern matching over arbitrary values or at least values which have some structure inherent to them, not just strings.
Daphne Preston-Kendal
# Earliest implementation of pattern matching as a programming language feature
Posted by: username_0 on 2023-11-07
As far as I can tell pattern matching was first proposed as a language feature by [Burstall (1969)](https://doi.org/10.1093/comjnl/12.1.41). However, it was a proposal for a feature in the language ISWIM, which itself never had a completed implementation.

[F. V. McBride’s Ph.D. dissertation (1970)](https://personal.cis.strath.ac.uk/conor.mcbride/FVMcB-PhD.pdf) presented an implementation of a pattern matcher based on a modification of the Lisp 1.5 metacircular interpreter.

Are there any earlier implementations of pattern matching as a programming language feature than this?

(Note I am not interested in pattern matching in the sense of regular expressions on strings, whose history is basically well known.)
**Tags:** implementation history pattern-matching
> **Comments:**
> **username_1**: This is definitely a programming language design question, and history questions are on-topic here. That said, if it was definitely first proposed in 1969, then even if an implementation in 1970 isn't the first one, other implementations can't have beaten it by much.  
> **username_0**: It’s possible I’m wrong that Burstall’s paper was the first proposal. I’d be equally interested in documentation earlier than 1969.  
---
## 1 answers
### Answer by username_2 on 2023-11-07. Score: 6
The [SNOBOL](https://en.wikipedia.org/wiki/SNOBOL) series of languages were developed between 1962 and 1967. Pattern matching is one of its basic operations, and patterns are a first-class data type.

There were other string-processing languages COMIT and TRAC developed in the 1950's, but from what I can find they didn't have pattern matching.
> **Comments:**
> **username_3** (2023-11-07): I feel like SNOBOL pattern matching fits more under the "regular expressions on strings" bucket (even though they're not regular expressions) than the sense of the pattern matching used in the examples in the question. It's sufficiently complex that I'm not certain it's ruled out, though.  
> **username_2** (2023-11-08): I haven't read the references he linked to. Is this more like the structural pattern matching in Scheme macros, or Python's `match/case` statements?  
> **username_0** (2023-11-08): Indeed, SNOBOL pattern matching is an interesting precedent (especially since it goes beyond regular expressions to context-free grammars, something I don’t think was tried again at that scale until Perl 6/Raku) but I’m looking for pattern matching over arbitrary values or at least values which have some structure inherent to them, not just strings.  
---
