What IDE for Julia + other languages?

Does anyone know what IDE’s are preferred for multilanguage development? I have to brush up on python right now. Experiences so far…

Atom + Juno: Open a Py file, and Juno doesn’t toggle off to say ide-python or something else…

VSCode: Setting hotkeys for Julia for code cell execution tries to run in python files and obviously fails. Deleting hotkeys works. But installing python is a pain, half the battle was resolved in removing Julia extensions. Then I need to remap the hotkeys to go back to Julia…

Is it best to just use different IDE’s for different languages or do I have to disable all extensions for Julia to edit some python (comfortably) then disable all extensions for python to hack at some Julia? Are there any guides, tips, or tricks for multiple language development in any “nice” IDE (IntelliSense, etc)? Thus far the best experience I’ve had was in visual studio(not VSCode) for combining say C++ C# etc.

Sublime Text?

1 Like

You will probably not like my answer, but what I do is to more or less have each language in its own IDE. This has disadvantages in having to learn multiple user interfaces, but I find one advantage is that my mindset is already ready, so for example when I open Atom, “okay I will be writing Julia code” etc.

So what I do right now is use Atom for Julia and Spyder3 for Python. I find that Spyder’s interface has the features I care about, maybe you need something else.

When I need to do multilanguage stuff I find my self also using Notepad++, since it is very efficient in formatting the different files, and then I execute through a terminal.

Kind regards

2 Likes

What, is that supposed to happen? I am using/planning to use VS Code for everything except Matlab, and haven’t had any problems yet. Are you saying VS Code cannot tell jl and py files apart? That’s a bug, innit?

1 Like

Emacs, being a programmable ball of mud, is great for multi-language development. You can even make notebooks quite easily where you mix code together from multiple languages, e.g. here’s some Julia and python code together in an Org notebook.

Emacs has something called ‘hooks’ so I can just set say julia-mode hooks that activate certain functionality and extensions when I am in a julia context and python-mode hooks that activate other functionality in a python context.

E.g. when I open a .jl file, julia-mode automatically activates and then I have a hook that automatically activates julia-repl-mode which lets me easily send selected code to a repl. I mostly do interactive stuff in org-notebooks though while editing a .jl file side by side.

All that said, I can’t seriously recommend emacs unless you’re looking for a hobby (building up an emacs configuration) in addition to an IDE.

13 Likes

Kind of hard to recommend Atom as it gets abandoned, but I haven’t found anything I like nearly as much as Atom+Hydrogen for this purpose. As a bonus, you can use multiple languages in the same file by using Markdown and appropriately labeling your code blocks.

1 Like

Nah, that’s a problem with underspecifying your keybindings. You need to use something like in the gist linked here.

Also feel free to reach out on Slack or wherever and I’d be happy to help with that :slight_smile:

Edit: Oh, also, VSCode (well, the Julia extension) is much better about not initializing unneeded extensions and also limits (for better or worse) how “intrusive” a plugin can be, so in my experience it’s much better when developing in multiple languages at once.

3 Likes

@DNF I don’t know what is supposed to happen :). Just trying to figure out how people are or if they are, using a single IDE for multiple languages, specifically Python + Julia. Thus far I’ve struggled trying to configure either VSCode or Atom to do this politely. Considering using Atom for python and VSCode for Julia.

I figured it was an error for any dynamic language IDE to not support Ctrl+enter or Shift+enter to run a line of code and move the cursor to the next - but VSCode taught me that expectation is not shared by many people :shrug:.

@mason - I will look into Emacs this looks pretty nifty. My only concern is that learning Emacs might be as difficult as learning a new programming language.

@sswatson - I’m considering using Atom for python and VSCode for Julia too. Juno eats up python for me on ubuntu. I may try a fresh install again… Pre-Juno I used to use Julia and python together via Hydrogen and Atom at my last job. It was pretty slick - but those days seem gone? Does julia still support hydrogen kernels or did they break that apart?

@pfitzseb - not sure I understand. When I was trying to execute python code in a *.py file using VSCode with some of those bindings it was throwing errors left and right about it not being Julia code. Am I overthinking something, or is there an easy way to get VSCode to let me dynamically run python in *.py files, and dynamically run Julia in *.jl files? I’m willing to nuke my configurations entirely if this is actually possible. Otherwise I may just use 2 IDE’s…

