lambdanative
lambdanative copied to clipboard
syntax-case breaks build
Two issues:
- syntax-case compile is never cached, always recompiled by
make
- the resulting binary segfaults
My env: On linux installed lambdanative, gcc version 6.3.0
-
lambdanative create cmd console
-
./configure cmd linux debug verbose
- add
syntax-case
to theMODULES
file. -
make
The first piece is intentional. I can't recall the exact reasons but it was something about macros not expanding/evaluating properly otherwise. See issues #28 and #30.
The other one needs to be looking into further - can you find the place in the source with the problem with lldb/gdb after combiling in debug mode?
Looks like I'm running in all sorts of compile issues, which takes forever with syntax-case.
Some gdb digging points towards the config module, which I also included, not initializing properly.
gambit-c documentation hints towards syntax-case enabled at compile time (-s:
) not supporting gambit special forms.
So the current solution enables syntax-case at runtime for main.scm only, which enables eval to support syntax-case at runtime. Nice, expensive. But of little use to me. Compile time support is what I need.
The correct solution IMHO is to provide per-module choice to the user.
I'd propose to modify the syntax of the MODULES file to have module names prefixed with say -s:
to cause gsc to be invoked with the -:s
switch supporting syntax-case for the module in question otherwise use the current behavior.
Looks like gambit issue is supposed to fix the issue.
The update needs some tweaking of the compile scripts.
I'm trying. Takes time.
I do recall that the compiling took forever, but also remember that we had to do this to allow this for everything to work as desired. Nobody on the core developer team uses macros or this module so I am likely not of much use in trying to help with developing this further. That said, I'd be happy to review and merge some code that allows a per-module flag application.
Thanks Matthias
Updating gambit to version 4.9.2 seems to help at least partially.
Note: Currently open gambit issue https://github.com/gambit/gambit/issues/384 breaks define-syntax for the latest gambit version 4.9.3.
However: define-syntax works in the interpreter but I observe issues with /some/ compiled code. My goal is to have Alex Shinn's version of the Andrew Writghts match macro working. Not there yet.
Looks like it is doable. syntax-case
would even be no longer a special case. Compile and startup time are reasonable.
I need to understand more about the lambdanative build system. (For instance why the syntax-case.scm is part of the target specific files. IMHO only the compile file version should be installed there.)
Issue gambit/gambit#384 does not exist for the current development (git) version of Gambit, so the next Gambit release might be useful for lambdanative?