Skip to content

using Data and Typeable to get a direct reflection system for free, when we're implementing a toy language in Haskell

Notifications You must be signed in to change notification settings

joom/direct-reflection-for-free

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Direct Reflection for Free!

Documents (TeX, slides etc.) for the work on using Data and Typeable to get a direct reflection system for free, when we're implementing a toy language in Haskell.

Submitted for the ICFP 2019 Student Research Competition, got 3rd prize in the graduate category. [pdf]

This repo still contains a lot of broken code, it will eventually get straightened out, I'm still working on a full paper.

Abstract

Haskell is a popular language for language implementations. However, adding metaprogramming features to a language implemented in Haskell requires a significant amount of boilerplate code. Using Data and Typeable style of generic programming in Haskell, we describe a design pattern that allows automatic derivation of metaprogramming features from your language implementation. If you have evaluation, you can evaluate quasiquoted terms for free. If you have type-checking, you can type-check quasiquoted terms for free. If you have a parser, you can have parser reflection for free. This design pattern is applicable to both untyped and typed languages, and can implement various features of metaprogramming.

Acknowledgments

I'd like to thank Matt Chan and Gabriel Gonzalez for inspiring the idea of a bridge between Haskell and another language.

About

using Data and Typeable to get a direct reflection system for free, when we're implementing a toy language in Haskell

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published