David Amos Profile picture
Feb 22 β€’ 14 tweets β€’ 4 min read
The #JuliaLang REPL is amazing.

Here are 3 things I love about it:
1/ The Built-in Package Manager

With the Julia REPL open, press the right square bracket ] to drop into the π™Ώπš”πš REPL where you can install packages and manage Julia environments.

There's no need to install a separate package manager. It comes with every Julia install.
The support for Julia environments is one of my favorite parts. Inside the π™Ώπš”πš REPL, type:

πšŠπšŒπšπš’πšŸπšŠπšπšŽ /πš™πšŠπšπš‘/𝚝𝚘/πšŽπš—πšŸπš’πš›πš˜πš—πš–πšŽπš—πš

to activate the environment at the path, or create a new one if it doesn't exist.
You can even quickly create a temporary environment using

πšŠπšŒπšπš’πšŸπšŠπšπšŽ --πšπšŽπš–πš™

Now you can install packages and try things out. The temporary environment gets removed when you exit the Julia REPL.
If you want to learn more about π™Ώπš”πš and Julia environments, here are two great resources:

πŸ“ blog.devgenius.io/the-most-under…

πŸŽ₯
2/ Editor integration

Set the π™Ήπš„π™»π™Έπ™°_π™΄π™³π™Έπšƒπ™Ύπš environment variable to the path to your favorite code editor and now you can use the built-in πšŽπšπš’πš() function from the REPL and do one of three things:
1️⃣ Pass a string with a file path to πšŽπšπš’πš() to open the file at that path in your editor.

2️⃣ Give πšŽπšπš’πš() a function name to open the function definition in your editor.

3️⃣ Give πšŽπšπš’πš() a module name to open the module definition in your editor.
To really take things up a notch, you can install πšπšŽπšŸπš’πšœπšŽ.πš“πš• to bring automatic reloading on files, modules, and even packages to the REPL. This enables some truly productivity-enhancing workflows.

github.com/timholy/Revise…
For example, you can do things like:

Write a function in a .jl file ➑ test the function in the REPL ➑️ make a change to the function definition in your editor ➑️ test the redefined function in your REPL

All without ever restarting Julia!
3/ Jump straight to code from a stack trace

You can quickly jump to any line of code that appears in a stack trace by typing the stack trace line number followed by π™²πšπš›πš• + πš€.
For example, say you see a stack trace that looks like this:
Type 𝟷 into the prompt followed by π™²πšπš›πš• + πš€ and your editor opens to the right line of code:
Keep in mind that you need to have the π™Ήπš„π™»π™Έπ™°_π™΄π™³π™Έπšƒπ™Ύπš environment variable set in order for this to work, just like you need to in order to use πšŽπšπš’πš().
These are just some of the things you can do in the Julia REPL. There are so many more!

Fortunately, @miguelraz_ put together a whole bunch of Julia REPL productivity hacks in a video. I highly recommend watching it:

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with David Amos

David Amos Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @somacdivad

Feb 9
Today's #JuliaLang doodle with Javis.jl is recreating a classic...
Look closely at the circles. Are the curving at all?

Here's the code:

(I'm sure there's a better way to do this, I just haven't completely figured out Javis yet!)
I think disks work better than circles for this:
Read 8 tweets
Feb 8
A Tale of Two NaNs (A #Python 🧡)

(Plus a bonus experiment in Twitter fonts that may end disastrously)
NaNs are annoying.

You can’t tell if they’re in a list:

>>> πšπš•πš˜πšŠπš(β€œπš—πšŠπš—β€) πš’πš— [𝟷, 𝟸, πšπš•πš˜πšŠπš(β€œπš—πšŠπš—β€)]
π™΅πšŠπš•πšœπšŽ
You can end up with more than one NaN in a set:

>>> πš‚ = {𝟷, 𝟷, πšπš•πš˜πšŠπš(β€œπš—πšŠπš—β€), πšπš•πš˜πšŠπš(β€œπš—πšŠπš—β€)}
>>> πš‚
{𝟷, πš—πšŠπš—, πš—πšŠπš—}

But they also aren’t π˜ͺ𝘯 the set:

>>> πšπš•πš˜πšŠπš(β€œπš—πšŠπš—β€) πš’πš— πš‚
π™΅πšŠπš•πšœπšŽ
Read 17 tweets
Feb 8
I've learning to make animations with Javis.jl and came up with this little doodle tonight. Nothing fancy, just getting my feet wet!
And here's the code: Image
Colors make it better
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(