(reposted from <#C0B8MA7FA|getting-started>, as wa...
# announcements
a
(reposted from #getting-started, as was suggested on that channel) hi. I am new to Kotlin and currently I am trying to use it for my university bachelor thesis project. Part of this project is implementation of a simple language/compiler. (for JVM, I am using ANTLR for lexer/parser and planning to use ASM library for bytecode output) I am looking for good/idiomatic examples and tips related to AST implementation. So far I found one tutorial https://github.com/ftomassetti/LangSandbox/blob/master/src/main/kotlin/me/tomassetti/sandy/ast/Model.kt#L79 with data classes and interfaces. It looks interesting, but I am not sure if it's the best way. For me it looks a bit weird because of interfaces we have to use extension functions for everything. At first I thought that it would be better to use abstract classes, but then I found out that then I will not be able to use data classes and will have to implement `equals`/`hashCode` for all nodes manually. Though I am not sure if I really need
equals
in AST nodes. One reason is for tests (https://github.com/ftomassetti/LangSandbox/blob/master/src/test/kotlin/me/tomassetti/sandy/ast/MappingTest.kt), but maybe there are other good ways to test it...