Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Reports, Documentation, and Standards
  4. Proof of Multi-Stage Programming with Generative and Analytical Macros
 
report

Proof of Multi-Stage Programming with Generative and Analytical Macros

Stucki, Nicolas Alexander  
•
Brachthäuser, Jonathan Immanuel  
•
Odersky, Martin  
September 22, 2021

In metaprogramming, code generation and code analysis are complementary. Traditionally, principled metaprogramming extensions for programming languages, like MetaML and BER MetaOCaml, offer strong foundations for code generation but lack equivalent support for code analysis. Similarly, existing macro systems are biased towards the code generation aspect. In this work, we present a calculus for macros featuring both code generation and code analysis. The calculus directly models separate compilation of macros, internalizing a commonly neglected aspect of macros. The system ensures that the generated code is well-typed and hygienic. We implement our system in Scala 3, provide a formalization, and prove its soundness.

  • Files
  • Details
  • Metrics
Type
report
Author(s)
Stucki, Nicolas Alexander  
Brachthäuser, Jonathan Immanuel  
Odersky, Martin  
Date Issued

2021-09-22

Publisher

EPFL

Total of pages

20

Subjects

multi-stage programming

•

metaprogramming

•

macro systems

•

formalization

Editorial or Peer reviewed

NON-REVIEWED

Written at

EPFL

EPFL units
LAMP1  
RelationURL/DOI

IsVariantFormOf

https://doi.org/10.1145/3486609.3487203
Available on Infoscience
September 22, 2021
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/181543
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés