# Experience report after finishing a (reasonably substantial) Julia project in 2024

**URL:** <https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148>\
**Category:** Community\
**Created:** [April 18, 2024, 2:17pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148 "2024-04-18T14:17:29Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 18, 2024, 4:23pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/24 "2024-04-18T16:23:03Z")

</div>

> [@rongcuid](#):
>
> Maybe it will work. Not sure if it works for VSCode REPL.

It does.

Another alternative is to create a shared environment that contains the project-specific development dependencies, with, for example:

```julia-repl
(MyProject) pkg> # MyProject environment activated 

(MyProject) pkg> activate --shared MyProjectDevelopment
  Activating new project at `~/.julia/environments/MyProjectDevelopment`

(@MyProjectDevelopment) pkg> add StaticArrays
   Resolving package versions... 
   (...)

julia> using StaticArrays # MyProjectDevelopment activated here

(@MyProjectDevelopment) pkg> activate . # activate MyProject
  Activating new project at `~/Downloads/MyProject`

julia> x = SVector(1,1) # StaticArrays is available
2-element SVector{2, Int64} with indices SOneTo(2):
 1
 1

```

This if one has very project-specific development dependencies (I almost never do this). For benchmark, revise, etc, just use the global environment.

---

<div class="post-metadata">

**Author:** ![adienes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adienes/32/37459_2.png) [@adienes](https://discourse.julialang.org/u/adienes)\
**Post date:** [April 18, 2024, 4:25pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/25 "2024-04-18T16:25:12Z")

</div>

> [@lmiq](#):
>
> Another alternative is to create a shared environment that contains the project-specific development dependencies, with, for example:

this is exactly what I do, with `@dev`

and I have the same problem as OP — I do not know a way to get it loaded into the VSCode repl by default. it’s quite annoying.

I guess I could set a `startup.jl` to push it into the LOAD\_PATH, but that pattern just always bothers me as looking too ugly.

---

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [April 18, 2024, 4:31pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/26 "2024-04-18T16:31:39Z")

</div>

> [@rongcuid](#):
>
> I can’t type an expression into the REPL window and enter a debugger. I can only run an entire file.

They are not easy to find, but you can [debug from the VSCode REPL](https://www.julia-vscode.org/docs/latest/userguide/debugging/#Debugging-code-from-the-REPL) with `@enter` or `@run`.

Also, see [this blog post](https://jkrumbiegel.com/pages/2022-08-26-pkg-introduction/#stacked-environments) for information on stacked environments. They can be used conveniently for debugging [like this](https://juliadebug.github.io/Infiltrator.jl/dev/#Scripts-and-package-development).

I share some of your frustrations but hope to help fix from within.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 18, 2024, 4:33pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/27 "2024-04-18T16:33:17Z")

</div>

> [@adienes](#):
>
> I guess I could set a `startup.jl` to push it into the LOAD\_PATH, but that pattern just always bothers me as looking too ugly.

Maybe something like this does the trick, in the `startup.jl`, after installing the necessary development dependencies in the shared development environment:

```julia
if occursin("MyProject", Base.active_project())
    import Pkg
    Pkg.activate("MyProjectDevelopment", shared=true)
    using StaticArrays
    Pkg.activate("MyProject")
end

```

Test:

```julia-repl
MyProject% julia --project
  Activating project at `~/.julia/environments/MyProjectDevelopment`
  Activating new project at `~/Downloads/MyProject/MyProject`
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.2 (2024-03-01)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> x = SVector(1,1)
2-element SVector{2, Int64} with indices SOneTo(2):
 1
 1

(MyProject) pkg>

```

---

<div class="post-metadata">

**Author:** ![rongcuid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rongcuid/32/42911_2.png) [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Post date:** [April 18, 2024, 4:34pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/28 "2024-04-18T16:34:51Z")

</div>

Thank you. I will definitely use them next time.

---

<div class="post-metadata">

**Author:** ![rongcuid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rongcuid/32/42911_2.png) [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Post date:** [April 18, 2024, 4:43pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/29 "2024-04-18T16:43:13Z")

</div>

> [@Eben60](#):
>
> SciML

Actually I just looked at SciML’s docs. I have used components of it, like diffeq, symbolics, flux, etc. Even Plots and Makie is part of it. Many of these packages are well documented.

Biggest problem for me is Symbolics, really. It has never successfully solved anything I fed to it that is not toy examples. The same systems of equations could be solved by SymPy, and was solved by hand. For whatever reason I had the impression that `Symbolics.jl` was not active, but I just looked at its repo and see that is is active… I don’t know what happened to my memory.

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [April 18, 2024, 4:47pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/30 "2024-04-18T16:47:57Z")

</div>

I definitively can understand and partially share some of these concerns/pain points. I’ll need to think a bit more about all of that.

For now let me point out two things that are incorrect:

First:

> [@rongcuid](#):
>
> Take the following example:
> 
> ```julia
> # a.jl
> function curvature(...)
> end
> 
> # b.jl
> function some_other_function()
> ...
> curvature = ...
> end
> 
> ```
> 
> Well, apparently after this executes, `curvature`’s definition is overwritten, and every other code is broken.

As written this is false. The local assignment in `some_other_function` does not overwrite the global `curvature`. In your case you must have done something differently.

Second:

> [@rongcuid](#):
>
> The main problem is that, Julia code can break due to the order of definition. With this scheme of direct include, the order of inclusion critical. In fact, plenty of errors I encountered were due to seemingly unrelated code in another file. Especially if somewhere there’s an unmatched `end`, I could have to go through **every single file** , spotting line by line, manually, to fix an error that’s reported nowhere close to its origin. Due to how `include` works, the scope of an unclosed `end` could leek beyond file boundary, and cause problem somewhere completely unexpected.

This also seems wrong as written. _In contrast_ to C `include` is not a macro replacing itself with the contents of another file but a _function_ that evaluates some julia file. As such that Julia file needs to be syntactically correct. E.g. you cannot `include` the following:

```julia
module WontInclude
foo(x) = x^2
#no end for module

```

---

<div class="post-metadata">

**Author:** ![rongcuid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rongcuid/32/42911_2.png) [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Post date:** [April 18, 2024, 4:54pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/31 "2024-04-18T16:54:26Z")

</div>

Hmmm, I just went on to test them again. I don’t remember what happened during development.

Maybe it’s just accidental local shadowing breaking a large function for the first case.

The second one could be breaking only the same file. I must have remembered incorrectly.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [April 18, 2024, 4:57pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/32 "2024-04-18T16:57:38Z")

</div>

> [@rongcuid](#):
>
> Biggest problem for me is Symbolics, really. It has never successfully solved anything I fed to it that is not toy examples. The same systems of equations could be solved by SymPy, and was solved by hand. For whatever reason I had the impression that `Symbolics.jl` was not active, but I just looked at its repo and see that is is active… I don’t know what happened to my memory.

It doesn’t have very many symbolic equation solvers right now. It has more on the guts than that aspect of this moment, similar to SymEngine in status. But it’s a very active place right now.

---

<div class="post-metadata">

**Author:** ![cpfiffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cpfiffer/32/208747_2.png) [@cpfiffer](https://discourse.julialang.org/u/cpfiffer)\
**Post date:** [April 18, 2024, 5:04pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/33 "2024-04-18T17:04:20Z")

</div>

This was a good writeup! Thanks for sharing your experiences.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [April 18, 2024, 5:08pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/34 "2024-04-18T17:08:34Z")

</div>

> [@rongcuid](#):
>
> In C, there’s at least forward declaration that allows me to break cycles without shuffling stuff between files. Unfortunately, Julia doesn’t have that.

Not sure if it’s been mentioned here, but for functions julia does have forward declarations:

```julia
function foo end

bar(x) = foo(x)

foo(x) = 2x

```

should work as expected.

---

<div class="post-metadata">

**Author:** ![rongcuid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rongcuid/32/42911_2.png) [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Post date:** [April 18, 2024, 5:23pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/35 "2024-04-18T17:23:15Z")

</div>

It’s mostly the types that are the problems. I solved them by:

- Pulling type definitions all the way up to the top of a module
- Try to break up dependencies with intermediate types (like `ControllerObservation`)

Still require me to juggle multiple files, though.

---

<div class="post-metadata">

**Author:** ![brianguenter](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brianguenter/32/29519_2.png) [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Post date:** [April 18, 2024, 5:44pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/36 "2024-04-18T17:44:55Z")

</div>

A good takeaway from this discussion is that many of the problems @rongcuid had were the result of bad documentation. Bad doesn’t mean incomplete; it means hard for a new user to understand and navigate. The information is there, somewhere, but important ideas about how to set up and use your Julia workspace for maximum efficiency are not salient.

Two examples of this are the problems @rongcuid had understanding how to stack environments in the REPL and how to run the debugger on a single function from the REPL.

When beginners encounter these _documentation_ problems they assume they are _language_ or _ecosystem_ problems. Then they write about their frustrations which discourages other new users from trying Julia. And us more experienced users feel Julia hasn’t gotten a fair shake.

I have never understood why there isn’t a getting started link on the Julia language home page the way Rust and Go have done

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/e/1ec1e7345dbe83a83f5f0dee48eaed6aa3357867.png)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/5/35f304d8233780532ab0c362c4159df994abe7ab.png)

Right there, at the top of the home page where newbies can’t possibly miss it. [ModernJuliaWorkflows](https://modernjuliaworkflows.github.io/) is essentially this getting started page but I wager that few, if any, new users come across this.

Can we add a prominent link on the Julia language home page to [ModernJuliaWorkflows](https://modernjuliaworkflows.github.io/)? Just like the Rust and Go examples? And then do our best as a community improve it and keep it to date, as we do with the rest of the Julia documentation?

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [April 18, 2024, 6:11pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/37 "2024-04-18T18:11:24Z")

</div>

The project sounds very interesting. I didn’t know there were people writing racing game simulations in Julia. Just curious. Was it a personal project, academic project, or corporate project?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 18, 2024, 6:11pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/38 "2024-04-18T18:11:47Z")

</div>

> [@brianguenter](#):
>
> When beginners encounter these _documentation_ problems they assume they are _language_ or _ecosystem_ problems.

I don’t think, however, that these are disconnected. Getting the hang of an effective Julia workflow isn’t trivial, because of the nature of the language. Even when there is someone taking one by the hand, there is a initial steep learning curve, because many of the good practices of an optimal workflow are related to somewhat advanced uses of the language. Like the code structure, the persistent REPL, using environments effectively. Efforts like the modern Julia workflows are great, but as we can see from that page, the issue is that the amount of information quickly becomes a barrier that only goes out with experience.

(What I’m not sure is how different this is in other languages, my experience teaching with compiled languages is also full of first-use complications - possibly R and Matlab have an advantage there - I’m guessing - for having dedicated IDEs)

---

<div class="post-metadata">

**Author:** ![rongcuid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rongcuid/32/42911_2.png) [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Post date:** [April 18, 2024, 6:24pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/39 "2024-04-18T18:24:20Z")

</div>

It’s personal project. I have this random-number driven forum novel that’s coming to an end, and I say “screw it, you say my rule set is too complicated, now I write a program to fking simulate the final race with symplectic Euler one second per turn for 300 turns”.

So this is where the “one-off” for the project comes from. I only need it to run once (of course actually I run it many times, but it must be deterministic).

Spoiler alert, though it’s not like any of you are likely to go to a Chinese forum to read 500 thousand words:

> **Visualization, spoiler alert!**
>

---

<div class="post-metadata">

**Author:** ![ederag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ederag/32/4106_2.png) [@ederag](https://discourse.julialang.org/u/ederag)\
**Post date:** [April 18, 2024, 7:06pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/40 "2024-04-18T19:06:15Z")

</div>

> In general, if Makie has a problem, it is impossible to work around, because its API is wrapped in so many layers of abstraction.

Probably meaning “hard to workaround by yourself” (which I do relate to) ?  
Because on the contrary it seems always possible to workaround Makie issues  
(it is rapidly improving):  
the support here on discourse is outstanding (especially thanks @jules !)  
and the very low level control achievable is awesome.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [April 18, 2024, 7:06pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/41 "2024-04-18T19:06:30Z")

</div>

Thanks so much for posting this; this is indeed good feedback and a really cool project! Writing a 3000LOC simulator to top-off a Lord Of The Rings length forum novel is a beautiful thing.

As the discussion progresses here, I will be trying to split off concrete sub-threads for further discussion as it’s sensible. So let’s continue the discussion on Arrow and Parquet in [Challenges with Arrow and Parquet in a (reasonably substantial) Julia Project](https://discourse.julialang.org/t/challenges-with-arrow-and-parquet-in-a-reasonably-substantial-julia-project/113209/).

---

<div class="post-metadata">

**Author:** ![rongcuid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rongcuid/32/42911_2.png) [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Post date:** [April 18, 2024, 7:09pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/42 "2024-04-18T19:09:28Z")

</div>

Makie support is very responsive.

However, if you look closely you see that the skill lists on the right has huge line spacing and pops the layout all over the place. This is a bug and cannot be worked around. It also has problems handling empty lines.

In this case, `RichText` is abstracted a bit too high level to engineer a local fix. _Maybe_ if there’s an intermediate level API which allows me to, say, draw each character directly, that issue could be worked around.

Plus I can’t do italics + bold.

---

<div class="post-metadata">

**Author:** ![danielwe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielwe/32/35657_2.png) [@danielwe](https://discourse.julialang.org/u/danielwe)\
**Post date:** [April 18, 2024, 7:12pm UTC](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148/43 "2024-04-18T19:12:28Z")

</div>

> [@rongcuid](#):
>
> For research code, REPL is great…
> 
> …except for struct redefinitions.

Pluto.jl lets you redefine structs without restarting the Julia process, which can be useful when prototyping and iterating on struct layouts, even if the eventual home of the code will be a regular module and not a notebook.

[Previous page](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148.md?page=1)

[Next page](https://discourse.julialang.org/t/experience-report-after-finishing-a-reasonably-substantial-julia-project-in-2024/113148.md?page=3)
