News for hackers. Stuff that matters.
Re:Type Systems as Macros by moomin on Friday April 21, 2017 @06:45PM (#14170027)
Doesn't Typed Racket work on the same basis?
Re:Type Systems as Macros by naasking on Friday April 21, 2017 @07:20PM (#14170209)
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 by moomin on Saturday April 22, 2017 @06:59AM (#14171964)
Ok, that is rather cool. Could something like this be used to make a better Template Haskell?
Re:Type Systems as Macros by nonsince on Saturday April 22, 2017 @10:27AM (#14172667)
Someone's working on something like that already https://github.com/lexi-lambda/hackett
Re:Type Systems as Macros by naasking on Saturday April 22, 2017 @10:43AM (#14172751)
Awesome! Nice find.
Re:Type Systems as Macros by notjack on Saturday April 22, 2017 @03:38AM (#14171550)
Typed Racket runs after macro expansion, performing analysis on fully-expanded code. This technique runs as part of macro expansion, rather than after. The upshot is that macros get to use and generate type information, so language and type system features like typeclasses or GADTs can be library-provided macros.
Re:Type Systems as Macros by stchang on Wednesday April 26, 2017 @10:13AM (#14203104)
Typed Racket uses macro expansion to translate its typed surface language into a typed core language, and then typechecks the core language.

Our approach uses macro expansion to typecheck the surface language and translates it into an untyped core language.

The two approaches should be considered alternative tools in a programmer's toolbox.