Dmitry Pavlov
unread,May 30, 2019, 6:50:30 AM5/30/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Racket Users
Hello,
Racket is a perfect tool for creating new languages and compilers
for them, everybody knows that.
There is one thing, though, generally available in compilers and
not instantly available in Racket DSL tools (or I just missed it).
How to specify options to the compiler?
Consider a source file `prog.mylang`, a `mylang/lang/reader.rkt`
properly set up, `racket prog.mylang` and `raco make prog.mylang`
working as expected.
Now, suppose I want to pass a specific option to the mylang
implementation when I compile `prog.mylang`, but not as a part
of the program source code or compiler source code.
For instance, "emit logging commands",
or "set external constant N = 100",
or "generate C instead of Racket syntax objects".
How would you recommend I do that?
(Preferably in both DrRacket and command line, but at this
point I will be happy enough with just command line.)
Best regards,
Dmitry