This page is no longer maintained — Please continue to the home page at www.scala-lang.org

reports on writing compiler plugins

2 replies
Miguel Garcia
Joined: 2009-06-10,
User offline. Last seen 42 years 45 weeks ago.
  Hi,
In the course of diving into the source of scalac I've gathered links to documents by other survivors who report what they've learnt. I haven't found any catalog on this topic so it would be great if we could set it up ourselves.  
(1) nsc hacker Tutorial
    http://lamp.epfl.ch/~emir/bqbase/2005/06/02/nscTutorial.html   (2) Dubochet, G. and Odersky, M. (2009)
    Compiling structural types on the JVM: a comparison of reflective and generative techniques from Scala's perspective.
    4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, pp. 34-41.
    http://infoscience.epfl.ch/record/138931   (3) on the same vein as the above,
    Sander Sõnajalg,
    Towards a Fast Dynamic Invocation in the Scala Language, Master's thesis, 2009,
    http://www.ekabanov.net/s6najalg-master-thesis.pdf   (4) Valentin Wüstholz
    Encoding Scala Programs for the Boogie Verifier
    Master's thesis at the Chair of Programming Methodology, ETH, Zürich
    http://www.pm.inf.ethz.ch/education/theses/student_docs/Valentin_Wuestho...   (5) Manfred Stock
    Implementing a Universe Type System for Scala
    Master's thesis at the Chair of Programming Methodology, ETH, Zürich
    http://www.pm.inf.ethz.ch/education/theses/student_docs/Manfred_Stock/Ma...   (6) Daniel Schregenberger
    Universe Type System for Scala
    Master's thesis at the Chair of Programming Methodology, ETH, Zürich
    http://www.pm.inf.ethz.ch/education/theses/student_docs/Daniel_Schregenb...   (7) Mirco Dotta
    Static Analysis for Expressive Pattern Matching
    http://scalapatterns.googlecode.com/svn/matcheck/trunk/paper.pdf   (8) Miguel Garcia, Anastasia Izmaylova
    Extending Scala with database query capability
    Institute for Software Systems (STS), E-16, Technische Universitaet Hamburg-Harburg. Germany
    http://www.sts.tu-harburg.de/people/mi.garcia/ScalaQL/  
There's already a good deal of contributions out there, and I'm sure I've missed several others. Don't hesitate to add the links you know about!  
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia      
Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: reports on writing compiler plugins
I've done  a few minor compiler plugins, the only one of note is the one for writing Maven Mojo's in Scala  (http://github.com/jsuereth/scala-mojo-support).   I wrote this example plugin based on what I had learned (although making it not read-only was a mistake on my part, not quite ready for the pressure ;) ) - http://suereth.blogspot.com/2009/02/levaraging-annotations-in-scala-part-2.html.  The sample plugin does work, however the visibility is not enforced in the current compilation, but in the classfile...

- Josh

On Fri, Nov 6, 2009 at 5:49 AM, Miguel Garcia <miguel.garcia@tuhh.de> wrote:
  Hi,
In the course of diving into the source of scalac I've gathered links to documents by other survivors who report what they've learnt. I haven't found any catalog on this topic so it would be great if we could set it up ourselves.  
(1) nsc hacker Tutorial
    http://lamp.epfl.ch/~emir/bqbase/2005/06/02/nscTutorial.html   (2) Dubochet, G. and Odersky, M. (2009)
    Compiling structural types on the JVM: a comparison of reflective and generative techniques from Scala's perspective.
    4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, pp. 34-41.
    http://infoscience.epfl.ch/record/138931   (3) on the same vein as the above,
    Sander Sõnajalg,
    Towards a Fast Dynamic Invocation in the Scala Language, Master's thesis, 2009,
    http://www.ekabanov.net/s6najalg-master-thesis.pdf   (4) Valentin Wüstholz
    Encoding Scala Programs for the Boogie Verifier
    Master's thesis at the Chair of Programming Methodology, ETH, Zürich
    http://www.pm.inf.ethz.ch/education/theses/student_docs/Valentin_Wuestholz/MA_report.pdf   (5) Manfred Stock
    Implementing a Universe Type System for Scala
    Master's thesis at the Chair of Programming Methodology, ETH, Zürich
    http://www.pm.inf.ethz.ch/education/theses/student_docs/Manfred_Stock/Manfred_Stock_MA_paper.pdf   (6) Daniel Schregenberger
    Universe Type System for Scala
    Master's thesis at the Chair of Programming Methodology, ETH, Zürich
    http://www.pm.inf.ethz.ch/education/theses/student_docs/Daniel_Schregenberger/Daniel_Schregenberger_MA_paper.pdf   (7) Mirco Dotta
    Static Analysis for Expressive Pattern Matching
    http://scalapatterns.googlecode.com/svn/matcheck/trunk/paper.pdf   (8) Miguel Garcia, Anastasia Izmaylova
    Extending Scala with database query capability
    Institute for Software Systems (STS), E-16, Technische Universitaet Hamburg-Harburg. Germany
    http://www.sts.tu-harburg.de/people/mi.garcia/ScalaQL/  
There's already a good deal of contributions out there, and I'm sure I've missed several others. Don't hesitate to add the links you know about!  
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia      

Kevin Wright
Joined: 2009-06-09,
User offline. Last seen 49 weeks 3 days ago.
Re: reports on writing compiler plugins

Nicely done that man!

I think that the knowledge required to write these plugins could well
be one of the darkest arts in the scala universe. Many heartfelt
congratulations heading your way and at least one beer if ever you
set foot within the the UK.

On Fri, Nov 6, 2009 at 12:06 PM, Josh Suereth wrote:
> I've done  a few minor compiler plugins, the only one of note is the one for
> writing Maven Mojo's in Scala
> (http://github.com/jsuereth/scala-mojo-support).   I wrote this example
> plugin based on what I had learned (although making it not read-only was a
> mistake on my part, not quite ready for the pressure ;) ) -
> http://suereth.blogspot.com/2009/02/levaraging-annotations-in-scala-part....
> The sample plugin does work, however the visibility is not enforced in the
> current compilation, but in the classfile...
>
> - Josh
>
> On Fri, Nov 6, 2009 at 5:49 AM, Miguel Garcia wrote:
>>
>>
>> Hi,
>> In the course of diving into the source of scalac I've gathered links to
>> documents by other survivors who report what they've learnt. I haven't found
>> any catalog on this topic so it would be great if we could set it up
>> ourselves.
>>
>> (1) nsc hacker Tutorial
>>     http://lamp.epfl.ch/~emir/bqbase/2005/06/02/nscTutorial.html
>>
>> (2) Dubochet, G. and Odersky, M. (2009)
>>     Compiling structural types on the JVM: a comparison of reflective and
>> generative techniques from Scala's perspective.
>>     4th workshop on the Implementation, Compilation, Optimization of
>> Object-Oriented Languages and Programming Systems, pp. 34-41.
>>     http://infoscience.epfl.ch/record/138931
>>
>> (3) on the same vein as the above,
>>     Sander Sõnajalg,
>>     Towards a Fast Dynamic Invocation in the Scala Language, Master's
>> thesis, 2009,
>>     http://www.ekabanov.net/s6najalg-master-thesis.pdf
>>
>> (4) Valentin Wüstholz
>>     Encoding Scala Programs for the Boogie Verifier
>>     Master's thesis at the Chair of Programming Methodology, ETH, Zürich
>>
>> http://www.pm.inf.ethz.ch/education/theses/student_docs/Valentin_Wuestho...
>>
>> (5) Manfred Stock
>>     Implementing a Universe Type System for Scala
>>     Master's thesis at the Chair of Programming Methodology, ETH, Zürich
>>
>> http://www.pm.inf.ethz.ch/education/theses/student_docs/Manfred_Stock/Ma...
>>
>> (6) Daniel Schregenberger
>>     Universe Type System for Scala
>>     Master's thesis at the Chair of Programming Methodology, ETH, Zürich
>>
>> http://www.pm.inf.ethz.ch/education/theses/student_docs/Daniel_Schregenb...
>>
>> (7) Mirco Dotta
>>     Static Analysis for Expressive Pattern Matching
>>     http://scalapatterns.googlecode.com/svn/matcheck/trunk/paper.pdf
>>
>> (8) Miguel Garcia, Anastasia Izmaylova
>>     Extending Scala with database query capability
>>     Institute for Software Systems (STS), E-16, Technische Universitaet
>> Hamburg-Harburg. Germany
>>     http://www.sts.tu-harburg.de/people/mi.garcia/ScalaQL/
>>
>> There's already a good deal of contributions out there, and I'm sure I've
>> missed several others. Don't hesitate to add the links you know about!
>>
>> Miguel
>> http://www.sts.tu-harburg.de/people/mi.garcia
>>
>>
>>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland