# Boot.jl – An attempt at loading folders

**URL:** https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681
**Category:** General Usage
**Tags:** package
**Created:** [December 10, 2017, 7:34pm UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681 "2017-12-10T19:34:37Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [December 10, 2017, 7:34pm UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/1 "2017-12-10T19:34:37Z")

</div>

Wrote a package after thinking about [Packages, modules, and files](https://discourse.julialang.org/t/packages-modules-and-files/7652/1).

The main goal was:

- to ease the burden of loading files
- with robust recursive `includes` over package subdirectories  
  

> **[GitHub - djsegal/Boot.jl: Tool for bootloading Julia packages 📦](https://github.com/djsegal/Boot.jl)**
>
> Tool for bootloading Julia packages 📦

* * *

### Example from Readme

Transforms:

```julia
module Foo

  include("int.jl")
  include("float.jl")

  include("ops/plus.jl")
  include("ops/minus.jl")
  include("ops/times.jl")
  include("ops/divide.jl")

  include("ops/calc/int.jl")
  include("ops/calc/diff.jl")

end

```

Into:

```julia
module Foo

  using Boot

  include_folder(Foo, @ __FILE__ )

end

```

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [December 10, 2017, 10:48pm UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/2 "2017-12-10T22:48:19Z")

</div>

I tried it:

```julia
julia> using JuAFEM
INFO: Precompiling module JuAFEM. 
WARNING: Method definition _get_gauss_tridata(Int64) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Quadrature/gaussquad_tri_table.jl:5 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Quadrature/gaussquad_tri_table.jl:5.
WARNING: Method definition _get_gauss_tetdata(Int64) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Quadrature/gaussquad_tet_table.jl:3 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Quadrature/gaussquad_tet_table.jl:3.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Function, Base.Set{Int64}, Symbol, Array{Int64, 1}, Int64) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: replacing docs for 'JuAFEM.DirichletBoundaryCondition :: Union{}' in module 'JuAFEM'.
WARNING: replacing docs for 'JuAFEM.CellValues :: Union{}' in module 'JuAFEM'.
WARNING: Method definition (::Type{JuAFEM.CellScalarValues{dim, T<:Real, refshape<:JuAFEM.AbstractRefShape}})(Any, Any, Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44.
WARNING: replacing docs for 'JuAFEM.FaceValues :: Union{}' in module 'JuAFEM'.
WARNING: Method definition (::Type{JuAFEM.UpdateFlags})(Bool, Bool, Bool) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3.
WARNING: Method definition (::Type{JuAFEM.UpdateFlags})(Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3.
WARNING: Method definition (::Type{JuAFEM.UpdateFlags})() in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:8 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:8.
WARNING: Method definition Type(Array{Any, 1}, Type{JuAFEM.UpdateFlags}) in module JuAFEM overwritten.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Function, Base.Set{Int64}, Symbol, Array{Int64, 1}, Int64) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: replacing docs for 'JuAFEM.DirichletBoundaryCondition :: Union{}' in module 'JuAFEM'.
WARNING: replacing docs for 'JuAFEM.CellValues :: Union{}' in module 'JuAFEM'.
WARNING: Method definition (::Type{JuAFEM.CellScalarValues{dim, T<:Real, refshape<:JuAFEM.AbstractRefShape}})(Any, Any, Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44.
WARNING: replacing docs for 'JuAFEM.FaceValues :: Union{}' in module 'JuAFEM'.
WARNING: Method definition (::Type{JuAFEM.FaceScalarValues{dim, T<:Real, refshape<:JuAFEM.AbstractRefShape}})(Any, Any, Any, Any, Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/face_values.jl:47 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/face_values.jl:47.
WARNING: replacing docs for 'JuAFEM.CellValues :: Union{}' in module 'JuAFEM'.
WARNING: Method definition (::Type{JuAFEM.CellScalarValues{dim, T<:Real, refshape<:JuAFEM.AbstractRefShape}})(Any, Any, Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44.
WARNING: replacing docs for 'JuAFEM.FaceValues :: Union{}' in module 'JuAFEM'.
WARNING: Method definition (::Type{JuAFEM.FaceScalarValues{dim, T<:Real, refshape<:JuAFEM.AbstractRefShape}})(Any, Any, Any, Any, Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/face_values.jl:47 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/face_values.jl:47.
/Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl
WARNING: replacing docs for 'JuAFEM.CellValues :: Union{}' in module 'JuAFEM'.
WARNING: Method definition (::Type{JuAFEM.CellScalarValues{dim, T<:Real, refshape<:JuAFEM.AbstractRefShape}})(Any, Any, Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44.
ERROR: LoadError: LoadError: UndefVarError: QuadratureRule not defined
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:576
 [2] include(::String) at ./sysimg.jl:14
 [3] #include_folder#14(::Bool, ::Array{Any,1}, ::Function, ::Module, ::String) at /Users/kristoffer/.julia/v0.6/Boot/src/include_folder.jl:63
 [4] include_folder(::Module, ::String) at /Users/kristoffer/.julia/v0.6/Boot/src/include_folder.jl:3
 [5] include_from_node1(::String) at ./loading.jl:576
 [6] include(::String) at ./sysimg.jl:14
 [7] anonymous at ./<missing>:2
while loading /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl, in expression starting on line 53
while loading /Users/kristoffer/Dropbox/julia/JuAFEM/src/JuAFEM.jl, in expression starting on line 33
ERROR: Failed to precompile JuAFEM to /Users/kristoffer/.julia/lib/v0.6/JuAFEM.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:710
 [2] _require(::Symbol) at ./loading.jl:497
 [3] require(::Symbol) at ./loading.jl:405

```

This also seems to take significantly longer time than manual includes. Perhaps this is because the functions are parsed, and instantiated multiple times, as shown by the overwrite warnings.

> [@djsegal](#):
>
> then you have to clear botched types, functions, etc. before reloading files

There is currently no reliable way to delete methods in Julia.

I don’t really see what problem this package is trying to solve?

Having a package that rewrite your sources to insert the necessary includes seems like a better approach instead of doing it dynamically every time the package is loaded.

---

<div class="post-metadata">

### Author: ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)
#### Post date: [December 11, 2017, 7:08am UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/3 "2017-12-11T07:08:30Z")

</div>

> [@kristoffer.carlsson](#):
>
> Having a package that rewrite your sources to insert the necessary includes seems like a better approach instead of doing it dynamically every time the package is loaded.

Although one of the things that i love about Julia is that I _don’t_ need to run any separate scripts that pre-process my code…

---

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [December 11, 2017, 7:53am UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/4 "2017-12-11T07:53:44Z")

</div>

The reason you got an error is because you didn’t remove all your include statements.

- [JuAFEM.jl part 1](https://github.com/KristofferC/JuAFEM.jl/blob/70447343a5b74360f330f4581a1fdfc3df22e0b3/src/JuAFEM.jl#L11)
- [JuAFEM.jl part 2](https://github.com/KristofferC/JuAFEM.jl/blob/70447343a5b74360f330f4581a1fdfc3df22e0b3/src/JuAFEM.jl#L30-L61)
- [quadrature.jl](https://github.com/KristofferC/JuAFEM.jl/blob/70447343a5b74360f330f4581a1fdfc3df22e0b3/src/Quadrature/quadrature.jl#L1-L3)

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [December 11, 2017, 8:24am UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/5 "2017-12-11T08:24:01Z")

</div>

Cheers, removing the extra include statement makes it load properly. I’m still seeing a 40% extra precompilation time and a ~300% load time after precompilation:

pre:

```julia
julia> tic(); using JuAFEM; print(""); toc()
elapsed time: 1.845756564 seconds
1.845756564

```

post:

```julia
julia> tic(); using JuAFEM; print(""); toc()
WARNING: Method definition Type(Array{Any, 1}, Type{JuAFEM.UpdateFlags}) in module JuAFEM overwritten.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Function, Base.Set{Int64}, Symbol, Array{Int64, 1}, Int64) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Function, Base.Set{Int64}, Symbol, Array{Int64, 1}, Int64) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: Method definition (::Type{JuAFEM.DirichletBoundaryCondition})(Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/Dofs/DirichletBoundaryConditions.jl:43.
WARNING: Method definition (::Type{JuAFEM.UpdateFlags})() in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:8 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:8.
WARNING: Method definition (::Type{JuAFEM.UpdateFlags})(Bool, Bool, Bool) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3.
WARNING: Method definition (::Type{JuAFEM.UpdateFlags})(Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/iterators.jl:3.
WARNING: Method definition (::Type{JuAFEM.CellScalarValues{dim, T<:Real, refshape<:JuAFEM.AbstractRefShape}})(Any, Any, Any, Any, Any, Any, Any) in module JuAFEM at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44 overwritten at /Users/kristoffer/Dropbox/julia/JuAFEM/src/FEValues/cell_values.jl:44.
elapsed time: 5.985319603 seconds
5.985319603

```

I also have some code that runs at “compile time”, i.e. when the file is included, to do some caching during precompilation. Will this caching run multiple times using this package?

Furthermore, it seems that if you have a syntax error in your file, or more precisely, if loading the file throws in any way, the file will just be ignored.

---

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [December 14, 2017, 11:02am UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/6 "2017-12-14T11:02:03Z")

</div>

Just reimplemented the core of [Boot.jl](https://github.com/djsegal/Boot.jl) from scratch.

It now uses Julia’s compiler to load every file dynamically. (and works pretty well on your project)

// at this point, it uses `eval` for loading all the parts, so file line information is currently lost

* * *

additionally, the compiler was only really tested on your code and my test suite.

therefore it will take some testing on other projects before it’s production ready.

(see this [file](https://github.com/djsegal/Boot.jl/blob/188a8b2781cade37a6671a5667898da4e243d798/src/clean_shard.jl#L87-L92) to get a gist of what probably will explode on new projects)

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [December 14, 2017, 11:18am UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/7 "2017-12-14T11:18:24Z")

</div>

Yes, tried with Tensors.jl:

```julia

julia> @time using Tensors
INFO: Precompiling module Tensors.
WARNING: eval from module Boot to Tensors:
quote Expr(:line, 3, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to Tensors:
quote Expr(:::, :v, :T)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to Tensors:
quote Expr(:<:, :T, :Real)::Any end
  **incremental compilation may be broken for this module**

ERROR: LoadError: Unable to determine what to do with node of type: <:
Stacktrace:
 [1] clean_shard(::Expr) at /Users/kristoffer/.julia/v0.6/Boot/src/clean_shard.jl:90
 [2] clean_shard(::Expr) at /Users/kristoffer/.julia/v0.6/Boot/src/clean_shard.jl:62
 [3] clean_shard(::Expr) at /Users/kristoffer/.julia/v0.6/Boot/src/clean_shard.jl:36 (repeats 5 times)
 [4] clean_shard(::Expr) at /Users/kristoffer/.julia/v0.6/Boot/src/clean_shard.jl:22 (repeats 2 times)
 [5] attempt_file_load(::Module, ::Dict{AbstractString,Any}) at /Users/kristoffer/.julia/v0.6/Boot/src/attempt_file_load.jl:31
 [6] #include_folder#3(::Bool, ::Array{Any,1}, ::Function, ::Module, ::String) at /Users/kristoffer/.julia/v0.6/Boot/src/include_folder.jl:58
 [7] include_folder(::Module, ::String) at /Users/kristoffer/.julia/v0.6/Boot/src/include_folder.jl:5
 [8] include_from_node1(::String) at ./loading.jl:576
 [9] include(::String) at ./sysimg.jl:14
 [10] anonymous at ./<missing>:2
while loading /Users/kristoffer/Dropbox/julia/Tensors/src/Tensors.jl, in expression starting on line 117
ERROR: Failed to precompile Tensors to /Users/kristoffer/.julia/lib/v0.6/Tensors.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:710
 [2] _require(::Symbol) at ./loading.jl:497
 [3] require(::Symbol) at ./loading.jl:405

```

On JuAFEM I get:

```julia
julia> using JuAFEM
INFO: Precompiling module JuAFEM.
WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 6, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:::, :quad_type, :Symbol)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:::, :order, :Int)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 7, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:if, Expr(:call, :==, :quad_type, :legendre)::Any, Expr(:block, Expr(:line, 8, :none)::Any, Expr(:tuple, :p, :w)::Any = Expr(:call, Expr(:., :GaussQuadrature, :legendre)::Any, :Float64, :order)::Any)::Any, Expr(:block, Expr(:line, 9, :none)::Any, Expr(:if, Expr(:call, :==, :quad_type, :lobatto)::Any, Expr(:block, Expr(:line, 10, :none)::Any, Expr(:tuple, :p, :w)::Any = Expr(:call, Expr(:., :GaussQuadrature, :legendre)::Any, :Float64, :order, Expr(:., :GaussQuadrature, :both)::Any)::Any)::Any, Expr(:block, Expr(:line, 12, :none)::Any, Expr(:call, :throw, Expr(:call, :ArgumentError, "unsupported quadrature rule")::Any)::Any)::Any)::Any)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 14, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:curly, :Vector, :Float64)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 15, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 16, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote :count = 1 end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 17, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:->, :j, Expr(:block, Expr(:line, 17, :none)::Any, Expr(::, 1, :order)::Any)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 18, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 18, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 19, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:ref, :points, :count)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 20, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote :weight = 1 end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 21, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:->, :j, Expr(:block, Expr(:line, 21, :none)::Any, Expr(:*=, :weight, Expr(:ref, :w, Expr(:curly, :i_, :j)::Any)::Any)::Any)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 22, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:ref, :weights, :count)::Any = :weight end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 23, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:+=, :count, 1)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 25, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 4, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:::, :quad_type, :Symbol)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:::, :order, :Int)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 5, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:call, :==, :quad_type, :legendre)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:block, Expr(:line, 6, :none)::Any, :data = Expr(:call, :_get_gauss_tridata, :order)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 7, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:call, :==, :quad_type, :legendre)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:block, Expr(:line, 8, :none)::Any, :data = Expr(:call, :_get_gauss_tetdata, :order)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:block, Expr(:line, 10, :none)::Any, Expr(:call, :throw, Expr(:call, :ArgumentError, "unsupported quadrature rule")::Any)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 12, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote :n_points = Expr(:call, :size, :data, 1)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 13, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 15, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote :p = Expr(::, 1, Expr(:call, :size, :data, 1)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 16, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:ref, :points, :p)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:->, :i, Expr(:block, Expr(:line, 16, :none)::Any, Expr(:ref, :data, :p, :i)::Any)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 18, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 19, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:block, Expr(:line, 10, :none)::Any, Expr(:macro, Expr(:call, :debug, :ex)::Any, Expr(:block, Expr(:line, 11, :none)::Any, Expr(:return, :nothing)::Any)::Any)::Any)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 6, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:., :Base, :copy)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:line, 7, :none)::Any end
  **incremental compilation may be broken for this module**

WARNING: eval from module Boot to JuAFEM:
quote Expr(:call, :typeof, :cv)::Any end
  **incremental compilation may be broken for this module**

```

---

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [December 17, 2017, 9:27pm UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/9 "2017-12-17T21:27:45Z")

</div>

Hi @kristoffer.carlsson, can you try the master branch on Tensors.jl and JuAFEM.jl again?

I think I got it working. You might need to clear the precompiled cache first though:

```julia
map(rm, Base.find_all_in_cache_path(:Tensors))
map(rm, Base.find_all_in_cache_path(:JuAFEM))

```

// also, thanks to @vchuravy for that clear cache command!

---

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [December 17, 2017, 11:24pm UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681/10 "2017-12-17T23:24:39Z")

</div>

Wrote up a quick gist with performance changes:

- [https://gist.github.com/djsegal/917aaea4960b33f9af41c3eac36c2125#gistcomment-2295061](https://gist.github.com/djsegal/917aaea4960b33f9af41c3eac36c2125#gistcomment-2295061)

* * *

Main conclusion was that:

- Using `Boot.jl` led to `~40%` slower (initial) compilation times for both packages
- But did not alter performance in either package for subsequent reloads

// further, each package was only ~25% slower when adjusting for the compile time of `Boot.jl` itself

However, this did not attempt to use `Boot.jl` style loading for both `JuAFEM` and (its `REQUIRE`’d) `Tensors` at the same time. (which would likely change the results)
