Compiler Plugin

Open-source projects categorized as Compiler Plugin | Edit details
Language filter: + Haskell + Scala + Kotlin + Coq

Top 19 Compiler Plugin Open-Source Projects

  • GitHub repo Wartremover

    Flexible Scala code linting tool

    Project mention: Newspeak and Domain Modeling | | 2021-06-29

    or `NonUnitStatements` without explicit annotation.

    This effectively locks you into writing pure code (you can extend the linter to cover other things like not using `Future` or not using Java libs outside of `MonadError` from cats[4]). The linters operate on typed ASTs at compile time, and have plugins for the most popular scala build tools. Coupled with `-XFatalWarnings', you can guarantee that nothing unexpected happens unless you explicitly pop the escape hatch, for the most part.

    You can still bring in external libraries that haven't been compiled with these safties in place, so you aren't completely safe, but if you use ZIO[5]/Typelevel[6] libraries you can be reasonably assured of referentially transparent code in practice.

    There are three schools of thought, roughly, in the scala community towards the depth of using the type system and linters to provide guarantees and capabilities, currently:

    1) Don't attempt to do this, it makes the barrier to entry to high for Scala juniors. I don't understand this argument - you want to allow runtime footguns you could easily prevent at compile time because the verifiable techniques take time to learn? Why did you even choose to use a typesafe language and pay the compilation time penalty that comes with it?

    2) Abstract everything to the smallest possible dependency interface, including effects (code to an effect runtime, F[_] that implements the methods your code needs to run - if you handle errors, F implements MonadError, if you output do concurrent things, F implements Concurrent, etc.) and you extend the effect with your own services using tagless final or free.

    3) You still use effect wrappers, but you bind the whole project always to use a concrete effect type, avoiding event abstraction, thus making it easier to code, and limiting footguns to a very particular subset (mainly threadpool providers and unsafeRun or equivalent being called eagerly in the internals of applications).

    My opinion is that smallest interface with effect guarantees (#2) is best for very large, long maintenance window apps where thechoice of effect runtime might change(app), or is out of the devs' control (lib); and #3 is best for small apps.

    TL/DR; You can go a really, really long way to guaranteeing effects don't run in user code in scala. Not all the way like Haskell, but far enough that it's painful to code without conforming to referential transparency.







  • GitHub repo better-monadic-for

    Desugaring scala `for` without implicit `withFilter`s

  • Scout APM

    Scout APM: A developer's best friend. Try free for 14-days. Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.

  • GitHub repo splain

    better implicit errors for scala

    Project mention: Getting Comfortable with Implicits | | 2021-08-24

    In Scala 2.13 and above, there is a compiler switch that will print out the exact implicit you are missing at compile time and why ( Prior to that in scala 2, you need the tek/splain compiler plugin (

  • GitHub repo Arrow Meta

    Functional companion to Kotlin's Compiler

    Project mention: If I wanted to modify the Kotlin grammar, how would I go about doing that? | | 2021-05-01

    As of right now, Arrow Meta is the only library I am aware of with which you can productively write compiler plugins.

  • GitHub repo Linter

    Static Analysis Compiler Plugin for Scala (by HairyFotr)

  • GitHub repo MpApt

    :wrench: Kotlin Native/JS/JVM Annotation Processor library for Kotlin compiler plugins

    Project mention: Examples of third party compiler plugins | | 2021-01-11

    KVision uses compiler plugin: based on library.

  • GitHub repo Dsl.scala

    A framework to create embedded Domain-Specific Languages in Scala

  • Nanos

    Run Linux Software Faster and Safer than Linux with Unikernels.

  • GitHub repo inspection-testing

    Inspection Testing for Haskell

    Project mention: [ANN] core-warn: A package for detecting unexpected Core output! | | 2021-10-23

    Haven't tried it but afaik related: inspection-testing should allow you to assert various properties about the generated core.

  • GitHub repo ghc-proofs

    Let GHC prove program equations for you

  • GitHub repo NoCopy Compiler Plugin

    A Kotlin compiler plugin that removes the `copy` method of data classes.

    Project mention: Assuming the data class's generated copy() is unacceptable, what's the best way to implement a value type? | | 2021-09-03

    Using this compiler plugin library:

  • GitHub repo injekt

    Next gen DI framework powered by a Kotlin compiler plugin [WIP] (by IVIanuu)

    Project mention: Here is an article about my DI library for Kotlin Mutliplatform | | 2021-11-19

    Similar effort that's a bit more fleshed out:

  • GitHub repo scala-escape

    A compiler plug-in to control object lifetimes in Scala (by TiarkRompf)

  • GitHub repo ghc-clippy-plugin

    A helpful companion to GHC. Overrides GHC messages, to the user's liking.

  • GitHub repo smuggler2

    Minimise haskell imports, make exports explicit

  • GitHub repo const-math-ghc-plugin

    GHC plugin for constant math elimination

  • GitHub repo haskell-stack-trace-plugin

  • GitHub repo singletons-presburger

    Presburger arithmetic solver for built-in type-level naturals

  • GitHub repo BinderAnn

    BinderAnn: Automated Reification of Source Annotations for Monadic EDSLs

  • GitHub repo ghc-plugs-out

    Type checker plugins without the type checking. (by BlockScope)

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2021-11-19.

Compiler Plugin related posts


What are some of the best open-source Compiler Plugin projects? This list will help you:

Project Stars
1 Wartremover 982
2 better-monadic-for 649
3 splain 365
4 Arrow Meta 292
5 Linter 270
6 MpApt 231
7 Dsl.scala 229
8 inspection-testing 166
9 ghc-proofs 145
10 NoCopy Compiler Plugin 113
11 injekt 76
12 scala-escape 61
13 ghc-clippy-plugin 33
14 smuggler2 16
15 const-math-ghc-plugin 15
16 haskell-stack-trace-plugin 6
17 singletons-presburger 5
18 BinderAnn 3
19 ghc-plugs-out 2
Find remote jobs at our new job board There are 34 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives