Skip to content

Instantly share code, notes, and snippets.

@pfitzseb
Created February 12, 2019 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfitzseb/3ce6151d0507c3061ce164838c6577ab to your computer and use it in GitHub Desktop.
Save pfitzseb/3ce6151d0507c3061ce164838c6577ab to your computer and use it in GitHub Desktop.
Juno Demo
# Juno
# http://junolab.org/
# http://docs.junolab.org/latest/man/installation.html
## Inline Evaluation
1+1
println(2+2)
rand(3)
structure(:(f(x,y)))
# important: Evaluation is module-aware (see lower right corner for currently active module)
## Cell Evaluation
println("Cell 1")
x = 1+1
x^2
## Smart backtraces
f(x, y) = g(x, y)
g(x, y) = x//y
f(0, 0)
## (Reasonably) smart autocompletions (IntelliSense-like)
"""
method 1
"""
foo(x::Int) = x
"""
method 2
"""
foo(x::Int, y::Float64) = x*y
foo() # return type, method completions etc:
show()
## Documentation, Go To Definition
show # Ctrl-J Ctrl-D, Ctrl-J Ctrl-G
## Profiling
function myfunc()
A = rand(200, 200, 400)
maximum(A)
end
myfunc()
@profiler myfunc()
## Stepping into functions (with https://github.com/JuliaDebug/ASTInterpreter2.jl):
@enter gcd(2, 3)
## Performance linting with Traceur.jl (https://github.com/JunoLab/Traceur.jl)
function naive_sum(xs)
s = 0.0
for x in xs
s += x
end
return s
end
Atom.@trace naive_sum(rand(3))
## Integrated Plot Pane
using Plots
plot(rand(300))
# Other goodies:
# - Completly functiousing Atom; using Juno; Juno.connect(43239)nal REPL
# - Can open arbitrary terminals in Juno (with search)
# - Remote Connection built in
# - Loads of settings for customization
# - REPLTreeViews.jl
# - Weave integration
## Questions?
# Why not LSP-backed?
# Multi-Monitor setups?
# Autoformatter/code beautifier?
using JSON
json"{a:1}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment