Type Systems as Macros
lambda-the-ultimate.org
Type Systems as Macros
1–10 of 17 posts
Re: Type Systems as Macros
#2Re: Type Systems as Macros
#3Doesn't Typed Racket work on the same basis?
Re: Type Systems as Macros
#4Re: Type Systems as Macros
#5eli5?
(let* ((f (open "/tmp/foo"))
(result ...))
(close f)
result)
Here, the authors make macros for type annotations, i.e. they take expressions like `(my-value : my-type)`, check whether the types unify correctly, and spit out an untyped expression implementing that value if they do.By using macros, the type system becomes modular: new type system features (subtyping, kinds, etc.) can be written by the programmer as a set of macros, rather than as a whole new language (and all of the work that entails). They test their claim by implementing a bunch of features, combining/reusing them in a bunch of mini languages, and write some semi-plausible programs in these languages, to see if they're realistic.
Re: Type Systems as Macros
#6Doesn't Typed Racket work on the same basis?
Re: Type Systems as Macros
#7The fact that this composes all the way up from simply typed lambda-calculus to F-omega is pretty impressive.
Re: Type Systems as Macros
#8Doesn't Typed Racket work on the same basis?
This is a little more general. They implement a stack of type systems all the way up to F-omega, and they're able reuse and compose the macro libraries to make the more elaborate type checkers. It's pretty impressive.
Re: Type Systems as Macros
#9Earlier quoted context omitted.
This is a little more general. They implement a stack of type systems all the way up to F-omega, and they're able reuse and compose the macro libraries to make the more elaborate type checkers. It's pretty impressive.
Ok, that is rather cool. Could something like this be used to make a better Template Haskell?