I have no plans to work on this, but I am curious if this has been discussed or attempted...
Motivation: My job has been C# for many years and while C# is very appropriate for most of the problems I encounter at work, sometimes a problem comes along that makes me want more power. In those situations, I think the language I want is "C# except now it's S-expressions and it has Racket's macro system." And then I wonder if an alternate version of C# could be implemented this way: 1) Create a new grammar for what a fully-expanded C# AST is. This will be in terms of Racket syntax objects, just like Racket's definition of a Fully Expanded Program. 2) Write a compiler that generates CIL (the bytecode) given a fully-expanded C# AST. 3) Use Racket's #lang mechanism and macro system to implement the surface language. Now this new C# could borrow a lot of power from Racket, right? For example, I could make all of Racket available during expansion! Even if I don't want C#-the-surface-language to have macros at all, why shouldn't I keep the Racket-powered backdoor open? As long as you generate a valid C# AST, I should be able to compile it for you. The #lang mechanism and Scribble are two other nice things that could probably be adapted into the new C# if desired. I can understand why Microsoft wouldn't do this. But I've seen enough hobby languages, and I'm surprised that none of them do this. Reusing a backend (like dotnet or the JVM) is common, reusing a "frontend" is something I've never seen. Is Racket's macro system too specific to Racket's definition of a fully-expanded program? (The little bit I've done with local-expand and stop-ids makes me think it would work fine.) Is there something else that would make this approach more trouble than it's worth? -- 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/cc7c1792-ba59-400f-856a-3bb02a6096fbn%40googlegroups.com.