spall
2017-8-25 15:07:13

@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?


mflatt
2017-8-25 15:54:13

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.


spall
2017-8-25 15:58:21

ok thanks


mflatt
2017-8-25 16:16:32

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


spall
2017-8-25 17:05:50

@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?


spall
2017-8-25 17:26:35

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


spall
2017-8-25 17:29:06

never mind i think i found the “module”


mflatt
2017-8-25 17:29:17

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


spall
2017-8-25 17:29:19

I think I just need to rebuild racket again


mflatt
2017-8-25 17:29:24

is that what you found?


spall
2017-8-25 17:29:31

yes that is what i found


mflatt
2017-8-25 17:29:38

ok, good


spall
2017-8-25 17:30:07

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?


mflatt
2017-8-25 17:36:14

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.


samth
2017-8-25 18:08:49

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


samth
2017-8-25 18:09:06

(also the already-built chez code)


samth
2017-8-25 18:09:47

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


mflatt
2017-8-25 21:27:34

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


samth
2017-8-25 21:28:55

ah, ok, the first option sounds much better


samth
2017-8-25 21:29:06

@spall does that make sense?


samth
2017-8-25 21:29:25

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


mflatt
2017-8-25 21:29:39

Right.


mflatt
2017-8-25 21:30:38

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)


spall
2017-8-26 02:34:15

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.


spall
2017-8-26 02:43:48

>/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?


samth
2017-8-26 03:22:00

That seems like something is confused between the versions


samth
2017-8-26 03:22:09

But maybe you need 6.10


kspaans
2017-8-26 05:18:59

@kspaans has joined the channel