We look into a few commands, shortcuts and crannies that the Julia REPL has so that you can turn your coding up to eleven. Abbreviated script is at the end of this post.
Package shoutouts:
Highly recommended for deep diving into Julia: Developing Julia Workflow by Chris Rackauckas
[ Ссылка ]
Kristoffer Carlsson and OhMyREPL.jl and BenchmarkTools.jl - [ Ссылка ]
OhMyREPL added cool colors to the REPL, smart pasting so as to not deal with `julia` when copy/pasting code.
Mason Protter and REPLMaker.jl - [ Ссылка ]
REPLMaker guides you into making your own REPL, so that you can punch in a special character and get your own behavior.
Niklas Korsbo and Latexify.jl - [ Ссылка ]
Latexify all the things!
Keno Fischer and Cxx.jl - [ Ссылка ] (This will work soon I promise! I failed live but it is a really cool package!)
Interoperability package to call C++ almost natively from within Julia, with a REPL mode to boot.
These are not the only contributors for most of these packages (or Base Julia), so all credit to those who worked hard and have made Julia an awesome working experience
---
Feel like watching more coding, learning Julia, or knowing about open source contributing?
All are welcome!
Join us on twitch.tv/brainrpg! -- Watch live at [ Ссылка ]
---------
Script:
Raz's REPL Productivity hacks v1.0
0. If you've banged your head on something that should be easy, breathe, take a break, walk around, ask a friend, ask Discourse, Slack, Stack Overflow with a Minimum Working Example, be kind, get some sleep, rinse, repeat.
1. Get help with `?`
1.5 Try it! ?parse, ?@time, ?Core, ?OhMyREPL
2. apropos("parse")
3. apropos(TAB - Should autocomple possible calls.
some library, and you want to see what exists
(Damn, missed this in the video. Press MODULE.TAB to explore all the exported stuff! Try LinAlg.TAB
4. methodswith(IO) to know what shenanigans a package is up to with a type
5. Emojis and autocompletion! \:TAB and \alpTAB to kick it off
6. versioninfo(verbose=true)
7. Create MWE example for others to help you!
7.05 use OhMyREPL, for colors and smart pasting!
7.1 Macros and friends!
using @btime
@code_lowered
@code_warntype
@code_llvm
@code_native (Homework: look at the docstrings for some extra cool displays)
7.5 . Paste it into your clipboard with clipboard("\:hankeyTAB") credit to @alexarslan
using Latexify - super cool!
add Cxx.jl
nothing special is going on, you can hack into it if you want to - like with REPLMaker.jl!
a = [:(cos\phi) :(sin\phi)]
latexify(a)
copy_to_clipboard(true) // the realest of combos
8. Enter the shell mode by pressing `;` as the first character in a REPL line
readdir()
cd()
pwd()
6. Go back up with UP/DOWN (useful for presentations)
11. ans -and typeof(ans) (remember, this only works in the REPL. Jupyter/Atom/IDE won't use an `ans` from a script
11.5. Move around with Alt+enter, shift lines with alt+UP/DOWN for ultimate mastery
8. CTRL+r will give you some history look back
12. number and stacktrace and ^Q for quick editing. If using Revise, super haxxorz boosting
13. Setup your revise from Revise.jl, and setup other packages - turn banner on/off
14. Pkg repl - add OhMyTAB to autocomplete
miguelraz.github.io
Ещё видео!