---
title: "Language specs"
tags: ["T-spec"]
date: 2023-12-14
url: https://hackmd.io/sHLhF9UeRVKUyEz-gHX7Zg
---
# Language specs
- C++
- Current draft: https://github.com/cplusplus/draft
- HTML: https://eel.is/c++draft/
- C++14: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf
- C++17: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4713.pdf
- C++20: https://isocpp.org/files/papers/N4860.pdf
- C++23: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf
- The C++ Programming Language, Fourth Edition: https://chenweixiang.github.io/docs/The_C++_Programming_Language_4th_Edition_Bjarne_Stroustrup.pdf
- C
- https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
- C23: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3088.pdf
- GNU C Language Reference: https://git.savannah.nongnu.org/cgit/c-intro-and-ref.git
- Go Language Specification: https://go.dev/ref/spec
- Haskell
- Haskell 98 Language and Libraries: The Revised Report: https://www.haskell.org/definition/haskell98-report.pdf
- Haskell 2010 Language Report: https://www.haskell.org/onlinereport/haskell2010/haskell.html
- C#:
- C# Reference: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/
- ECMA-334: https://www.ecma-international.org/wp-content/uploads/ECMA-334_5th_edition_december_2017.pdf
- ECMA-TC49-TG2: https://github.com/dotnet/csharpstandard
- ECMAScript:
- https://262.ecma-international.org/
- 2018: https://262.ecma-international.org/9.0/
- TypeScript: https://github.com/microsoft/TypeScript/blob/138b08efbdebcaf64aa23441ba14f2a216f967cf/doc/spec-ARCHIVED.md
- Note: They no longer maintain a reference AFAIK.
- Swift
- The Swift Programming Language: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/
- Language Reference: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/aboutthelanguagereference/
- Language Guide: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics
- Java:
- Java SE 11: https://docs.oracle.com/javase/specs/jls/se11/html/index.html
- Ada
- 2012 Reference Manual: https://docs.adacore.com/live/wave/arm12/html/arm12/arm12.html
- 2022 Reference Manual: https://docs.adacore.com/live/wave/arm22/html/arm22/arm22.html
- Annotated 2022 Reference Manual: http://www.ada-auth.org/standards/22aarm/html/AA-TOC.html
- Rationale: https://www.adacore.com/uploads/papers/Ada2012_Rationale.pdf
- D specification: https://dlang.org/spec/spec.html
- Standard ML
- The Definition of Standard ML, Revised: https://smlfamily.github.io/sml97-defn.pdf
- The Definition of Standard ML: https://smlfamily.github.io/sml90-defn.pdf
- Commentary on Standard ML: https://scispace.com/pdf/commentary-on-standard-ml-19ann4exso.pdf
- Scheme: https://small.r7rs.org/attachment/r7rs.pdf
- Racket Reference: https://docs.racket-lang.org/reference/index.html
- Ferrocene Language Specification: https://spec.ferrocene.dev/general.html
- Webassembly Specification: https://webassembly.github.io/spec/core/index.html
- Wasm SpecTec DSL for formal specification: https://github.com/WebAssembly/spec/blob/main/spectec/README.md
- KWasm: Semantics of WebAssembly in K: https://github.com/runtimeverification/wasm-semantics
- Lua
- Lua 5.4 Reference Manual: https://www.lua.org/manual/5.4/
- Common Lisp
- Common Lisp: The Language, Second Edition: https://www.lispmachine.net/books/common_lisp_the_language.pdf
- https://ldbeth.sdf.org/cltl2.html
- https://ldbeth.sdf.org/clm.pdf
- https://ldbeth.sdf.org/bookmarkedclm.pdf
- Common Lisp HyperSpec: https://www.lispworks.com/documentation/HyperSpec/Front/index.htm
- Algol 68
- Revised Report on the Algorithmic Language Algol 68: https://www.softwarepreservation.org/projects/ALGOL/report/Algol68_revised_report-AB-600dpi.pdf
- Python
- The Python Language Reference: https://docs.python.org/3/reference/index.html
- ALPHARD
- ALPHARD: Form and Content: https://web.archive.org/web/20161013010804/http://repository.cmu.edu/isr/870/
- CLU
- CLU Reference Manual: https://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-225.pdf
- ICON
- The ICON Programming Language, Third Edition: https://www2.cs.arizona.edu/icon/ftp/doc/lb1up.pdf
## How normative language documents describe themselves
| Language | spec? | std? | ref? | req? | report? | descr? | def? |
|-------------------------|-------|------|------|------|---------|--------|------|
| Scheme | No | No | Yes | No | Yes | Yes | Yes |
| Ada | No | No | Yes | No | No | No | No |
| C++23 | No | Yes | No | Yes | No | No | No |
| C23 | No | Yes | No | No | No | No | No |
| C# | No | No | Yes | No | No | No | No |
| C# ECMA-334 | Yes | No | No | No | No | No | No |
| C# ECMA-TC49-TG2 | Yes | Yes | No | No | No | No | No |
| Go | Yes | No | Yes | No | No | No | No |
| Haskell 2010 | No | No | No | No | Yes | No | No |
| ECMAScript 2018 | Yes | Yes | No | No | No | No | No |
| Swift | No | No | Yes | No | No | No | No |
| D | Yes | No | Yes | No | No | No | No |
| Racket | No | No | Yes | No | No | No | No |
| Java | Yes | No | No | No | No | No | No |
| Standard ML | No | No | No | No | No | Yes | Yes |
| Lua | No | No | Yes | No | No | No | Yes |
| Algol 68 | No | No | No | No | Yes | Yes | No |
| Python | No | No | Yes | No | No | No | No |
| CLU | No | No | Yes | No | No | No | No |
| Common Lisp - CLtL | No | ~No | No | No | No | No | Yes |
| Common Lisp - HyperSpec | Yes | No | No | No | No | No | No |
| Rust - Reference | No | No | Yes | No | No | No | No |
| Rust - FLS | ~Yes | No | No | No | No | Yes | No |
Legend:
- `spec`: "Specification". If the doc says it "specifies" something, we don't count that.
- `std`: "Standard". If the document has a prominent header that says "Standard", as the C docs do, then we count that even if it otherwise doesn't refer to itself this way in the document.
- `ref`: "Reference", "reference manual", or "language reference".
- `req`: "Requirements".
- `report`: "Report".
- `descr`: "Description" or "formal description".
- `def`: "Definition" or "defining description" (in which case it's also a "description").
### Ada -- Ada Reference Manual
> This document is the Ada Reference Manual. The International Standard for the programming language Ada is ISO/IEC 8652:2023(E). The International Standard is derived from the Ada Reference Manual, with various non-normative changes. In particular, the International Standard numbers clauses differently, omits paragraph numbers, eliminates the Acknowledgements, and modifies various front matter such as the Title page and the Foreword.
> This Reference Manual specifies the form and meaning of programs written in Ada. Its purpose is to promote the portability of Ada programs to a variety of computing systems.
### C23 - Programming Languages -- C -- International Standard
> This document specifies the form and establishes the interpretation of programs written in the C programming language. It is designed to promote the portability of C programs among a variety of data-processing systems. It is intended for use by implementers and programmers.
### C++23 -- Standard for Programming Language C++
> This document specifies requirements for implementations of the C++ programming language. The first such requirement is that they implement the language, so this document also defines C++. Other requirements and relaxations of the first requirement appear at various places within this document.
### C# - C# Language Reference
> The language reference provides an informal reference to C# syntax and idioms for beginners and experienced C# and .NET developers.
### C# ECMA-334 - C# Language Specification
> This specification is based on a submission from Hewlett-Packard, Intel, and Microsoft, that described a language called C#, which was developed within Microsoft.
> This specification describes the form and establishes the interpretation of programs written in the C# programming language.
### C# ECMA-TC49-TG2 - C# Language Standard / C# Language Specification
Same text as above.
### Go - The Go Programming Language Specification
> This is the reference manual for the Go programming language.
### Scheme - Revised(7) Report on the Algorithmic Language Scheme
> The report gives a defining description of the programming language Scheme.
### Haskell 2010 Language Report
> This report defines the syntax for Haskell programs and an informal abstract semantics for the meaning of such programs.
### ECMAScript 2018 Language Specification
> This Ecma Standard defines the ECMAScript 2018 Language. It is the tenth edition of the ECMAScript Language Specification.
### Swift - Language Reference
> About the Language Reference
> This part of the book describes the formal grammar of the Swift programming language. The grammar described here is intended to help you understand the language in more detail, rather than to allow you to directly implement a parser or compiler.
### D - Language Reference
> This is the specification for the D Programming Language.
>
> This document is the reference manual for the D Programming Language.
### Racket - The Racket Reference
> This manual defines the core Racket language and describes its most prominent libraries.
### Java -- The Java Language Specification
> This specification clearly distinguishes between the compile-time errors that can and must be detected at compile time, and those that occur at run time.
### Standard ML -- The Definition of Standard ML
> A precise description of a programming language is a prerequisite for its implementation and for its use. The description can take many forms, each suited to a different purpose. A common form is a reference manual, which is usually a careful narrative description of the meaning of each construction in the language, often backed up with a formal presentation of the grammar (for example, in Backus-Naur form). This gives the programmer enough understanding for many of his purposes. But it is ill-suited for use by an implementer, or by someone who wants to formulate laws for equivalence of programs, or by a programmer who wants to design programs with mathematical rigor.
>
> This document is a formal description of both the grammar and the meaning of a language which is both designed for large projects and widely used. As such, it aims to serve the whole community of people seriously concerned with the language. At a time when it is increasingly understood that programs must withstand rigorous analysis, particularly for systems where safety is critical, a rigorous language presentation is even important for negotiators and contractors; for a robust program written in an insecure language is like a house built upon sand.
>
> Most people have not looked at a rigorous language presentation before. To help them particularly, but also to put the present work in perspective for those more theoretically prepared, it will be useful here to say something about three things: the nature of Standard ML, the task of language definition in general, and the form of the present Definition. We also briefly describe the recent revisions to the Definition.
> This document formally defines Standard ML.
### WebAssembly -- WebAssembly Specification
> This document describes version 2.0 (Draft 2025-05-15) of the core WebAssembly standard.
### Lua - Lua 5.4 Reference Manual
> The reference manual is the official definition of the Lua language.
### Algol 68 - Revised Report on the Algorithmic Language Algol 68
> This Report has been accepted by the Working Group 2.1, reviewed by the Technical Committee 2 on Programming and approved for publication by the General Assembly of the International Federation for Information Processing.
> Completeness and clarity of the description
>
> The Group wishes to contribute to the solution of the problems of describing a language clearly and completely.
### Python -- The Python Language Reference
> This reference manual describes the syntax and “core semantics” of the language. It is terse, but attempts to be exact and complete.
### CLU - CLU Reference Manual
> This document serves both as an introduction to CLU and as a language reference manual.
### Common Lisp - Common Lisp The Language
> Since publication of the first edition of this book in 1984, many implementors have used it as a *de facto* standard for Lisp implementation.
> The 1984 definition of Common Lisp was imperfect and incomplete.
### Common Lisp - HyperSpec
> The specification set forth in this document is designed to promote the portability of Common Lisp programs among a variety of data processing systems. It is a language specification aimed at an audience of implementors and knowledgeable programmers. It is neither a tutorial nor an implementation guide.
## Notes
Writings about the process of creating language specifications.
- Interesting little paper comparing different ways languages are specified: https://web.archive.org/web/20190226111236/http://www.knosof.co.uk/vulnerabilities/langconform.pdf
- How Modula-2 uses both English and VDM-SL to formally define the semantics (and some notes on the spec process in general): https://freepages.modula2.org/downloads/process2.pdf
- The static semantics file -- static semantics: does it exist?: https://dl.acm.org/doi/pdf/10.1145/987481.987483
- Dangerous Optimizations in C and C++ Programming Languages (discussion on undefined behavior), Robert C. Seacord: https://www.youtube.com/watch?v=2KZgFiciOxY