part-cw / lambdanative

LambdaNative is a cross-platform development environment written in Scheme, supporting Android, iOS, BlackBerry 10, OS X, Linux, Windows, OpenBSD, NetBSD, FreeBSD and OpenWrt.
http://www.lambdanative.org
Other
1.39k stars 85 forks source link

syntax-case breaks build #237

Open 0-8-15 opened 5 years ago

0-8-15 commented 5 years ago

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
mgorges commented 5 years ago

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?

0-8-15 commented 5 years ago

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 commented 5 years ago

Looks like gambit issue is supposed to fix the issue.

The update needs some tweaking of the compile scripts.

I'm trying. Takes time.

mgorges commented 5 years ago

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

0-8-15 commented 5 years ago

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 commented 5 years ago

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

svenha commented 4 years ago

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?