You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an annotated EBNF grammar of the latest rewrite of Kitten. Items marked with a dagger (†) are explained in the surrounding prose, not in EBNF.
Source Locations
The source column of a token is the offset to its first character within the line in which it appears. The indentation of a line is the source column of the first token in the line. Tab characters are illegal.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An expression beginning with a left arrow (<-) inside a do block statement is desugared to a monadic binding. This is syntactically a superset of existing Haskell, including extensions. It admits a clean notation that subsumes existing patterns and comes with few downsides.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Strongly Typed Typechecker for Simply Typed Lambda Calculus in Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a list of notations and semantics I’ve wanted to use or have used in toy programming languages that I think are particularly nice but rare, and that I’d like to see in more languages. If you’re a PL dev and you fall in love with one, adopt it and let me know!
Unary Relational Range Operators
Most languages use the standard relational operators for comparisons (>, <, ≥/>=, ≤/<=/=<, =/==/===, ≠/!=//=/<>), but these are almost always presented as binary operators for comparing two values. Some languages (of which Python is the most notable) include “chained” comparisons like a <= b < c, meaning a <= b and b < c (but with b only evaluated for its side effects once, that is, (lambda x: a <= x and x < c)(b)). Some languages also allow unary versions of these operators, but they rarely denote anything related to comparisons. Some languages such as Haskell allow arguments to be omitted from operators via operator sections, denot