
On Fri, May 21, 2021 at 9:38 PM Arun Sharma <arun@sharma-home.net> wrote:
+1 for static type checking and avoiding inheritance in the syntax.
My interest comes from working on transpiling python, including sealed classes to other statically typed languages.
I've used syntax such as this in one of my earlier projects with good success:
``` @sealed class Node: EXPRESSION = Expression STATEMENT = Statement
@sealed class Expression: NAME = Name OPERATION = Operation
@sealed class Statement: ASSIGNMENT = Assignment ```
A variant of this syntax and a proof of concept implementation built on top of adt [1] library: https://bit.ly/3upzGSc The upstream ADT library has some mypy plugins. Would be great if other type checkers supported something like this out of the box. -Arun [1] https://github.com/jspahrsummers/adt