Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Gestalt Build Status

An experiment and tutorial on how to create a solid and portable macros system based on solid methodology and principles.

Design Goals:

  • Portable -- better IDE experience, works both in Scala and Dotty
  • Solid -- friendly typing error instead of compiler crashes or hacks
  • Friendly -- no knowledge about compiler internals, no dependent universes

Examples

import scala.gestalt._

object Test {
  def plus(a: Int, b: Int): Int = meta {
    q"$a + $b"
  }
}

Design

  • Only blackbox macros
  • Separation of typed and untyped trees
  • Only inspection of typed trees
  • Only semantic information for typed trees

Philosophy

The design space of a macro system is large. Gestalt aims to be simple, solid and portable for the 80% common use cases.

a ) Assumptions on compiler implementation

  • more assumptions
  • fewer assumptions (✓) : portability & easy implementation

b ) Assumptions on macro usage

  • more assumptions (✓) : focus on 80% common cases, make them easy
  • fewer assumptions

c) Features

  • more features
  • fewer features (✓) : metaprogramming is hard, restrict power, implementation solid

Test

  • sbt macros/test:run

Paper

Gestalt : The Road for Lightweight Portable Macros

About

gestalt : portable and solid macros for Scala

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.