My New Workflow with Julia 1.0

A practical guide to how you can work with Julia in a practical and effective manner.

Image for post
Image for post

Setting Up Your System

$ ln -s /Applications/Development/Julia-0.7.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia

Startup File

$ mkdir  -p .julia/config
$ touch .julia/config/startup.jl
push!(LOAD_PATH, "$(homedir())/Development/Julia")

Oh My REPL

$ julia
(v0.7) pkg>
(v0.7) pkg> add OhMyREPL
push!(LOAD_PATH, "$(homedir())/Development/Julia")
using OhMyREPL

Revise Package

(v0.7) pkg> add Revise

Writing Code and Package Management

(v0.7) pkg> generate PLists
(v0.7) pkg> generate Foobar
shell> cd Foobar
shell> cat Project.toml
authors = ["Erik Engheim <erik.engheim@earth.com>"]
name = "Foobar"
uuid = "641dae7e-b2eb-11e8-36b1-0d425f221c6d"
version = "0.1.0"
(v0.7) pkg> activate .
(Foobar) pkg> add TerminalMenus
shell> cat Project.toml
name = "Foobar"
uuid = "641dae7e-b2eb-11e8-36b1-0d425f221c6d"
authors = ["Erik Engheim <erik.engheim@mac.com>"]
version = "0.1.0"

[deps]
TerminalMenus = "dc548174-15c3-5faf-af27-7997cfbde655"
shell> cat Manifest.toml
[[TerminalMenus]]
deps = ["Compat", "REPL", "Test"]
git-tree-sha1 = "9ae6ed0c94eee4d898e049820942af21daf15efc"
uuid = "dc548174-15c3-5faf-af27-7997cfbde655"
version = "0.1.0"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
...
(Spam) pkg> add TerminalMenus

What is the Point of the Environments?

julia> using TerminalMenus

Practical Usage

julia> using Revise
julia> activate
(v0.7) pkg> activate .
julia> using Foobar

Working in Multiple Locations on a Package

$ git clone git@github.com:ordovician/PLists.jl.git PLists
$ cd PLists
$ julia
pkg> activate .
pkg> instantiate

Working on Multiple Dependent Packages

$ cd QtUIParser
$ julia
pkg> activate .
pkg> add https://github.com/ordovician/PLists.jl
$ git clone git@github.com:ordovician/PLists.jl.git SomeLocalPath/PLists
$ cd QtUIParser
$ julia
pkg> activate .
pkg> add SomeLocalPath/PLists
pkg> dev PLists
pkg> dev https://github.com/ordovician/PLists.jl

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store