lambdanative icon indicating copy to clipboard operation
lambdanative copied to clipboard

syntax-case breaks build

Open 0-8-15 opened this issue 5 years ago • 7 comments

Two issues:

  1. syntax-case compile is never cached, always recompiled by make
  2. the resulting binary segfaults

My env: On linux installed lambdanative, gcc version 6.3.0

  1. lambdanative create cmd console
  2. ./configure cmd linux debug verbose
  3. add syntax-case to the MODULES file.
  4. make

0-8-15 avatar May 10 '19 09:05 0-8-15

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?

mgorges avatar May 11 '19 05:05 mgorges

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.

0-8-15 avatar May 13 '19 12:05 0-8-15

Looks like gambit issue is supposed to fix the issue.

The update needs some tweaking of the compile scripts.

I'm trying. Takes time.

0-8-15 avatar May 13 '19 16:05 0-8-15

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

mgorges avatar May 14 '19 19:05 mgorges

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.

0-8-15 avatar May 15 '19 14:05 0-8-15

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.)

0-8-15 avatar May 15 '19 18:05 0-8-15

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?

svenha avatar Dec 10 '19 11:12 svenha