1 Like

Sublime Text has keybindings divided according to the context. So they do different things in different source files.

1 Like

Does sublime text support live/interactive execution of code and plotting? I have it installed but never really used it because I couldn’t get those things to work.

Plotting certainly works, but it is not integrated into the IDE: you get the figures displayed in separate windows.
Live execution is certainly supported. But, if you need a debugger then spyder or PyCharms is better ( on the Python side).

Take a look at Doom or Spacemacs, using one of those ready-made configs can simplify things in the beginning and allow you to start working quickly.
Some people claim the only “true” way is to build your Emacs config from scratch, but I think starting with Doom is just fine.

It is true though that eventually one might want to pickup a bit of elisp to unlock the true power of Emacs.

3 Likes

Fortunately, Hydrogen just uses the standard Jupyter protocol for interacting with the kernel. All the kernels I’ve tried have worked fine, including Julia and Python, which I use regularly. I just installed this setup (Julia, Miniconda, Atom, Hydrogen) fresh on a new machine, and I can confirm that it all works smoothly with the latest versions of everything. You even get Unicode tab completions, etc., in the code blocks in a Markdown file.

That said, I feel you about bygone days. I can’t in good conscience encourage my students to use the same editor I use, for example. But at the same time I’m not going to switch to VS Code while its Jupyter situation is still a mess, and it doesn’t seem plausible that Atom or Hydrogen would stop working anytime soon.

1 Like

I’ve sort of almost come to a solution in VSCode…

  • Basically rip out all custom stuff uninstall all extensions
  • install Python (microsofts) extension, and code runner.
  • set the environment to not the Julia’s conda, but the py conda
  • install Julia Language support extension
  • change julia lang’s extension to point exactly to the Julia executable.

So this will run python reliably. But will fail on the first code execution of Julia because conda tries to activate ie:

source /home/username/miniconda3/bin/activate
ou3-elementr cArraye{ Int64/,h1o}m:e
/ us1er
na2me
/ mi3nic 
julia> source /home/username/miniconda3/bin/activate
ERROR: 
UndefVarError: source not defined

So who knows what that error is but as usual nuking everything sometimes kind of helps?

VS Code has language- and extension-specific preferences, which solves pretty much all your troubles. If you want to “add” another language to it, you just install an extension and set custom preferences for the language.

3 Likes

Although that is true, it’s apparently not that easy. For example, can you tell me how to get rid of the error in my last post?

It seems to be getting closer. At this point the only issue I know of is that the variable explorer. https://github.com/microsoft/vscode-python/issues/5078#issuecomment-683910271

Installing a package called “python” isn’t ideal, but I would be surprised if eventually they will don’t split the extensions.

So try it ams submit bugs. The team is dedicated to better non-python language support.

1 Like

You can put these in your VSCode keybindings and you’ll get the behavior you want and they won’t apply to Python files.

    {
        "key": "ctrl+enter",
        "command": "language-julia.executeCodeBlockOrSelection",
        "when": "editorTextFocus && editorLangId == 'julia'"
    },
    {
        "key": "shift+enter",
        "command": "language-julia.executeCodeBlockOrSelectionAndMove",
        "when": "editorTextFocus && editorLangId == 'julia'"
    },

The Python VSCode extension supports its own evaluation type thing, although I don’t know that anything exists quite as nice as the Julia’s VSCode inline evaluation (in any editor that I’ve found, for that matter).

3 Likes

It’s more complicated — the problem is that diving into Emacs is itself a somewhat engaging activity with concrete payoffs that help rationalizing it. So you customize your environment to be able to work faster, and then notice that 2 hours have passed without doing any actual work.

That said, I highly recommend investing into Emacs. It has been around for 4+ decades now, so it is probably here to stay, available on all modern platforms, and most languages have an Emacs mode, at least for editing code.

9 Likes

Thanks for the update! It was helpful reading the newer messages on that thread (which I read originally a few months ago).

At the end, rchiodo says “I believe we’re looking into making a ‘jupyter’ extension. This is at least being discussed. Ideally it would be language neutral…”. That’s good news.

2 Likes