Also, if you want to implement a compiler, and not an interpreter, the host language having GC is not very useful to get GC.
Haskell is going to make working with ASTs much easier and safer. It also has a superset of the concurrency features of Go.
Well, not that small, i guess :-)
http://blog.labix.org/2013/07/16/twik-a-tiny-language-for-go
Also, the type-switch on interface {} is ugly.
Consider how an AST looks like in Haskell:
data AST
= LiteralInt Int
| LiteralFloat Float
| List [AST]
...
And then an eval looks like: case ast of
LiteralInt int -> ...
LiteralFloat float -> ...
List nodes -> ...
and it is safe, rather than interface{}, you get the AST type and you get exhaustiveness checking that you covered all cases.Also, if you add an annotation to each AST element (e.g: inferred types), you can very easily and safely map over them, etc.
You also don't have the ability to write a GC-less language, because there is no practical way to write non-GCed Go code.
>you can incorporate a few nice concurrency features with little effort
You also can't implement any custom OS-level concurrency features.
True, so you probably don't want to do that.
You also can't implement any custom OS-level concurrency features.
True. But for "journeyman" level language implementation, the toolset is quite good.
No, you really don't. The built-in GC is nothing like the GC needed for lots of other languages.
Don't write those languages in Go.
Not to mention that to use the GC, you'd have to carry the whole baggage of Go's runtime with you in the new language. And that's Go's GC is not that good in the first place.