# Jluna, the Modern Julia Wrapper for C++, has entered 1.0 Beta

**URL:** https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303
**Category:** Package Announcements
**Created:** [April 30, 2022, 6:11pm UTC](https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303 "2022-04-30T18:11:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Clemapfel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/clemapfel/32/32261_2.png) [@Clemapfel](https://discourse.julialang.org/u/Clemapfel)
#### Post date: [April 30, 2022, 6:11pm UTC](https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303/1 "2022-04-30T18:11:31Z")

</div>

After many weeks of updates, [jluna](https://github.com/Clemapfel/jluna), the Julia ↔ C++ wrapper, is feature-complete.

It is available for free, under MIT license, here: [https://github.com/Clemapfel/jluna](https://github.com/Clemapfel/jluna)

It now includes:

- handwritten manual aimed at people less familiar with C++, installation guide
- 0-overhead thread pool that allows C++ code to interface with Julia concurrently
- benchmarks and performance evaluation, confirming viability in performance-critical environments (\< 5% overhead compared to the C-API)
- 0-overhead way to call arbitrary C++ functions in Julia

jluna aims to completely replace the Julia C-API in usage in C++ projects. Hopefully, this makes Julia easier to embed and more attractive to non-Julia projects. The C-API can be quite hard to use, which is why I have taken care to create verbose documentation, exception forwarding, and varied safety features.

For more information, consider reading the [GitHub readme](https://github.com/Clemapfel/jluna/blob/master/README.md).

The main difference to Cxx.jl and CxxWrap.jl are:

- jluna assumes C++ as the host language, instead of Julia. It is a C++ library, not a Julia package
- it is aimed at modern C++20, heavily making use of features such as concepts
- it requires up-to-date C++ compilers and Julia 1.7.0+
- internals, interfacing, syntax, etc. are completely different. jluna was designed separately, from scratch

The library will continue to be supported, hopefully for years to come. Thank you to all who already gave the project a chance, and to all that are considering using it in the future.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [April 30, 2022, 6:37pm UTC](https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303/2 "2022-04-30T18:37:57Z")

</div>

Is the package already being promoted to C++ people elsewhere? I don’t need C++ as host myself (but I like all solutions to allow Julia code available from more languages):

> [@Clemapfel](#):
>
> jluna assumes C++ as the host language

I realize; and that you can already call Julia from R, but isn’t this also useful to make R extensions to call Julia?

It might be that’s not needed, even though R extensions are usually written in C++. Same with Python extensions (or more often in C; or Fortran?).

PythonCall.jl is beautiful for calling Python (and taking care of its dependencies), but also to call Julia, with Python the host language.

I’m thinking, is there a way to make extensions for both Python and R, already, in C++ (if that not commonly done?), meaning with the wrapper the same, not just the wrapped C++ code, possible to build it for Python or R?

Is this package helpful for that, while keep the wrapper in C++, to be usable from it too, even though the wrapped code is in Julia?

---

<div class="post-metadata">

### Author: ![Clemapfel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/clemapfel/32/32261_2.png) [@Clemapfel](https://discourse.julialang.org/u/Clemapfel)
#### Post date: [April 30, 2022, 8:48pm UTC](https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303/3 "2022-04-30T20:48:04Z")

</div>

> Is the package already being promoted to C++ people elsewhere?

For now, I only announced it here and on the Julia discord, I think tomorrow I’ll try to visit the Julia slack and maybe the C++ subreddit

> I’m thinking, is there a way to make extensions for both Python and R, already, in C++ (if that not commonly done?), meaning with the wrapper the same, not just the wrapped C++ code, possible to build it for Python or R?

If you think of the languages like a directed graph, to connect all these languages you would need a C++ host, and a R → C++ library, Python → C++ library and Julia → C++ library, the latter of which jluna is. That way, C++ can serve as the connection between all of them.

---

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [April 30, 2022, 8:55pm UTC](https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303/4 "2022-04-30T20:55:14Z")

</div>

For R\<-\>C++, there is Rcpp. For Python\<-\>C++, there are cppyy and pybind11 (see also hpy and cffi for C).

---

<div class="post-metadata">

### Author: ![metab0t](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metab0t/32/15551_2.png) [@metab0t](https://discourse.julialang.org/u/metab0t)
#### Post date: [May 1, 2022, 2:45am UTC](https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303/5 "2022-05-01T02:45:35Z")

</div>

Thank you for your hard work!  
I am wondering whether the julia-c++ binding library can be designed to be header-only? I see that both Cxxwrap and jluna donot choose this approach. The users need to link basic library (libjluna.so + jlna\_c\_adaptor or libcxxwrap-julia.so).  
When I use Cxxwrap recently, I think if we make the c++ binding library header-only, we can build a standalone dynamic library that only links to libjulia and easier to distribute.

---

<div class="post-metadata">

### Author: ![cdsousa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cdsousa/32/215553_2.png) [@cdsousa](https://discourse.julialang.org/u/cdsousa)
#### Post date: [May 2, 2022, 2:25pm UTC](https://discourse.julialang.org/t/jluna-the-modern-julia-wrapper-for-c-has-entered-1-0-beta/80303/6 "2022-05-02T14:25:04Z")

</div>

This is huge! Thank you for all your hard work!  
I’m especially happy with the multi-threading interface ❤
