aliquote.org

Stata and Julia on Atom

September 19, 2018

Regularly, I like to give Atom another try. This time, coupled to Hydrogen I found that Atom became a solid editor scientific computation and text editing.

I have always thought of Hydrogen as a nice replacement for IPython notebook (and now Jupyter), but the configuration was not as easy as it is now apparently. All kernels are installed via Python, and configuration options are available in Atom preferences panel. As I already had the Python and R kernels installed on my Macbook, I just had to install the Julia and Stata kernels using Python 3.

Since Julia reached the stabilized 1.0 version, the package management system has slightly evolved compared to the previous one. Other than that, it was as simple as entering the pkg mode and issuing add IJulia at the prompt. Thanks to the stata_kernel (not to be confused with stata-kernel), it is quite easy to get Stata code running right into Atom. It is as smooth as ESS under Emacs and it is obviously much more convenient than using the kernel directly in a Jupyter notebook. The dedicated website highlights the main features, especially some very useful “magics” commands, while also providing some comparison to other packages, like ipystata. Everything works like a charm (see the screenshot below) so that I don’t think I will have to launch the Stata UI in a while. (On a Mac, it is possible to run Stata in a Terminal but without command history, paging or direct graphic output, so it has never been very interesting other than using pure estimation commands or running in batch mode.) Syntax highlighting and completion support are both excellent, better than their ESS counterparts, IMHO. I was not able to use a custom graphic scheme, though. The Julia kernel also works quite nicely, with the master version of Gadfly as the graphical backend.

That being said, Emacs will probably remain my main editor especially for Lisp, Racket and Org. But let’s not fool ourselves: Without further configuration, for each additional package you install in your Elisp directory (most of the times), it won’t run so smoothly, let alone provides you with a pleasant visual experience (unless you are willing to run Emacs in a Terminal only). This is the reason I switched to Spacemacs (or even Doom Emacs) long ago. Try Atom or IntelliJ IDEA if you want direct autocompletion and code assistance right out of the box. Surely, there is some potential in Atom (at least much more than VS Code) as advocated by Bodil Stokke (see her Atom config) if it stays away from Microsoft’s tentacles of course. Other alternatives do exist, however. I’ve heard of Xray (still an electron app, with a bit of Rust) and Xi (also with a Rust backend) after reading Nikita Prokopov’s post about Software disenchantment.

See Also

» Stata for health researchers » lost+found 2014 » Weaving Stata » Structural equation modeling with Stata » Bar charts of counts in Stata