On Tuesday, July 25, 2017 at 5:52:45 PM UTC-4, Shu-Hung You wrote:> 
> As we can see, 
> `scheme_namespace_require(scheme_intern_symbol("racket/base"));`
> is actually missing from your setup program. This line requires racket
> base and the usual #%app bindings. It's probably needed even if you're
> loading your own DSL -- I suspect at some point racket/base will
> install the right `load` function to make things work, and that this
> will also affect loading custom #langs.

You appear to be correct, but it strikes me as really odd that 
(a) In a language which prides itself on metaprogramming, the interpreter 
namespace needs to be manually bootstrapped with a specific module.
(b) That the form the error takes is not an error with the requires/provides in 
the `main.rkt` for my #lang, but as an error in a module which is using it.
This code:
|#lang racket
|(require "Value-Forms.rkt"
|         "Operator-Forms.rkt"
|         "Variable-Forms.rkt")
|
|(provide
| #%module-begin
| #%top-interaction
| #%datum
| #%app
| (all-from-out "Value-Forms.rkt"
|               "Operator-Forms.rkt"
|               "Variable-Forms.rkt"))
Should definitely complain if its imports aren't available.


> * Dependencies for main.rkt and lang/reader.rkt: I don't think there's
> a conflict. The dependencies seem to refer to `require`s, like
> racket/base -> racket/list, racket/...

Relatedly, even if `main.rkt` and `lang/reader.rkt` are independent, it's 
really odd that my module beginning with `#lang racket` is insufficient for 
raco to pick up the racket dependencies.

> * load: instead of using load, I would probably try to implement a
> function in Racket that use `dynamic-require` to load other DSL
> scripts. Then in the C part, we can `dynamic-require` that function to
> load argv[1]. Of course, remember to add that module in raco ctool. An
> example is given in load-file.rkt and call_racket_from_load.cpp in the
> link.
> 
> I am not familiar with this; there could be a better way to
> dynamically load a file.
> 

Thanks, I'll think some more about this.

> # Commands:
> $ raco ctool --c-mods base.c ++lib racket/base ++lib
> racket/base/lang/reader ++lib racket/runtime-config

This appears to be precisely the necessary set of minimum ++libs. It *really* 
ought to be documented somewhere, in big bold letters.


Thanks for the help!

~Thomas

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to