If you are interested in compiler plugins we are a...
# compiler
r
If you are interested in compiler plugins we are almost ready to announce Arrow Meta at the end of November and I thought I’d give you a few links where you can find out what it’s all about and how it works with the compiler. In this video @simon.vergauwen and I go over the Kotlin compiler how Meta allows you to intercept and transform the AST and cooperate in other compiler phases all the way to IDEA plugins. https://twitter.com/arrow_kt/status/1191464548974219264 We have developed a functional api that wraps the compiler subscriptions and allows the user to create compiler plugins built with functions. These functions can be composed to create complex workflows that interact with multiple phases. We are currently working on documenting a great part of the compiler extension points, the Meta internals and high level API’s which you can find mostly in the Kdocs at the moment. A simple Hello World:
Copy code
val Meta.helloWorld: Plugin get() =
    "Hello World" {
      meta(
        func({ name == "helloWorld" }) { c -> 
          Transform.replace(
            replacing = c,
            newDeclaration = """|fun helloWorld(): Unit =
                                |  println("Hello ΛRROW Meta!")
                                |""".function.synthetic
          )
        }
      )
    }
https://github.com/arrow-kt/arrow-meta/blob/master/compiler-plugin/src/main/kotlin/arrow/meta/Meta.kt#L11 Arrow Meta will serve as the base of meta-programming for the Arrow framework to include features regarding the type system such as Union types, Higher Kinds and Type classes and others more related to ergonomics like for comprehensions or polyadic functions. Both Arrow and Meta will eliminate any features that ever get popularity either as a KEEP and make it to the lang or Jetbrains decides to adopt. We strive to be a companion to the std lib with Arrow and to the Compiler with Meta. We hope you can find meta useful to prototype KEEPs and new awesome features for Kotlin or your libraries. #arrow-meta https://twitter.com/arrow_kt/status/1191464548974219264
♥️ 10
👍 5