zydeco-lang / zydeco

a proof-of-concept programming language based on Call-by-push-value
Other
49 stars 3 forks source link

Stop disambiguating type parameters from term parameters by capitals #40

Closed LighghtEeloo closed 7 months ago

LighghtEeloo commented 1 year ago

The current implementation of Zydeco relies on an identifier starting with either uppercase or lowercase to decide whether the parameter lies in type level or term level. It works for now, but since we may want to try out a dependent type system sometime, this is an awful choice because we'll be mixing types and terms, and we shouldn't have assumptions only by the name.

I would suggest using [x] as an indicator of a parameter being a type parameter, in which case both x and (x) will mean term parameters. In addition, the brackets and parentheses support annotation.

LighghtEeloo commented 1 year ago

With the idea of type-guided elaboration, the proposed brackets are no longer necessary; we just need a better elaborator. As for implementation, now the new zydeco-surface crate can parse variables regardless of what sort it is, with the downside of having to disambiguate data constructors from variables, since the variables can now be capitalized.

LighghtEeloo commented 7 months ago

Addressed in the new parser.