# "Groovy AST Transformer" like feature for Kotlin?

**URL:** <https://discuss.kotlinlang.org/t/groovy-ast-transformer-like-feature-for-kotlin/759>\
**Category:** Uncategorized\
**Created:** [August 18, 2013, 2:31pm UTC](https://discuss.kotlinlang.org/t/groovy-ast-transformer-like-feature-for-kotlin/759 "2013-08-18T14:31:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.h.shams](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/m.h.shams/32/1482_2.png) [@m.h.shams](https://discuss.kotlinlang.org/u/m.h.shams)\
**Post date:** [August 18, 2013, 2:31pm UTC](https://discuss.kotlinlang.org/t/groovy-ast-transformer-like-feature-for-kotlin/759/1 "2013-08-18T14:31:50Z")

</div>

Is there any simple way to manipulate kotlin sources during compile time? Something similar to groovy AST Transformers

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [August 19, 2013, 9:49am UTC](https://discuss.kotlinlang.org/t/groovy-ast-transformer-like-feature-for-kotlin/759/2 "2013-08-19T09:49:14Z")

</div>

We do not provide such an API yet, and I don't think it will ever be as easy as in Groovy.

---

<div class="post-metadata">

**Author:** ![m.h.shams](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/m.h.shams/32/1482_2.png) [@m.h.shams](https://discuss.kotlinlang.org/u/m.h.shams)\
**Post date:** [August 19, 2013, 5:02pm UTC](https://discuss.kotlinlang.org/t/groovy-ast-transformer-like-feature-for-kotlin/759/3 "2013-08-19T17:02:05Z")

</div>

Why is so hard? Is that becuase kotlin is statically typed?

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [August 20, 2013, 7:56am UTC](https://discuss.kotlinlang.org/t/groovy-ast-transformer-like-feature-for-kotlin/759/4 "2013-08-20T07:56:37Z")

</div>

One difference from Groovy is indeed that loading compiler plugins would not be as easy in Kotlin because of its static nature. But despite all and any technicalities I do not think that functionality of this sort should be too easily accessible for non-scripting languages: too many ways to create subtle problems.
