We'll be working on a tree-sitter grammar on this PR on Kindelia/Kind2.
- Whitespace independent
- Context-free
- Simple and efficient parser
- (thus LR1)
- Readability
- Familiar syntax when possible
- Kind 1
- Rust
- Typescript
- ML-like
TODO: discuss options.
- A.
<>
convey implicitness and tag to convey erasedness - B.
<>
for both and{}
for implicit - C.
<>
for both (+ tags)
Implicit parameter: <x: T>
.
Erased parameter alternatives:
1. (-x: T) | <-x: T>
2. (~x: T) | <~x: T>
3. (#x: T) | <#x: T>
Very orthogonal. Kinda ugly.
(x: A) ... normal
(-x: A) ... erased
{x: A} ... implicit
<x: A> ... implicit & erased
I don't like how this creates 4 different syntaxes for a parameter while we could have only 2.
Default on ()
is non-erased.
Default on <>
is erased.
So we need a tag to convey both erasedness and non-erasedness:
(x: A) ... normal
(-x: A) ... erased
<+x: A> ... implicit
<x: A> ... implicit & erased
Still orthogonal and less ugly. +
and -
tags have naturally oppossite semantics so I'll non-ironically defend this option.