1
1
<!-- markdownlint-disable-file -->
2
2
3
- # Comparison Matrix
3
+ # Comparison Matrix
4
4
5
5
Legend:
6
6
@@ -11,7 +11,7 @@ Legend:
11
11
- ❔ Not clear
12
12
13
13
| ** Feature** | ** Proto Buffers** | ** ADL** | ** JSON Schema** | ** Lambda Buffers** | ** CDDL** | ** ASN.1** |
14
- | --------------------------------------------------------+ -------------------+ --------------+ -----------------+ --------------------+ ----------+ --------------|
14
+ | --------------------------------------------------------| -------------------| --------------| -----------------| --------------------| ----------| --------------|
15
15
| Sum types | 🟢 | 🟢 | 🔴 | 🟢 | 🟢 | 🟢 |
16
16
| Record types | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
17
17
| Product types | 🔴 | 🔴 | 🔴 | 🟢 | ❔ | 🔴 |
@@ -23,47 +23,115 @@ Legend:
23
23
| Manage type semantics (at language level) | 🔴 | 🔴 | 🔴 | 🟢 | 🔴 | 🔴 |
24
24
| Codegen support | 🟢 (Excellent) | 🟢 (Average) | 🟢 (Excellent) | 🟡 | 🟢 (Bad) | 🟢 (Average) |
25
25
| DevOps tooling - build system integration | 🟢 | 🔴 | ❔ | 🟡 | 🔴 | 🔴 |
26
- | Documentation tooling | 🟢 | ❔ | 🟢 | 🔵 | 🔴 | ❔ |
27
- | Formatting, linting, and development environment tools | 🟢 | 🔴 | 🟢 | 🟢 | 🔴 | 🔴 |
28
26
| Documentation tooling | 🟢 | 🔴 | 🟢 | 🔵 | 🔴 | ❔ |
27
+ | Formatting, linting, and development environment tools | 🟢 | 🔴 | 🟢 | 🟢 | 🔴 | 🔴 |
29
28
| Language checker API | 🟢 | 🔴 | 🟢 | 🟢 | 🔴 | 🔴 |
30
29
| Codegen API | 🟢 | 🟢 | 🔴 | 🟢 | 🔴 | 🔴 |
31
30
| Language specification | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
32
31
| Backwards compatibility strategy | 🟢 | 🔴 | 🔴 | 🔴 | 🔴 | 🔴 |
33
32
34
- ## Features
33
+ ## Descriptions
35
34
36
- ### Sum types
35
+ ### Sum Types
37
36
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 ` .
40
39
41
- An example sum type definition in Haskell
40
+ ### Product Types
42
41
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.
44
45
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.
48
50
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
51
52
52
- ### Product types
53
+ Recursive types are defined by the presence of the LHS type in its RHS
54
+ definition. A classic example is:
53
55
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)
55
62
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:
57
66
58
- Recursive types are types that are defined in terms of themselves.
67
+ ``` text
68
+ Maybe a = Nothing | Just a
69
+ ```
59
70
60
- ```haskell
71
+ Using the above type definition we can now define another type that uses ` Maybe `
72
+ and instantiates it to use ` Integer `
61
73
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
64
76
```
65
77
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
67
135
68
136
- https://json-schema.org/implementations.html
69
137
- https://www.rfc-editor.org/rfc/rfc8610
0 commit comments