-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add ABCL support #52
base: master
Are you sure you want to change the base?
Add ABCL support #52
Conversation
Looks like Travis is going to queue this forever. @rkoeninger I'm planning on switching CI on this repo (and Shen/Scheme's too) to GitHub actions, Travis is sucking lately. Just saw this too https://ropensci.org/technotes/2020/11/19/moving-away-travis/ |
It finally started and than failed because I needed some sudo's. @tizoc Actions looks like the way to go. I'll probably start moving my projects there as well. (And don't forget Shen-Language/shen-source - or I'll do that one once I see how's done) |
Yes, I have been using actions for a while and it works quite well (even today I switched a repo from travis to github actions because of how bad travis is behaving lately). |
Running Running
My goal was to have This has gotten a little tiring so if someone else wants to take a crack it at, go ahead. I'm continuing to question the need to have an executable form for each CL impl, i think it would be enough to have a |
@rkoeninger this is more than good enough, seems like you already did >90% of the work here. I am not familiar with ABCL (didn't even know it existed until now) nor have any experience with the JVM, so there isn't much I can help with here. @junkerjoe if you are familiar enough with ABCL maybe you could provide some ideas here to complete what is missing, I think everything that is related to the Shen/CL side has been covered by @rkoeninger already. |
@rkoeninger can you elaborate on this? we only release SBCL binaries, right? I'm all for simplifying things. |
@tizoc My thinking (as seen in ShenScript and ShenSharp) is that a Shen implementation should be thought of as more of a library that gets imbedded in other applications than a foundational language that gets distributed as a binary. There's a build step in the Makefile that pre-compiles the kernel to lisp; I'm thinking in the future that step becomes the main build step to render a "shen.lisp" library, maybe using ASDF and published to Quicklisp (see #27 - asdf could help with targeting multiple CL impls and QL would make usage more accessible). Such a library could then be embedded into whatever lisp program, one such example being a SBCL-based program that loads up shen.lisp and calls This would mean we wouldn't have the need to build artifacts for every CL impl. Just so long as shen.lisp library is usable from each one; so maybe we'd still have optional test steps. I started thinking this back when porting to ECL (a couple years ago I think) when I realized ECL isn't about building lisp executables but embedding lisp in native programs (Embeddable Common Lisp). I'm having this thought again now since I'm having trouble rendering a build artifact (a jar file) specifically for ABCL. Taking the approach described, the |
Ah yes, I remember this. But Shen doesn't force you to do anything in particular, it is up to the port authors. Shen/Scheme for example didn't work as a runnable binary until I ported it to Chez, it was just a library for Chibi and Gauche. I thought you were talking specifically about Shen/CL. IMO the best option would be to care only about the SBCL binary, and then do as you say for everything else. I don't even know if anyone uses anything other than Shen/SBCL, so it makes no sense to waste energy with those binaries -- specially so when, as you say, it is a PITA in some of the Common Lisp implementations. |
Alright, so for this PR: what's a good way to wrap this up? I don't think we can say shen-cl "supports" ABCL unless there's some kind of artifact that this repo produces that ABCL can use. So that means either:
I was trying to get option 1 working and gave up on that for the moment. Now I'm thinking option 2. |
@rkoeninger from my point of view, only SBCL binaries are required, 1) because it is the reference implementation, 2) I think it is the only one people use, 3) it is worth the cost/benefit of being maintained. We can even say explicitly that for now at least, although code that is specific to other implementations is included, only SBCL is officially supported and the rest are "best effort". And then do as you say and produce a precompiled lisp file at release time (btw I started the Github Actions stuff for Shen/Scheme the other day, needs a little bit more of work, most of it should be reusable in this repo I think). Anyone can then use that precompiled So as far as wrapping this one up, I propose you leave as a CI test for ABCL to the minimum thing that works (just being able to compile the thing?), and then the generation of the compiled Does this sound good to you? |
I'm settling for rendering a combined fasl file called (this is now a liveblog comment) Trying to load it in abcl repl and run
with no other explanation. The error occurs when
other functions are working....
ABCL doesn't support tail calls: https://0branch.com/notes/tco-cl.html#sec-2-9
https://abcl.org/trac/ticket/353 @tizoc ABCL might be a no-go anyway so I/O is not being done correctly...
|
read-byte and write-byte now working
shen.read-evaluate-print works, shen.prompt works, shen.initialise_environment works but shen.loop does not, it just keeps reading input
|
Fixes #51
Discussion
Working on this raised a question about how this would be distributed for Armed Bear. ABCL runs on Java so it would distributed as a
.jar
file?This also reminds me about source distribution (rendering a
shen.lisp
with the source in this repo including the translated kernel) that would be multi-lingual. Looking in the asdf.lisp file including in some CL projects, it might be able to handle multi-platform related stuff for us.Testing Notes
Running
make build-abcl
might work depending on if you have abcl.jar in the repo checkout root (and java installed) (and it might have to be java 8).build-abcl
compiles the .lsp files for abcl, compiles a .java file that has the main method used for entrypoint (to collect args and start shen.abcl) and puts it in abin/abcl/shen.jar
file.Running
make run-abcl
will try to runjava -jar bin/abcl/shen.jar
which isn't working for me right now. I get aClassDefNotFoundError
for the abcl stuff. Probably can't find abcl. Don't know why.CC: @tizoc @junkerjoe