
@mflatt. I am trying to export some functions and a macro from chez to racket, but I am getting unbound identifier errors. I exported these functions from core.sls but I am guessing that is not sufficient. What additional steps am I missing?

Functions have to be added to one of the primitive instances implemented in the “primitive” directory. Depending on which primitive instance and whether a Racket module re-exports all exports of a primitive instance, you may also need to add an export in some Racket module. Macros are trouble, and it’s best to just not do that; implement the macro in a Racket library, if possible.

ok thanks

Just in case: if you have built ".zo"s via Chez Scheme using make setup
, then previous compilations of re-exporting modules will generally not export a newly added name in a primitive instance; the compiled form of a module normally has a list of re-exports determined at compile time, so you’ll need to throw away old ".zo"s to get the newly added name re-exported

@mflatt >Depending on which primitive instance and whether a Racket module re-exports all exports of a primitive instance, you may also need to add an export in some Racket module.
How do I add an export to a racket module?

I mean a racket module that I did not write. futures for instance

never mind i think i found the “module”

“racket7/racket/collects/racket/future.rkt” is the source of racket/future

I think I just need to rebuild racket again

is that what you found?

yes that is what i found

ok, good

If I wanted to create my own module isntead of exporting something through futures, would I just add a file to that directory and follow the same pattern as futures?

No. The macro expander has to turn primitive instances into primitive modules, so the macro expander would have to change to work with a new primitive instance.

The problem we’re running into is that building Racket doesn’t work because previously built versions of Racket (such as the C-implemented runtime) don’t have the new exports

(also the already-built chez code)

Do we need to implement the additional primitives in C as well?

Your options are to use a different Racket to build the “cs” variant (with make RACKET=...
) or add the primitives the old runtime’s C code so that it can build, too

ah, ok, the first option sounds much better

@spall does that make sense?

that’s make RACKET=/path/to/other/racket
in the cs
directory, right?

Right.

I think there’s a hiccup around make run
or make expander-demo
where you have to make sure that a racket7/racket/bin/racket
file exists (so that make run
or make expander-demo
can file the main “collects” relative to that file)

yes this makes sense. I agree the 2nd option sounds much better. I’m not sure i understand the “hiccup” but I will try this and see how it goes.

>/home/spall/iu/hash-tables/racket7/racket/src/common/check.rkt:2:9: cannot open module file module path: racket/private/check path: /home/spall/plt/racket–6.7/collects/racket/private/check.rkt system error: No such file or directory; errno=2 I get this error. do i need a different version of racket or install more packages?

That seems like something is confused between the versions

But maybe you need 6.10

@kspaans has joined the channel