Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain the limits of the type system #228

Open
gelisam opened this issue Jan 31, 2024 · 1 comment
Open

explain the limits of the type system #228

gelisam opened this issue Jan 31, 2024 · 1 comment
Labels
discussion documentation Improvements or additions to documentation examples Ideas for cool things to implement in Klister to show off the language

Comments

@gelisam
Copy link
Owner

gelisam commented Jan 31, 2024

I no longer like this part of our README:

The variety of type-systems which can be implemented this way is unforunately limited by the core type system to which everything must be rewritten.

because it is not at all clear how big of a limitation this is. I think it would be helpful to list some examples of type systems which can be implemented in Klister and some examples which can't. And of course, for those which can be implemented, it would be nice to eventually implement it and link to that implementation.

@gelisam gelisam added documentation Improvements or additions to documentation discussion examples Ideas for cool things to implement in Klister to show off the language labels Jan 31, 2024
@gelisam
Copy link
Owner Author

gelisam commented Jan 31, 2024

So far, the only example of a custom type system we have is Scala-style implicit conversions.

Other fancy type systems which come to mind are:

  • linear types: maybe we can use a type-driven macro to determine which variables need to only occur once, and then have that macro traverse the body to verify that the identifier only occurs once?
  • session types. we don't have threads, but maybe we can still check that a do block performs actions in the correct order?
  • modal type theory: the big feature is a (Box Integer), meaning an expression of type Integer which does not capture any of the surrounding variables. I think Klister should be able to handle that by messing with the scope-sets of those variables.
  • contextual modal type theory: the big feature is (Box [(x Integer)] Integer), meaning an expression which does not capture any of the surrounding variables but does have access to a variable x of type Integer. Introducing that x via a lambda or something seems easy enough, but our types are not expressive enough to store symbols, currently they can only store other types and type constructors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion documentation Improvements or additions to documentation examples Ideas for cool things to implement in Klister to show off the language
Projects
None yet
Development

No branches or pull requests

1 participant