Document justification for null

This commit is contained in:
Ruud van Asseldonk 2023-09-08 20:03:36 +02:00
parent e8fa49b4cf
commit 3a0ff14f30
3 changed files with 23 additions and 7 deletions

15
docs/null.md Normal file
View file

@ -0,0 +1,15 @@
# Null
> I call it my billion-dollar mistake. It was the invention of the null
> reference in 1965. — Tony Hoare
One of the intended use cases of RCL is to be an abstraction layer for formats
with no or poor abstraction abilities, such as json and yaml. Many tools take
input in such format, and it is not up to RCL to make demands about the schema
of that data. RCL _has_ to provide a way to emit `null`.
Fortunately, the problems commonly attributed to null are not problems with
having a null value per se, they are problems with implicit nullability, which
RCL does not have. `null` is the sole value of type `Null`, which is distinct
from and does not unify with other types. In this sense, null behaves like the
unit type in languages such as Haskell and Rust (written `()` there).

@ -1 +1 @@
Subproject commit 3fe234a38b38ad6823370cc11c781516cb4de94c
Subproject commit 7d3f15554d5184d24eabc0beadc045dfc431de58

View file

@ -14,9 +14,10 @@ markdown_extensions:
permalink_title: null
nav:
- Overview: index.md
- User guide:
- Terminology: terminology.md
- Syntax: syntax.md
- Strings: strings.md
- Development: development.md
- "Overview": "index.md"
- "User guide":
- "Terminology": "terminology.md"
- "Syntax": "syntax.md"
- "Strings": "strings.md"
- "Null": "null.md"
- "Development": "development.md"