armedbear / abcl

Armed Bear Common Lisp <git+https://github.com/armedbear/abcl/> <--> <svn+https://abcl.org/svn> Bridge
https://abcl.org#rdfs:seeAlso<https://gitlab.common-lisp.net/abcl/abcl>
Other
288 stars 29 forks source link

Graal and Truffle #62

Open JacobGood1 opened 7 years ago

JacobGood1 commented 7 years ago

Have you fellows checked out these projects? I imagine that the graal vm would make hosting common lisp a lot easier on the jvm.

easye commented 7 years ago

I had looked at Graal and Truffle from the presentation given at the 2015 (?) JVM summit, but am not sure about the other developers (not like we are that coherent of a group at the moment). At the time, the work was an experimental add-on, not to be included in the mainline OpenJDK. As I understand it, that is still the current plan. So, while using Graal and Truffle may give some advantages, moving ABCL over to it would either require us to support two codebases, or to greatly restrict the JVM runtimes that our implementation runs upon.

Honestly, I think the challenges of getting ABCL to run on OpenJDK 9 will be large and pressing enough to suck most of such new development cycles away.

Are there any compelling features of Graal/Truffle that you would specifically like to take advantage of in ABCL?

JacobGood1 commented 7 years ago

Graal allows languages to cross communicate in ways that I have never seen before. Sulong is a project where llvm bit code runs on Graal, allowing any language to directly communicate with c/c++. I think this would make it a lot easier for common lisp to communicate with not only java but javascript, c, c++, ruby, etc. The use cases for such things would be enormous.

When Java 9 comes out it will be easy to include graal.

On Wed, Aug 2, 2017 at 8:01 AM, Mark Evenson notifications@github.com wrote:

I had looked at Graal and Truffle from the presentation given at the 2015 (?) JVM summit, but am not sure about the other developers (not like we are that coherent of a group at the moment). At the time, the work was an experimental add-on, not to be included in the mainline OpenJDK. As I understand it, that is still the current plan. So, while using Graal and Truffle may give some advantages, moving ABCL over to it would either require us to support two codebases, or to greatly restrict the JVM runtimes that our implementation runs upon.

Honestly, I think the challenges of getting ABCL to run on OpenJDK 9 will be large and pressing enough to suck most of such new development cycles away.

Are there any compelling features of Graal/Truffle that you would specifically like to take advantage of in ABCL?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-319651914, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfnjDwwRgYTwaMwbyMFZcAR7w_ZycmEks5sUGUXgaJpZM4OqAP0 .

JacobGood1 commented 7 years ago

Have you checked out graal recently? I would like to know your thoughts on it as it is today since you said that the last time you looked into it was 2015. For example, I saw a fellows blog where he implemented tail call optimizations using graal; it just seems like graal could get common lisp a lot closer to what it is meant to be.

easye commented 7 years ago

As I wrote above, I have not checked out Graal lately.

ghost commented 6 years ago

(Apologies in advance if I am hijacking this thread)

I have been thinking lately in bootstraping SBCL and create an IR interepreter in GraalVM using Truffle. I am pretty newbie in regard to SBCL or ABCL to hack it in a week but I'd love to at least create the initial scaffolding for others to contribute. That includes the IR to AST and a very very simple interpreter perhaps. If any developers out there would like to help, I'd appreciate.

There is also another route, and that would be using @robert-strandh excellent SICL and translate the HIR to higher level AST nodes in order to interpret them on Truffle.

Would I use ABCL to bootstrap SBCL in the JVM?

As I told before, I am not too familiar with SBCL internals, nor ABCL, to do this without some guidance or at least some time. I read though SBCL could be bootstrapped from many other lisps at their porting page.

So last optional question: has anyone tried to bootstrap SBCL from ABCL? I would like to know up to what stage you can get by without involving the GC, and the C runtime, and also if a custom platform would be enough to emit intermediate code; or if we shall bootstrap up to what stage, and hook into the IR repr.

easye commented 6 years ago

