Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Sulong with Swift? #654

Open
ambientlight opened this issue Jan 10, 2017 · 6 comments
Open

Sulong with Swift? #654

ambientlight opened this issue Jan 10, 2017 · 6 comments

Comments

@ambientlight
Copy link

Greeting guys,

Has anybody tried (or started) integrating Sulong with swift toolchain? Or its too early yet?
It just feels quite promising that sulong can potentially allow swift to target JVM.
(I just recently discovered sulong).

@grimmerm
Copy link
Contributor

Hi,

Swift would be interesting, yes. However, we did not yet try it. Currently we test Sulong with C/C++ and Fortran compiled with Clang 3.2 or GCC 4.6.

-Matthias

@ambientlight
Copy link
Author

ambientlight commented Jan 10, 2017

thanks for the feedback.

Btw, I am absolutely not familiar with llvm itself, but since swift has its own front end and then it compiles to Swift IR and only then to LLVM IR, do you think it will complicate the LLVM IR that will kinda degrade its performance on JVM when comparing to Clang languages?

I guess I need to integrate the sulong with swift toolchain and play around with it, seems very seductive 😄

@grimmerm
Copy link
Contributor

I did not look at the LLVM IR produced by Swift yet. So I can not answer this question; sounds like a nice experiment though ;-) If you start playing around with Sulong and Swift, I'm happy to answer any questions you might have: [email protected] or Skype: grimmer_m

@ambientlight
Copy link
Author

Great, thanks!

@hackyourlife
Copy link

Hi, i find hard to see benefit of this
Swift produce native, self contained binary, why would someone add a huge dependency (jre)?

There is exactly one reason why you might want to use Sulong: to get seamless interoperability with other Truffle languages like Ruby, JavaScript, R or Python. Otherwise you could just compile the LLVM IR to native code and completely forget Sulong (and most of the time that would also be faster).

Or i'm understanding wrong? Does GraamVM compiler produce self contained executable?

Depends. The Graal compiler can produce a self contained executable (= compile Sulong to a self contained executable; you can search for something called "SubstrateVM"). It can also run on top of a GraalVM which is just a JVM + Graal compiler as JIT. In both cases you end up with something like the lli command from LLVM, so you have to pass the bitcode to Sulong at runtime and Sulong will execute it.

Is there a place where i can read more about this project ?

There are papers about both Graal/Truffle as well as Sulong. See docs/PUBLICATIONS.md and Graal/Publications and Presentations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@hackyourlife @grimmerm @ambientlight and others