On Sun, 4 Sept 2022 at 10:31, Reuben Thomas <[email protected]> wrote:

> On Sun, 4 Sept 2022 at 04:13, Philip McGrath <[email protected]>
> wrote:
>
>>
>> However, in some cases you might really want a program other than
>> `racket` as the entry point for your language: for instance, maybe you want
>> to have flags for controlling where the output goes. One example of such a
>> program is the `scribble` executable included in the main Racket
>> distribution. The implementation is in <
>> https://github.com/racket/scribble/blob/master/scribble-lib/scribble/run.rkt>,
>> and the associated "info.rkt" file (<
>> https://github.com/racket/scribble/blob/master/scribble-lib/scribble/info.rkt>)
>> arranges for `raco setup` to create a `scribble` to run it. (This example
>> uses the old mzscheme-launcher-names/mzscheme-launcher-libraries instead of
>> the newer racket-launcher-names/racket-launcher-libraries: see
>> documentation at <
>> https://docs.racket-lang.org/raco/setup-info.html#%28idx._%28gentag._18._%28lib._scribblings%2Fraco%2Fraco..scrbl%29%29%29
>> >.)
>>
>
> Thanks for the pointer.
>
>
>> It is possible to use Racket to implement languages that don't use #lang,
>> but you would loose many advantages like IDE support and well-defined
>> separate compilation, and you would need to use some fairly low-level
>> mechanisms. Unless there is a hard requirement, I'd recommend that you just
>> use #lang in your programs.
>
>
> I'm trying to write a standalone assembler (nothing to do with Racket), so
> I'm happy to lose this advantage!
>

OK, I've had another look, and I still can't see how to do this, so I would
appreciate a hint. I have updated my repo to add a launcher script, but
again this only works with files that have a #lang line. As I said before,
I have worked out how to parse a file without a #lang line (just pass it to
my language's read-syntax), but I can't work out how to turn that into a
module and execute it. I guess I need something like dynamic-require that
takes a syntax-object and an expander module or #%begin-module macro as
arguments?

-- 
https://rrt.sc3d.org

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAOnWdojuQbYuUAkGmN-thwSzq4iEyV%2BA20QzEj1FxUgoRKr5CA%40mail.gmail.com.

Reply via email to