# What language are Julia packages written in?

**URL:** <https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298>\
**Category:** New to Julia\
**Created:** [February 8, 2023, 7:27pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298 "2023-02-08T19:27:12Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kronos/32/46712_2.png) [@Kronos](https://discourse.julialang.org/u/Kronos)\
**Post date:** [February 8, 2023, 7:27pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/1 "2023-02-08T19:27:12Z")

</div>

What language are Julia packages written in ?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [February 8, 2023, 7:42pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/2 "2023-02-08T19:42:36Z")

</div>

Julia

---

<div class="post-metadata">

**Author:** ![ElOceanografo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eloceanografo/32/624_2.png) [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Post date:** [February 8, 2023, 7:55pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/3 "2023-02-08T19:55:24Z")

</div>

Welcome @Kronos! To elaborate a bit on what @jling said, almost all Julia packages are written in Julia. This is one of the biggest strengths of the language: because it is so performant, there is no divide between the user-friendly scripting language and its “under the hood” implementation (as there is with Python/C). You can easily find your favorite packages on GitHub and read the source code, which is actually a great way to learn Julia programming techniques and best practices.

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [February 8, 2023, 9:53pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/4 "2023-02-08T21:53:46Z")

</div>

To add another data point here, I was able to contribute to Julia’s source code within only a few months of learning Julia. I programmed in Python for years before switching to Julia. Never was able to add functionality to Python or Python packages.

Either way, welcome to the community @Kronos ! 👋

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [February 8, 2023, 10:02pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/5 "2023-02-08T22:02:55Z")

</div>

> [@ElOceanografo](#):
>
> almost all Julia packages are written in Julia

Well, this is not exactly true. I don’t have a statistic, but there are also many packages that are wrappers for C++ and Fortran libraries, e.g. QML.jl or Gtk.jl or Dierckx.jl.

But new packages for Julia are usually written in Julia which is different from Python where you have to write packages that shall be fast in C++ or Fortran because they will be slow if you write them in Python.

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [February 9, 2023, 4:17pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/6 "2023-02-09T16:17:56Z")

</div>

> [@ufechner7](#):
>
> Well, this is not exactly true. I don’t have a statistic, but there are also many packages that are wrappers for C++ and Fortran libraries, e.g. QML.jl or Gtk.jl or Dierckx.jl.

Even wrapper packages could only include Julia code that invokes the other library via `ccall` or similar.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 9, 2023, 4:20pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/7 "2023-02-09T16:20:22Z")

</div>

~~That’s pretty tautological, and the same would be true for nearly every language.~~

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [February 9, 2023, 4:24pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/8 "2023-02-09T16:24:05Z")

</div>

I don’t think that that is true. Maybe I wasn’t clear. If I want to call a C library from Go, then I have to write the wrapper code in C as cgo comments. AFAIK, Lua has no `ccall` equivalent and a wrapper requires actual new C code. When I used Java, when I created wrappers I had to write new C code using the JNI interface. I’m unaware of the state of Python lately, but it used to require wrapper C code, but that could be done with SWIG.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 9, 2023, 4:46pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/9 "2023-02-09T16:46:16Z")

</div>

Oh interesting! Thanks for all the counterexamples. Sure enough, my knowledge here is cursory at best.

So then what _are_ the languages with native interop facilities? I think R?

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [February 9, 2023, 4:51pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/10 "2023-02-09T16:51:37Z")

</div>

I used to use Jython from a Java application. Because Jython was written in Java, the Python code could access any Java class in the application without any special wrappers as long as the ClassLoader permitted that access. I think other JVM languages, such as Groovy, JRuby, and Clojure, have similar capabilities.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 9, 2023, 4:56pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/11 "2023-02-09T16:56:49Z")

</div>

> [@Jeff\_Emanuel](#):
>
> I don’t think that that is true. Maybe I wasn’t clear. If I want to call a C library from Go, then I have to write the wrapper code in C as cgo comments. AFAIK, Lua has no `ccall` equivalent and a wrapper requires actual new C code. When I used Java, when I created wrappers I had to write new C code using the JNI interface. I’m unaware of the state of Python lately, but it used to require wrapper C code, but that could be done with SWIG.

Even if you have an analogue of `ccall` (e.g. [Python `ctypes`](https://docs.python.org/3/library/ctypes.html) or [Lua FFI](http://luajit.org/ext_ffi.html)), in other dynamic languages you often have to write “vectorized” wrappers in a lower-level language for performance reasons, because fine-grained calls are too expensive.

For example, [my earliest contribution](https://github.com/JuliaLang/julia/pull/1799) to Julia was to interface my [C library for complex `erf`-related functions](http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package). I had already written interfaces to this code from Matlab, Python, Octave, and Scilab, so I figured I might as well write glue for the weird language from [the guy down the hall from me](https://math.mit.edu/~edelman/). Because these are special functions that take a single scalar in and return a single scalar out, however, in all the other languages I had to implement a low-level “vectorized” interface in C, to apply the function elementwise to a whole array of numbers at once, as otherwise it would be impossible to use efficiently. I was delighted to learn that, in Julia, I could implement a zero-overhead interface with only a single line of Julia code (per C function), and I could even wrap multiple functions at once with an `@eval` metaprogramming loop.

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [February 9, 2023, 5:02pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/12 "2023-02-09T17:02:36Z")

</div>

> [@stevengj](#):
>
> [Lua FFI](http://luajit.org/ext_ffi.html)

Interesting. FWIW, LuaJIT is an alternative implementation of Lua, not the original from [PUC Rio](https://www.lua.org/).

---

<div class="post-metadata">

**Author:** ![Kronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kronos/32/46712_2.png) [@Kronos](https://discourse.julialang.org/u/Kronos)\
**Post date:** [February 11, 2023, 7:08pm UTC](https://discourse.julialang.org/t/what-language-are-julia-packages-written-in/94298/13 "2023-02-11T19:08:49Z")

</div>

> [@ElOceanografo](#):
>
> programming techniques and best practices.

Thank you 🙂