At one point, ABCL could indeed be used to perform the SBCL bootstrap compilation (maybe abcl-1.3.x?), as it was one of the ways I tested. I kind of fell out the habit of doing that, so it should be doable with perhaps too much effort.

SICL would be a very interesting approach as well, especially as it has matured.

But I really don't understand how SBCL would help in creating an IR interpreter in the GraalVM, but mainly as I don't understand the whole Truffle architecture that well.

In any case, you might be interested in continuing this discussion on the ABCL mailing list where you would arguable get your questions out in front of more of the current ABCL community.

JacobGood1 commented 6 years ago

(Apologies in advance if I am hijacking this thread)

No, no, by all means, continue.

The whole point of this thread was to spark interest in a cl-truffle so that we could have a holy graal in the form of common lisp =)

On Tue, May 1, 2018 at 1:52 PM, Mark Evenson notifications@github.com wrote:

At one point, ABCL could indeed be used to perform the SBCL bootstrap compilation (maybe abcl-1.3.x?), as it was one of the ways I tested. I kind of fell out the habit of doing that, so it should be doable with perhaps too much effort.

SICL would be a very interesting approach as well, especially as it has matured.

But I really don't understand how SBCL would help in creating an IR interpreter in the GraalVM, but mainly as I don't understand the whole Truffle architecture that well.

In any case, you might be interested in continuing this discussion on the ABCL mailing list https://mailman.common-lisp.net/listinfo/armedbear-devel where you would arguable get your questions out in front of more of the current ABCL community.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-385739242, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfnjMOf0r-S3o9vsPvrtSHs7jPs63Ufks5tuKDhgaJpZM4OqAP0 .

alessiostalla commented 6 years ago

I'm interested as well. I had started to write some minimal Lisp (which in my dreams could have been used to bootstrap a full CL) in Truffle but didn't go very far due to lack of energy. I would love to see this go somewhere, and even if I still struggle with simpler projects, I might lend a hand.

On 1 May 2018 at 20:06, JacobGood1 notifications@github.com wrote:

(Apologies in advance if I am hijacking this thread)

No, no, by all means, continue.

The whole point of this thread was to spark interest in a cl-truffle so that we could have a holy graal in the form of common lisp =)

On Tue, May 1, 2018 at 1:52 PM, Mark Evenson notifications@github.com wrote:

At one point, ABCL could indeed be used to perform the SBCL bootstrap compilation (maybe abcl-1.3.x?), as it was one of the ways I tested. I kind of fell out the habit of doing that, so it should be doable with perhaps too much effort.

SICL would be a very interesting approach as well, especially as it has matured.

But I really don't understand how SBCL would help in creating an IR interpreter in the GraalVM, but mainly as I don't understand the whole Truffle architecture that well.

In any case, you might be interested in continuing this discussion on the ABCL mailing list https://mailman.common-lisp.net/listinfo/armedbear-devel where you would arguable get your questions out in front of more of the current ABCL community.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-385739242, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfnjMOf0r- S3o9vsPvrtSHs7jPs63Ufks5tuKDhgaJpZM4OqAP0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-385743189, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9dtoY4mgZowbhvNYA_qNWhsD12iKAGks5tuKQwgaJpZM4OqAP0 .

JacobGood1 commented 6 years ago

BTW, Robert Strandh(the creator of SICL) hangs out in the irc clasp channel a lot if you wish to get in touch with him easily.

On Tue, May 1, 2018 at 4:31 PM, Alessio Stalla notifications@github.com wrote:

I'm interested as well. I had started to write some minimal Lisp (which in my dreams could have been used to bootstrap a full CL) in Truffle but didn't go very far due to lack of energy. I would love to see this go somewhere, and even if I still struggle with simpler projects, I might lend a hand.

On 1 May 2018 at 20:06, JacobGood1 notifications@github.com wrote:

(Apologies in advance if I am hijacking this thread)

No, no, by all means, continue.

The whole point of this thread was to spark interest in a cl-truffle so that we could have a holy graal in the form of common lisp =)

