# Port Julia to the GraalVM

**URL:** https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194
**Category:** Internals & Design
**Created:** [January 10, 2020, 2:18pm UTC](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194 "2020-01-10T14:18:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![KenziTrader](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kenzitrader/32/12225_2.png) [@KenziTrader](https://discourse.julialang.org/u/KenziTrader)
#### Post date: [January 10, 2020, 2:18pm UTC](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194/1 "2020-01-10T14:18:03Z")

</div>

The [GraalVM](https://www.graalvm.org) allows to combine code written in JVM-based languages such as Java, Scala, and Kotlin, but also other programming languages such as JavaScript, Ruby, Python, and R. I would like to be able to use Julia as well.

We have a Java based codebase. I develop my algorithms in Julia and then convert them to Scala for our production system. I prefer to add my Julia code directly in our production code.

I use the great [JavaCall](https://github.com/JuliaInterop/JavaCall.jl) package for testing but its overhead is too big for our realtime system.

GraalVM can run LLVM bitcode and Julia is based on LLVM so it seems a plausible project.

---

<div class="post-metadata">

### Author: ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)
#### Post date: [January 10, 2020, 2:27pm UTC](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194/2 "2020-01-10T14:27:34Z")

</div>

Please keep us updated about your progress doing this.

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [January 10, 2020, 2:32pm UTC](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194/3 "2020-01-10T14:32:02Z")

</div>

Here is a cross link to the original GitHub issue which has a brief discussion: [https://github.com/JuliaLang/julia/issues/34334](https://github.com/JuliaLang/julia/issues/34334)

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [January 30, 2020, 8:29pm UTC](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194/4 "2020-01-30T20:29:27Z")

</div>

I was looking at the JavaCall issues and came across this.

It looks like the static implementation could be done by chaining existing tools together.

1. Setup for static AOT Julia

[https://juliacomputing.com/blog/2016/02/09/static-julia.html](https://juliacomputing.com/blog/2016/02/09/static-julia.html)

1. Emit LLVM bitcode from `julia` with `--output-bc`

2. Run the LLVM bitcode with sulong: `mx lli -Dpolyglot.llvm.libraryPath=lib -Dpolyglot.llvm.libraries=liba.so test.bc `

> **[graal/sulong at master · oracle/graal](https://github.com/oracle/graal/tree/master/sulong)**
>
> master/sulong

1. Compile the LLVM bitcode with optimizations

```julia
mx --dynamicimport /compiler --jdk jvmci lli test.bc

```

---

<div class="post-metadata">

### Author: ![Jorge\_Vieyra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jorge_vieyra/32/6527_2.png) [@Jorge\_Vieyra](https://discourse.julialang.org/u/Jorge_Vieyra)
#### Post date: [July 18, 2020, 10:57am UTC](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194/5 "2020-07-18T10:57:16Z")

</div>

@mkitti The original post for 1. is a bit outdated. Does it still apply to Julia 1.x?
