What are packages all Julian users should know about regardless of their area of application because they make using Julia easier?
Here is a list of a few I know of.
- Revise (makes your repl immediately aware of edits to your code)
- Infiltrator (this is a full speed conditional breakpoint inspector… You can dump data values from the running instance etc)
- PackageTemplates (Makes creating a new package easier, sets up a directory structure and such)
- AbbreviatedStackTraces (filters out library code from stack traces, making it easier to focus on bugs in your own code)
- OhMyREPL (Provides syntax hilighting and related stuff in the REPL, making it easier to balance parens etc)
- MacroTools (Abstracts away common patterns of walking through code trees, making writing macros much easier)
- JET (A static type analysis / linter which helps create type stable code)
- Cthulhu (a kind of interactive inspector of code type stability issues)
These are all very useful no matter what kind of problem you work on because they are about solving core Julia code development issues.
Please add more!
LiveServer (it’s servedocs function makes it really easy to edit and see package docs locally before releasing)
TestItems (with VSCode is a game changer for unit testing).
How about TreeView.jl for visualizing expressions, debugging macros etc. This prints nice text trees of code expressions.
And maybe CSE.jl for automatically optimizing naive macro output? This does common subexpression elimination, so that you don’t evaluate things multiple times.
All relevant for doing fast math operations. Tullio is for fast tensor contraction type operations using Einstein notation, can make what would normally be two or three level nested loops into a single line of code and with fast threading and vectorized instructions etc
Loop vectorization handles using advanced SIMD type instructions in loops, speeding up execution, is used by Tullio afaik.
LazyArrays goes in a different direction, it can reduce memory footprint of large array calculations by avoiding to store intermediate values etc. You can write code as if you had big arrays in memory but they will be calculated on the fly rather than stored.
BenchmarkTools is huge! Can’t believe I forgot that one.
It’s the canonical way to figure out how fast functions are, runs code multiple times, computes useful statistics and avoids misleading compile overhead.
Accessors.jl is a way to create a new immutable struct whose entries are all the same as a given template struct except those values you want changed and give a new value for. Let’s you easily use a “mutable style” to your code.
How About choose your favorite profiling viewer
For viewing the results of running the statistical profiler in Julia, shows you where your code is spending it’s time, let’s you dive into details.
PProf.jl, to add to the profile viewer list. Especially for the new allocation profiling.
A pretty obvious one - Documenter.jl
Parameters.jl is pretty common.
SnoopCompile.jl seems to be getting more important with every version, so will belong on this list soon if it’s not already on.
I’m not sure how widespread Aqua.jl is in use, but I do want to mention a code quality related package, and that seems a good choice.
And Requires.jl is an important one to know. Even if the current practice is to try to avoid it where possible, a lot of existing code does make use of
Sorry should have been DataStructures.jl
This provides a big list of standard data structures and related algorithms like what you might find in a college course on data structures and algorithms. So if you need to implement a set of objects or a queue or priority queue or circular buffers or etc don’t reimplements with bugs just go to the standard place
Transducers Home · Transducers.jl
This implements a kind of pipeline of efficient operations on data, with possibilities for multi threading and other very good composable properties.
Memoization Memoization · Julia Packages to avoid recomputing expensive functions. Particularly good if you are computing values of a function as some new update to an earlier computed function.
And probably one of the advanced threading libraries, but what’s the right one?
Could you please provide a summary for each recommended package saying why “they make Julia easier to use”. A sales pitch to motivate potential users. Thanks.
Yes good idea! I will do that.
Allows to reduce latency of commonly used package / workflow first execution by storing Julia’s state in so called “sysimage”.
Also permit to compile julia application executable without Julia installed, and make relocatable C librairies bundle form of Julia code
Of very worthy note is StaticArrays.jl. This package allows for small, statically sized arrays. Because their size is known at compile time all sorts of optimisations and efficiencies kick in. Linear algebra operations, for example, are customised at compile time for the specific size of your matrix or array. For me, however, the biggest win is that static arrays are
isbits, meaning these will be allocated on the stack not the heap, so these are ideal for cases where you’re working with small arrays of a known size in hot loops. And since they’re
isbits they can also be assigned as elements of much larger arrays (arrays of arrays). Finally, special mention of the FieldArray type for adding static arrays magic to your own data types.
PkgDependency.jl and AutoSysimages.jl are recent favorites for me:
The former is really helping me track down indirect dependencies that are heavy and were added by 3rd-party packages without second thoughts. The latter is trying to address our biggest technological issue for wider adoption of the language.
CodeTracking.jl Seems to be pretty useful, it will show you the text of the code for a given function.
PrettyTables and Term are two general purpose packages that can beautify output.