On Tue, May 1, 2018 at 1:52 PM, Mark Evenson notifications@github.com wrote:

At one point, ABCL could indeed be used to perform the SBCL bootstrap compilation (maybe abcl-1.3.x?), as it was one of the ways I tested. I kind of fell out the habit of doing that, so it should be doable with perhaps too much effort.

SICL would be a very interesting approach as well, especially as it has matured.

But I really don't understand how SBCL would help in creating an IR interpreter in the GraalVM, but mainly as I don't understand the whole Truffle architecture that well.

In any case, you might be interested in continuing this discussion on the ABCL mailing list <https://mailman.common-lisp.net/listinfo/armedbear-devel

where you would arguable get your questions out in front of more of the current ABCL community.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-385739242, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfnjMOf0r- S3o9vsPvrtSHs7jPs63Ufks5tuKDhgaJpZM4OqAP0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-385743189, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9dtoY4mgZowbhvNYA_ qNWhsD12iKAGks5tuKQwgaJpZM4OqAP0

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-385780868, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfnjMmYTQSpY1DKkxSSNgxxZqCyVjywks5tuMYPgaJpZM4OqAP0 .

ghost commented 6 years ago

Sorry I couldn't answer before but I wanted to dive deeper before posting.

I have thought the many scenarios (SBCL's IR to Graal IR, SBCL to LLVM IR (this part was some time ago tried) to Graal IR - Sulong, and finally, and chosen, SICL IR to Truffle interpreter).

To this avail I'm starting a CL project using ABCL to bootstrap SICL and creating, as well in CL, a Truffle interpreter. I wish I'd promise a great outcome but I am pretty sure it will be a bit crappy - I am not a long time lisper but I know my way around the JVM.

The first step towards this end is writing an ABCL environment. SICL's SBCL environment uses sb-cltl2, I have seen ABCL's equivalent is lisp:.

I didn't yet hook up ABCL's sources into an editor. That is to say I am starting with baby steps and all help is really appreciated. Once I have a sensible approach I will post here the repository url so everyone interested can hopefully take a look to help improve it and extend it.

Thanks :)

JacobGood1 commented 6 years ago

Sounds good!

On Wed, May 2, 2018 at 2:23 PM, Guillermo C notifications@github.com wrote:

Sorry I couldn't answer before but I wanted to dive deeper before posting.

I have thought the many scenarios (SBCL's IR to Graal IR, SBCL to LLVM IR (this part was some time ago tried) to Graal IR - Sulong, and finally, and chosen, SICL IR to Truffle interpreter).

To this avail I'm starting a CL project using ABCL to bootstrap SICL and creating, as well in CL, a Truffle interpreter. I wish I'd promise a great outcome but I am pretty sure it will be a bit crappy - I am not a long time lisper but I know my way around the JVM.

The first step towards this end is writing an ABCL environment. SICL's SBCL environment uses sb-cltl2, I have seen ABCL's equivalent is lisp:.

I didn't yet hook up ABCL's sources into an editor. That is to say I am starting with baby steps and all help is really appreciated. Once I have a sensible approach I will post here the repository url so everyone interested can hopefully take a look to help improve it and extend it.

Thanks :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62#issuecomment-386074101, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfnjMW3_rdBS9YUcAxkHnWRhsMiHSMAks5tufmsgaJpZM4OqAP0 .

divs1210 commented 5 years ago
JacobGood1 commented 5 years ago

The ecosystem for graal will be/is greater than that of pypy. As far as performance goes, the garbage collectors for java are top notch and getting even better.

On Mon, Jun 3, 2019 at 6:30 AM Divyansh Prakash notifications@github.com wrote:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armedbear/abcl/issues/62?email_source=notifications&email_token=AA36PDHTOLBYGG6NPYKRO6DPYTXDDA5CNFSM4DVIAP2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWY7S6I#issuecomment-498203001, or mute the thread https://github.com/notifications/unsubscribe-auth/AA36PDALTLUOPQHYHQQQWVTPYTXDDANCNFSM4DVIAP2A .