[ANN] Juno 0.8

Hey folks,

Juno 0.8 is out – get it while it’s fresh!
While there of course have been loads of small bugfixes, the three stand-out features of this release are:

Debugger Integration


Juno now provides a fairly complete debugging experience, thanks to all the recent work on JuliaInterpreter.jl. Also see the recent blog post.

The API to access the debugger consists of

  • Juno.@run to run an expression and stop at any breakpoints, and
  • Juno.@enter to step into the function and start stepping on the first line.

There are UI elements for setting breakpoints

  • in files, by clicking the empty space left of the line numbers, or
  • when entering a function/method , by using the Break on... text box on the right – either enter a function name (e.g. sin) to set breakpoints for all methods of that function, or specify the argument types (e.g. sin(Int)).

These breakpoints are unconditional by default, but can be switched to conditional breakpints with the button on the right.

Important: If you want to set breakpoints in files you need to have loaded Revise.jl and Revise needs to be aware of the file in question. This means that you can only set breakpoints in your own scripts (that are not part of a package) if you have includet them.

Traceur.jl integration


This has been in Juno for a while now, but mostly hidden. Use Juno.@trace to get inline performance annotations for your functions, provided by Traceur.jl.

Weave.jl Integration

If you have Weave.jl and language-weave (as well as pdf-view for pdf previews) installed, you can weave a file to pdf or html with a single button press.

Installation

Important : Restart Atom before updating julia-client or ink and do not start a Julia session.
If that does not work, close all Atom instances and type

apm uninstall ink
apm install ink
apm uninstall julia-client
apm install julia-client

into a terminal.

As always, make sure all Julia and Atom packages are up-to-date.

89 Likes

Awesome!!

2 Likes

This is extraordinary, thank you!

Great!

This is amazing, thank you! The debugging interface is really slick.

I’m having an error setting breakpoints, and think I followed the installation instructions correctly. Updating packages within atom never works for me, so I closed Atom, used the command line to apm uninstall and apm install ink/julia-client, then started Atom, updated packages (Atom/Juno included), restarted Atom.

In this fresh session, I do using Revise; includet("my/file.jl"). When I try to set a breakpoint with alt-x, I get an Error in Debugger popup:

MethodError: no method matching haskey(::String, ::String)
Closest candidates are:
  haskey(!Matched::Base.Iterators.Pairs, ::Any) at iterators.jl:247
  haskey(!Matched::Dict, ::Any) at dict.jl:546
  haskey(!Matched::Base.ImmutableDict, ::Any) at dict.jl:731
  ...

Interestingly, actually setting a breakpoint and hitting it with Juno.@run seems to work just fine.
Did I mess up the install somehow?

The debugging interface is quite helpful for me. But I have faced a problem when I want to set a breakpoint in Atom:

Error in Debugger
no signatures found at …
Restarting and using Revise and the relevant package may fix this problem.

In fact, I do using Revise and use includet. Is there anything wrong with my Juno setting?

1 Like

I’d bet you’re running into a problem with mismatched package versions – you need to be on julia-client v0.8.1 and Atom.jl v0.8.2 for things to work. Also make sure you have saved your file before setting breakpoints.

In fact, I do using Revise and use includet. Is there anything wrong with my Juno setting?

Probably not. For some reason Revise doesn’t seem to know about the file you’re trying to set the breakpoint in. No idea why though.

I had the same problem and I think, if I am not mistaken, that Revise does not work on functions that were defined inside a script/global scope. The same worked when I set a breakpoint for a function inside a package.

1 Like

You need to use includet (note the t in the end) for Revise to track the file. This also enables line breakpoints in the file.

5 Likes

I am really confused.

To use breakpoint in a julia sourcecode, do I need to open revise.jl in Juno together with my source code? It says

Important : If you want to set breakpoints in files you need to have loaded Revise.jl and Revise needs to be aware of the file in question . This means that you can only set breakpoints in your own scripts (that are not part of a package) if you have includet them.

Please note: you need to have loaded Revise.jl

Where can I find the file Revise.jl on my file system?

Revise.jl is a package (https://github.com/timholy/Revise.jl). Add it with the package manager and load it.

3 Likes

the weave plugin works with .jl files? or only works with .jmd?

Thanks to @tim.holy we now have some fairly comprehensive docs for debugging in Juno:

Those should hopefully clear up some of the confusion about breakpoints etc.

the weave plugin works with .jl files? or only works with .jmd?

Weave definitely doesn’t work with .jl files, no. Take a look at the docs for more info.

9 Likes

Actually, weave itself works like a charm with .jl files (with extra syntax) like this: https://github.com/mpastell/Weave.jl/blob/master/examples/FIR_design.jl
Its not very well documented though.
I successfully used it in ParameterJuMP!
Just wanted to know if Juno could do the conversion from a properly written .jl file.

Ah, I see. It should work, and if it doesn’t then please open an issue.

Seems as if it’d be worth automatically calling includet when a breakpoint is set outside of a module with Revise loaded.

Can we use graphical breakpoints with debugger?

I’ve just created a file with a simple example:

using JuliaInterpreter
using Revise

x = [1,2,3,4,5]

function foo(x)
    x = abs(x)
    Main.JuliaInterpreter.@bp
    y = 3 *x + 1
    return y
end

Juno.@run foo(3)

And this works fine, but when I paste graphical breakpoint, I get error message:

no signatures found at ...\test.jl, 7.
Restarting and `using Revise` and the relevant package may fix this problem.

Don’t get it but my Atom seems to be always (half)broken. I have Uber-Juno installed and .jl files are rcognised as Julia files but there is no “Packages->Julia”, nor Ctrl-j, Ctrl-o open any console.

The easiest way to make sure Revise is running is to put using Revise in your .julia/config/startup.jl file. More information can found in the Revise docs. Revise typically runs in the background—you do should not say using Revise in ordinary packages.

Once you have this setup, you should not generally need @bp; instead, just click in the leftmost column of the source display, as those docs that @pfitzseb linked explain.

1 Like

Thanks, I’ve added using Revise to my startup.jl
The debug example from docs is working.
If I just create a .jl file with a function, then run it, then using Juno.@enter, debugger buttons, etc. - it works just like in the docs.
But trying to set a breakpoint at the next row still throws that error message.

UPD: Problem solved - I had to I includet that file in the console to get working graphical breakpoints.