Skip to content

Instantly share code, notes, and snippets.

@epogrebnyak
Last active December 3, 2018 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epogrebnyak/fd622f9a2b8f3f3ee0e3233abf29776d to your computer and use it in GitHub Desktop.
Save epogrebnyak/fd622f9a2b8f3f3ee0e3233abf29776d to your computer and use it in GitHub Desktop.
Julia programming language: surprises and learning tips

Julia enforces a special model for project structure, yet it is not immidiately evident from documentation. I could discover it better by reviewing some existing github repositories, eg Turing.jl.

Folder structure looks like this:

src
  Turing.jl
  models
     Distributions.jl

Turing.jl is head module for the project, it will be importable whenever you use this package: using Turing or import Turing will import Turing.jl, in slightly different ways though.

Turing.jl will use the code of Distributions.jl via including the text of the code with include("models/Distributions.jl")

Hidden rules are:

  1. project has a src folder
  2. <Modulename>.jl should be in that folder
  3. <Modulename>.jl may include code of other modules in the src subfolder
  4. module subfolders seem do not interact with one another
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment