Short answer: Yes...ish. I wrote a few code generation programs. It can happen, but the Racket program would be dependent on the target language's toolchain and standard library. Before we get to that, note that not all languages cleanly translate into one another (Some scripting languages actually have features that introduce forward-compatibility problems, see JS and with).
The standard library issues become more apparent when you realize that Racket programs have defined value types where other languages don't bother (e.g. complex numbers and path types). If your goal is to generate a few well-defined programs its fine, but if you want a completely correct model for translations with a DSL as a front-end, then that can be a pretty large undertaking. And that's not saying anything about your performance expectations, since Racket's reader/expander probably won't be able to compete with a native compiler. On 6/22/21 10:50 AM, D. Ben Knoble wrote: > No idea if this is what you're looking for, but I have a feeling it wouldn't > be terribly difficult to design a #lang where modules were programs that, > when run, output C# code (kind of like how scribble & pollen can output > HTML). Then you could have a language (w/ or w/o) macros that gets run down > to C# and let the C# compiler and project toolchain take care of the rest? > Essentially it's only a syntax—the semantics is "turn it into this C# code." > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > [https://groups.google.com/d/msgid/racket-users/a70bff98-e143-4c85-bcc9-2d919927764dn%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/a70bff98-e143-4c85-bcc9-2d919927764dn%40googlegroups.com?utm_medium=email&utm_source=footer). -- ~slg -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/81580c35-61e2-cce8-c297-a3e4f61cfca6%40sagegerard.com.