Author Archives: Julia on EPH

Julia’s package registration tooling

By: Julia on EPH

Re-posted from: https://ericphanson.com/blog/2024/julias-package-registration-tooling/

Julia has a large ecosystem of over 10,000 registered packages in it’s “General” open-source package registry.

Package registration is mostly automated, but it can be hard to understand how all the various bits fit together. There are some helpful resources and tutorials on how to create and register a package, such as

and I won’t provide a step-by-step tutorial here. Instead, I aim to provide a point-in-time snapshot of many of the different pieces of tooling currently used in the Julia package registration system, and explain how they work together. I will also try to mention how they can be applied to alternative registries beyond General.

Why you might avoid `deepcopy` in Julia

By: Julia on EPH

Re-posted from: https://ericphanson.com/blog/2024/why-you-might-avoid-deepcopy-in-julia/

Why use deepcopy? In Julia, copy is a function which creates a shallow copy. For example:
julia> a = [1] # vector with one element, namely 1 1-element Vector{Int64}: 1 julia> b = [a] # vector with one element, `a` 1-element Vector{Vector{Int64}}: [1] julia> b2 = copy(b) # new vector, also with one element which is `a` 1-element Vector{Vector{Int64}}: [1] julia> push!(a, 2) # mutate `a` so it contains 1 and 2 2-element Vector{Int64}: 1 2 julia> b # since `b` contains `a`, we can see its (nested) contents have changed 1-element Vector{Vector{Int64}}: [1, 2] julia> b2 # same for `b2`!

Learning algorithmic techniques: dynamic programming

By: Julia on EPH

Re-posted from: https://ericphanson.com/blog/2019/learning-algorithmic-techniques-dynamic-programming/

Three nice techniques In the past months, I’ve found myself really appreciating some nice techniques for constructing algorithms. These are probably quite familiar to those with a computer science background, but are new to me. There are three in particular that I have in mind; I’ll just highlight the first two here, and then discuss the third in detail.
The first such technique I learned about was solving the traveling salesman problem via mixed-integer programming, using lazy constraints.