Haven't you considered macros? You could have something like this:
import
my_awesome_DSL_macros
func_declare:
test1(arg: DATA): DATA
func_create:
test2(arg: int): string = do_something(arg)
RunThe `func_declare:` and `func_create:` are macros which take a body of your DSL code, parse it and compile it to whatever you want. Of course, depending on how powerful your DSL is, writing these macros may be as hard as writing a compiler, but that depends on your use case.
