-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to Gerbil Scheme #314
base: master
Are you sure you want to change the base?
Conversation
@vyzo can you add the installation of gerbil to the Dockerfile and add that mode to .travis.yml to activate Travis testing? Once you do that I'll rebuild and push the docker image and restart the Travis test. |
sure! |
It seems the test failed because |
I updated the Dockerfile to install gerbil in /opt/gerbil. |
@vyzo I planned to wait with this one until Gerbil scheme has been properly packaged so that no installation to
|
I can change the Dockerfile to install on /usr/bin, that's not such a difficult thing.
|
@vyzo I pushed out an updated build of the scheme docker image and restarted the gerbil task. There are some errors during the build phase and also seem to be some ASCII control characters being printed in the output that are breaking the tests: https://travis-ci.org/kanaka/mal/jobs/357610551 |
seems my build script is not expanding the |
not sure what's up with the control characters though. |
I also recently introduced a bug in Gerbil r7rs, which is now fixed: We will need to build a new docker container for that fix, as it breaks mal compilation. |
Hi @vyzo, are you still interested in pursuing this? I built and pushed a new scheme docker image that updates the gerbil repo as of today it's state a couple hours ago. The first thing I ran into is that the build rule dependencies aren't complete. Here is a patch to my tree that fixes that (and also moves the gerbil-build.sh logic into the Makefile): diff --git a/Makefile b/Makefile
index d88cd89..0ba8e49 100644
--- a/Makefile
+++ b/Makefile
@@ -169,6 +169,7 @@ scheme_STEP_TO_PROG_chicken = scheme/$($(1))
scheme_STEP_TO_PROG_sagittarius = scheme/$($(1)).scm
scheme_STEP_TO_PROG_cyclone = scheme/$($(1))
scheme_STEP_TO_PROG_foment = scheme/$($(1)).scm
+scheme_STEP_TO_PROG_gerbil = scheme/gxc.out/bin/$($(1))
# Map of step (e.g. "step8") to executable file for that step
ada_STEP_TO_PROG = ada/$($(1))
diff --git a/scheme/Makefile b/scheme/Makefile
index ccb719e..94b86f5 100644
--- a/scheme/Makefile
+++ b/scheme/Makefile
@@ -9,11 +9,11 @@ CLASSSTEPS = out/step0_repl.class out/step1_read_print.class \
out/step3_env.class out/step4_if_fn_do.class out/step5_tco.class \
out/step6_file.class out/step7_quote.class out/step8_macros.class \
out/step9_try.class out/stepA_mal.class
-GXCSTEPS = gxc.out
+GXCSTEPS = $(foreach s,$(BINS),gxc.out/bin/$(s))
STEPS = $(if $(filter kawa,$(scheme_MODE)),$(CLASSSTEPS),\
$(if $(filter chicken,$(scheme_MODE)),$(BINS),\
$(if $(filter cyclone,$(scheme_MODE)),$(BINS),\
- $(if $(filter gerbil,$(scheme_MODE)),$(GXCSTEPS)))))
+ $(if $(filter gerbil,$(scheme_MODE)),$(GXCSTEPS)))))
KAWA_STEP1_DEPS = out/lib/util.class out/lib/reader.class \
out/lib/printer.class out/lib/types.class
@@ -71,8 +71,12 @@ eggs/r7rs.so:
chicken-install -init eggs
CHICKEN_REPOSITORY=$(CURDIR)/eggs chicken-install r7rs
-gxc.out:
- ./gerbil-build.sh
+gxc.out/lib/core__rt.ol:
+ mkdir -p gxc.out/bin
+ GERBIL_LOADPATH=gxc.out gxc -d gxc.out -O lib/util.sld lib/types.sld lib/env.sld lib/reader.sld lib/printer.sld lib/core.sld
+
+gxc.out/bin/%: gxc.out/lib/core__rt.ol
+ GERBIL_LOADPATH=gxc.out gxc -d gxc.out -O -exe -o $@ $*.scm
lib/%.scm: lib/%.sld
$(SYMLINK) $< $@ Once that is applied, the steps will build and the tests can run but then I see the original failure I was seeing where there is escape codes in the output. Here is a snippit of the test failure (test^step0):
If you're still interested can you fix the failures? Also, since @wasamasa created the base scheme implementation he'll either need to sign off on the way you are doing the main invocation, or you'll need to bring that more into line with the way all the other scheme implementations currently work. If you're not interested in pushing this forward, please let me know and I'll close the issue. Thanks! |
I can look into fixing the test failures. |
Seems like output is getting garbled with control characters. |
I suspect it's whatever library you are using to do line editing (e.g. readline, libedit, linenoise) is trying to do some sort of input highlighting or cursor movement using escape codes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vyzo Any interest in revisiting this and getting it merged?
If so, you'll want to do a few things since so much time has passed:
- rebase onto the HEAD sources
- move the
.travis.yml
definition toIMPLS.yml
- Make sure that the Github CI tests all pass for your implementation. The process is now more automated and doesn't require my manual intervention to build docker images (part of the reason to rebase).
Thanks!
Sure! It's been a while, and Gerbil has evolved a lot since, but it could be a fun exercise. Time is not ample unfortunately, but i'll put it in my list of things to hack. |
This adds support for Gerbil in the Scheme implementation.