Skip to content

Commit 37e3cdb

Browse files
authored
wip: add description of features (#22)
* wip: add description of features * wip: few more additions * update: finalise * Apply suggestions from code review * Update docs/comparison-matrix.md
1 parent 1f861be commit 37e3cdb

File tree

1 file changed

+91
-23
lines changed

1 file changed

+91
-23
lines changed

docs/comparison-matrix.md

Lines changed: 91 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- markdownlint-disable-file -->
22

3-
# Comparison Matrix
3+
# Comparison Matrix
44

55
Legend:
66

@@ -11,7 +11,7 @@ Legend:
1111
- ❔ Not clear
1212

1313
| **Feature** | **Proto Buffers** | **ADL** | **JSON Schema** | **Lambda Buffers** | **CDDL** | **ASN.1** |
14-
|--------------------------------------------------------+-------------------+--------------+-----------------+--------------------+----------+--------------|
14+
|--------------------------------------------------------|-------------------|--------------|-----------------|--------------------|----------|--------------|
1515
| Sum types | 🟢 | 🟢 | 🔴 | 🟢 | 🟢 | 🟢 |
1616
| Record types | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
1717
| Product types | 🔴 | 🔴 | 🔴 | 🟢 || 🔴 |
@@ -23,47 +23,115 @@ Legend:
2323
| Manage type semantics (at language level) | 🔴 | 🔴 | 🔴 | 🟢 | 🔴 | 🔴 |
2424
| Codegen support | 🟢 (Excellent) | 🟢 (Average) | 🟢 (Excellent) | 🟡 | 🟢 (Bad) | 🟢 (Average) |
2525
| DevOps tooling - build system integration | 🟢 | 🔴 || 🟡 | 🔴 | 🔴 |
26-
| Documentation tooling | 🟢 || 🟢 | 🔵 | 🔴 ||
27-
| Formatting, linting, and development environment tools | 🟢 | 🔴 | 🟢 | 🟢 | 🔴 | 🔴 |
2826
| Documentation tooling | 🟢 | 🔴 | 🟢 | 🔵 | 🔴 ||
27+
| Formatting, linting, and development environment tools | 🟢 | 🔴 | 🟢 | 🟢 | 🔴 | 🔴 |
2928
| Language checker API | 🟢 | 🔴 | 🟢 | 🟢 | 🔴 | 🔴 |
3029
| Codegen API | 🟢 | 🟢 | 🔴 | 🟢 | 🔴 | 🔴 |
3130
| Language specification | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
3231
| Backwards compatibility strategy | 🟢 | 🔴 | 🔴 | 🔴 | 🔴 | 🔴 |
3332

34-
## Features
33+
## Descriptions
3534

36-
### Sum types
35+
### Sum Types
3736

38-
A type that can take on several different forms, also referred to as a *tagged
39-
union* or a *variant* (see https://en.wikipedia.org/wiki/Tagged_union).
37+
Types of the form `Time = Present | Past | Future`, which allow a type do be
38+
constructed by one of many variants. Think Rust's `enums`.
4039

41-
An example sum type definition in Haskell
40+
### Product Types
4241

43-
```haskell
42+
Types of the form `Person = MkPerson Age Name`, where `MkPerson` is of Kind
43+
`Type->Type->Type`. Product types combine multiple elements into one data type
44+
without tagging the elements.
4445

45-
data Either a b = Left a | Right b
46-
```
47-
### Record types
46+
### Record Types
47+
48+
Types of the form `Person = MkPerson { age :: Age, name :: Name }`. Record types
49+
are similar to `structs` in most programming languages.
4850

49-
A record type is essentially a product type where each field is accompanied by a
50-
field name (https://en.wikipedia.org/wiki/Product_type)
51+
### Recursive Types
5152

52-
### Product types
53+
Recursive types are defined by the presence of the LHS type in its RHS
54+
definition. A classic example is:
5355

54-
A product type is a tuple of types.
56+
```text
57+
List a = Nil | Cons a (List a)
58+
^^^^^^ ^^^^^^
59+
```
60+
61+
### Parameterized Types (Generics)
5562

56-
### Recursive types
63+
Type functions allow for the introduction of type variables in the LHS definition
64+
of the term - creating a parametrised type definition. The classic example is
65+
`Maybe a` which is the equivalento of `Option <A>` in rust:
5766

58-
Recursive types are types that are defined in terms of themselves.
67+
```text
68+
Maybe a = Nothing | Just a
69+
```
5970

60-
```haskell
71+
Using the above type definition we can now define another type that uses `Maybe`
72+
and instantiates it to use `Integer`
6173

62-
data List a = Nil | Cons a (List a)
63-
data Tree a = Leaf a | Branch (Tree a) (Tree a)
74+
```text
75+
Time_Saved_via_LambdaBuffers = Maybe Integer
6476
```
6577

66-
## References
78+
### Type Annotations / Constraints
79+
80+
There exists a system of constraining or further annotating types - enriching
81+
the type's specification.
82+
83+
### Add New Built-in Types
84+
85+
Refer to [design document](design.md#extensible-to-new-types).
86+
87+
### Add New Type Semantics
88+
89+
Refer to the [design document](design.md#extensible-to-new-semantics).
90+
91+
### Manage Type Semantics (at Language Level)
92+
93+
Refer to the [design document](design.md#expressive-semantics-annotation)..
94+
95+
### Codegen Support
96+
97+
Codegen support relates to the language being able to generate types for other
98+
programming languages.
99+
100+
### DevOps Tooling - Build System Integration
101+
102+
The framework/language provides a seamless way of integrating with normal build
103+
tools and systems (eg. Bazel, Nix, etc.).
104+
105+
### Documentation Tooling
106+
107+
The language can generate human readable documentation in an easy to share and
108+
view format. For example HTML, or Markdown.
109+
110+
### Formatting, Linting, and Development Environment Tools
111+
112+
Tools that allow formatting, linting, and automating standardisation of the
113+
language specific files.
114+
115+
### Language Checker API
116+
117+
The language checker component exposes an API to interface with itself in a
118+
language agnostic manner.
119+
120+
### Codegen API
121+
122+
The language codegen component exposes an API to interface with itself in a
123+
language agnostic manner.
124+
125+
### Language Specification
126+
127+
There exists a well defined language specification document.
128+
129+
### Backwards Compatibility Strategy
130+
131+
The language makes certain backwards compatibility guarantees between versions of
132+
the same type definition.
133+
134+
## References
67135

68136
- https://json-schema.org/implementations.html
69137
- https://www.rfc-editor.org/rfc/rfc8610

0 commit comments

Comments
 (0)