# Julia within org-mode: what about a new ob-julia?

**URL:** <https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308>\
**Category:** Tooling\
**Tags:** emacs\
**Created:** [September 9, 2020, 7:01am UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308 "2020-09-09T07:01:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![fsantos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fsantos/32/44790_2.png) [@fsantos](https://discourse.julialang.org/u/fsantos)\
**Post date:** [September 9, 2020, 7:01am UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/1 "2020-09-09T07:01:29Z")

</div>

Hi,

I’m very new to Julia (and just beginning to learn this language). I’m currently mostly an R user, which I use within Emacs using ESS and org-mode.

ESS has pretty good support for Julia, but I still have found no satisfying way to use Julia within org-mode. I read [this thread about emacs-jupyter](https://discourse.julialang.org/t/using-emacs-jupyter-mode-for-development/45276), but I simply did not manage to make it work for now. Furthermore, I would be more enthusiastic for a simple and lightweight elisp solution, as advocated in [this (old) thread](https://discourse.julialang.org/t/straw-poll-for-emacs-org-mode-workflow/10369/22). (This would be closer to my current org-babel + R workflow.)

There used to be an old [ob-julia](https://github.com/gjkerns/ob-julia) package for that, but it is now orphaned and broken. Several individual forks do exist, e.g. [here](https://git.nixo.xyz/nixo/ob-julia) or [here](https://github.com/vincent-picaud/Julia_with_OrgMode_Example), but none of them seems to be totally okay for the latest versions of Julia.

So, are there here some folks who would also like to resuscitate this package `ob-julia` in a common, “official” and durable effort? 😉 I’m not a great emacs lisp programmer but I do have some notions and I would be glad to be involved in this effort — I’m just not good enough in lisp to do that alone.

Thanks, and see you!

---

<div class="post-metadata">

**Author:** ![XVilka](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xvilka/32/7155_2.png) [@XVilka](https://discourse.julialang.org/u/XVilka)\
**Post date:** [September 9, 2020, 8:08am UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/2 "2020-09-09T08:08:57Z")

</div>

There could be another way - create an `emacs-jupyter` alternative but based on [Pluto.jl](https://github.com/fonsp/Pluto.jl).

---

<div class="post-metadata">

**Author:** ![fsantos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fsantos/32/44790_2.png) [@fsantos](https://discourse.julialang.org/u/fsantos)\
**Post date:** [September 9, 2020, 10:07am UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/3 "2020-09-09T10:07:18Z")

</div>

This might be slightly easier to create (?) but probably harder to maintain (and less safe) in the long run. I’m not sure that relying on sophisticated tools such as Pluto or Jupyter is actually the best way to bring back Julia into org-mode. A very light and simple solution, similar to the `ob-R` exporter for the R language or the good old `ob-julia`, would probably do the job for most people without introducing complex dependencies. But since I know very little about both Julia and Elisp, I’m clearly not in the best position to figure out what could be the best option 😉

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [September 9, 2020, 12:56pm UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/4 "2020-09-09T12:56:52Z")

</div>

I don’t use it myself, but my understanding was that [nixo/ob-julia: A wonderful emacs Org Mode julia babel with async support - ob-julia - nixo's git server](https://git.nixo.xyz/nixo/ob-julia) was supposed to be relatively functional. If you have specific issues with it, it’s probably worth opening an issue there.

---

<div class="post-metadata">

**Author:** ![bgoodr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgoodr/32/17916_2.png) [@bgoodr](https://discourse.julialang.org/u/bgoodr)\
**Post date:** [September 19, 2020, 10:39pm UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/5 "2020-09-19T22:39:15Z")

</div>

Unfortunately, [nixo/ob-julia: A wonderful emacs Org Mode julia babel with async support - ob-julia - nixo's git server](https://git.nixo.xyz/nixo/ob-julia) does not have a MELPA recipe ([https://github.com/melpa/melpa/blob/master/README.md#recipe-format](https://github.com/melpa/melpa/blob/master/README.md#recipe-format)).

---

<div class="post-metadata">

**Author:** ![bgoodr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgoodr/32/17916_2.png) [@bgoodr](https://discourse.julialang.org/u/bgoodr)\
**Post date:** [September 19, 2020, 10:40pm UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/6 "2020-09-19T22:40:56Z")

</div>

but [https://git.nixo.xyz/nixo/ob-julia](https://git.nixo.xyz/nixo/ob-julia) does not have a MELPA package so you cannot install it using the list-packages interface.

---

<div class="post-metadata">

**Author:** ![bgoodr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgoodr/32/17916_2.png) [@bgoodr](https://discourse.julialang.org/u/bgoodr)\
**Post date:** [September 19, 2020, 10:41pm UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/7 "2020-09-19T22:41:32Z")

</div>

Sorry for the now triple post, but when I post something, I don’t see it show up. What is going on here?

Now editing my post. I posted three times and the above sentence is the only one that showed up. Is there a bug in the web site?

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Post date:** [September 20, 2020, 3:03am UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/8 "2020-09-20T03:03:46Z")

</div>

Apologies, your post got flagged by the spam detector (posts with lots of external links by new users often get flagged). I have now restored it.

Welcome to discourse!

---

<div class="post-metadata">

**Author:** ![bgoodr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgoodr/32/17916_2.png) [@bgoodr](https://discourse.julialang.org/u/bgoodr)\
**Post date:** [September 20, 2020, 5:04am UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/9 "2020-09-20T05:04:28Z")

</div>

Thank you. Good to know there is an active spam detector.

New users can’t post more than 2 links. Makes sense.

Here is a translation table to bypass that limit for this info:

```
git.nixo.xyz == h t t p s : / / g i t . n i x o . x y z / n i x o / o b - j u l i a
gjkerns == h t t p s : / / g i t h u b . c o m / g j k e r n s / o b - j u l i a / b l o b / m a s t e r / o b - j u l i a - d o c . o r g # r e s u l t s - v a l u e 

```

For what it’s worth, I took quite a bit of time trying to install the  
“ob-julia” inside git.nixo.xyz but ran into a conflict whereby there  
are two ob-julia.el’s in the system if you do that, and that is how I  
discovered that gjkerns was already installed into my setup!

The one provided by the org-plus-contrib package is loaded first, and  
the ob-julia.el from inside git.nixo.xyz never got found in the load  
path.

The one coming in by way of org-plus-contrib looks to be the same  
“old” package from looking at the header in its ob-julia.el file, at  
.emacs.d/elpa/org-plus-contrib-20200914/ob-julia.el, since it contains  
this at the top:

```
;; See https://github.com/gjkerns/ob-julia/blob/master/ob-julia-doc.org
;; for detailed instructions on how to get started. The git repository
;; contains more documentation: git://github.com/gjkerns/ob-julia.git

```

It could be argued that the one coming from org-plus-contrib should be  
removed, and replaced with the one from git.nixo.xyz, but I cannot  
tell if the latter is better since I cannot give up on using the  
org-plus-contrib package since it contains things I rely upon already  
in my setup that I cannot disturb just to experiment with Julia+Org  
integration.

Testing the gjkerns version of ob-julia.el shows that using `:results output` works:

```
#+NAME: with-results-output
#+BEGIN_SRC julia :results output
  rand(2,3)
#+END_SRC

#+RESULTS: with-results-output
: "somefile.org"
: 2×3 Array{Float64,2}:
: 0.471239 0.297008 0.663586
: 0.0963117 0.585604 0.642755

```

but using `:results value` this gives no output:

```
#+NAME: with-results-value
#+BEGIN_SRC julia :results value
  rand(2,3)
#+END_SRC

#+RESULTS: with-results-value

```

So, as found before, the one at gjkerns is broken indeed, but this is  
proof of it.

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Post date:** [September 21, 2020, 4:03am UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/10 "2020-09-21T04:03:52Z")

</div>

> [@bgoodr](#):
>
> New users can’t post more than 2 links. Makes sense.
> 
> Here is a translation table to bypass that limit for this info:
> 
> ```julia
> git.nixo.xyz == h t t p s : / / g i t . n i x o . x y z / n i x o / o b - j u l i a
> gjkerns == h t t p s : / / g i t h u b . c o m / g j k e r n s / o b 
> 
> ```

I think posts will just get put in the moderator queue: usually mods are pretty quick to approve valid posts, so no encoding should be necessary.

---

<div class="post-metadata">

**Author:** ![tjh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tjh/32/23631_2.png) [@tjh](https://discourse.julialang.org/u/tjh)\
**Post date:** [May 16, 2021, 12:04pm UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/11 "2021-05-16T12:04:47Z")

</div>

I am no programmer, so maybe I am completely misguided or uninformed, but:  
What about the possibility of `ox-pluto` rather than `ob-julia`? Since pluto notebooks are just text, including non-julia code as markdown and julia code as text-cells seems like it should be very easy. If one also had an `import-pluto-notebook` to provide the inverse it seems this could be pretty useful.

---

<div class="post-metadata">

**Author:** ![RomeoV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/romeov/32/37687_2.png) [@RomeoV](https://discourse.julialang.org/u/RomeoV)\
**Post date:** [July 15, 2022, 12:56pm UTC](https://discourse.julialang.org/t/julia-within-org-mode-what-about-a-new-ob-julia/46308/12 "2022-07-15T12:56:01Z")

</div>

As of writing this, `shg/ob-julia-vterm.el` is actively being developed on github and has been giving me good results so far.
