# Latest

**URL:** https://discourse.julialang.org/latest.md?page=275

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 276

---

## [Does a "MultiNumber" package exist?](https://discourse.julialang.org/t/does-a-multinumber-package-exist/122696)

<div class="topic-metadata">

**Author:** [@nielsls](https://discourse.julialang.org/u/nielsls)\
**Replies:** 8\
**Last updated:** [November 16, 2024, 7:02pm UTC](https://discourse.julialang.org/t/does-a-multinumber-package-exist/122696 "2024-11-16T19:02:10Z")

</div>

I’m looking for a package with a struct like: struct MultiNumber{N, T \<: Real} \<: Real data::NTuple{N, T} end Where all mathematical operations on a MultiNumber would just apply element-wise. I.e. it would mimic a …

---

## [Can't install Polars and DuckDB on windows 11](https://discourse.julialang.org/t/cant-install-polars-and-duckdb-on-windows-11/122688)

<div class="topic-metadata">

**Author:** [@pk1](https://discourse.julialang.org/u/pk1)\
**Replies:** 6\
**Last updated:** [November 16, 2024, 3:56pm UTC](https://discourse.julialang.org/t/cant-install-polars-and-duckdb-on-windows-11/122688 "2024-11-16T15:56:57Z")

</div>

Hello, I am an experienced programmer, and want to try Julia (1.11.1). For evaluation purposes, I wanted to start by installing two tools that I use regularly and know very well. Polars and DuckDB. I found it very diff…

---

## [Why did Julia choose nominal typing over structural typing/traits?](https://discourse.julialang.org/t/why-did-julia-choose-nominal-typing-over-structural-typing-traits/122517)

<div class="topic-metadata">

**Author:** [@serhii](https://discourse.julialang.org/u/serhii)\
**Replies:** 29\
**Last updated:** [November 16, 2024, 3:12pm UTC](https://discourse.julialang.org/t/why-did-julia-choose-nominal-typing-over-structural-typing-traits/122517 "2024-11-16T15:12:40Z")

</div>

I’ve been thinking about Julia’s type system design, particularly how it uses nominal typing rather than structural typing or a trait-based system. I’m curious about the historical and technical reasons behind this choic…

---

## [Dealing with failure in Julia development and how to win](https://discourse.julialang.org/t/dealing-with-failure-in-julia-development-and-how-to-win/122716)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 1\
**Last updated:** [November 16, 2024, 2:56pm UTC](https://discourse.julialang.org/t/dealing-with-failure-in-julia-development-and-how-to-win/122716 "2024-11-16T14:56:53Z")

</div>

Unlike Python, which I often use to implement industry-standard stuff, I often use Julia to try to push the limit of what’s possible or do something new. And they often failed. Too cursed to use. Too slow. Slower …

---

## [How to print the blank line in the file?](https://discourse.julialang.org/t/how-to-print-the-blank-line-in-the-file/122709)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 7\
**Last updated:** [November 16, 2024, 2:42pm UTC](https://discourse.julialang.org/t/how-to-print-the-blank-line-in-the-file/122709 "2024-11-16T14:42:34Z")

</div>

Hello, The input.txt file is as follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 The code below does not print the empty line: inn = open("input.txt", "r") inp = readline(inn) while inp != "" println(…

---

## [Variable scope concept](https://discourse.julialang.org/t/variable-scope-concept/122277)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 21\
**Last updated:** [November 16, 2024, 1:03pm UTC](https://discourse.julialang.org/t/variable-scope-concept/122277 "2024-11-16T13:03:31Z")

</div>

Hello, Why is the error related to the variable scope given in the following code? num = 0 for line in eachline("file.txt") num +=1 end print(num) The error is: ┌ Warning: Assignment to \`num\` in soft scope is am…

---

## [Need help understanding Type parameters and Vararg tuples](https://discourse.julialang.org/t/need-help-understanding-type-parameters-and-vararg-tuples/122683)

<div class="topic-metadata">

**Author:** [@cshen](https://discourse.julialang.org/u/cshen)\
**Replies:** 3\
**Last updated:** [November 16, 2024, 12:51pm UTC](https://discourse.julialang.org/t/need-help-understanding-type-parameters-and-vararg-tuples/122683 "2024-11-16T12:51:51Z")

</div>

Hello! I’m encountering quite an headscratcher, I’ve given it quite some time but I couldn’t crack. I am struggling to understand why a tuple of two types is not being recognized as such, while all the intermediate step…

---

## [Is it possible to split a module across multiple files?](https://discourse.julialang.org/t/is-it-possible-to-split-a-module-across-multiple-files/122711)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 5\
**Last updated:** [November 16, 2024, 12:01pm UTC](https://discourse.julialang.org/t/is-it-possible-to-split-a-module-across-multiple-files/122711 "2024-11-16T12:01:54Z")

</div>

Here are two files showing how one might split a module across two files: # ModuleA1.jl module ModuleA function functionA1() println("functionA1") end end # ModuleA2.jl module ModuleA function functionA2() p…

---

## [How to print the names of symbols defined in modules?](https://discourse.julialang.org/t/how-to-print-the-names-of-symbols-defined-in-modules/122714)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 1\
**Last updated:** [November 16, 2024, 11:44am UTC](https://discourse.julialang.org/t/how-to-print-the-names-of-symbols-defined-in-modules/122714 "2024-11-16T11:44:24Z")

</div>

The names of symbols defined in the Main module can be printed using julia\> names(Main) 8-element Vector{Symbol}: :Base :Core :Main :SRC :TopLevelModule :skipInit :updateLoadPath However the same trick cannot be…

---

## [A question about function](https://discourse.julialang.org/t/a-question-about-function/122708)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 6\
**Last updated:** [November 16, 2024, 10:51am UTC](https://discourse.julialang.org/t/a-question-about-function/122708 "2024-11-16T10:51:51Z")

</div>

Hello, Please consider the following code: function print3lines() inn = open("input.txt", "r") print1(inn) # read and print first line print2(inn) # read and print second line print3(inn) # rea…

---

## [Julia can be dramatically slower than Matlab when solving 2D PDE](https://discourse.julialang.org/t/julia-can-be-dramatically-slower-than-matlab-when-solving-2d-pde/122321)

<div class="topic-metadata">

**Author:** [@Alex90](https://discourse.julialang.org/u/Alex90)\
**Replies:** 42\
**Last updated:** [November 9, 2024, 2:25pm UTC](https://discourse.julialang.org/t/julia-can-be-dramatically-slower-than-matlab-when-solving-2d-pde/122321 "2024-11-09T14:25:33Z")

</div>

Hello, It is said that Julia is very fast in comparison with other high level languages. SInce i do scientific computing, i was interested in this language. So i compared performance of Julia and Matlab when solving two…

---

## [The combination of parse and length](https://discourse.julialang.org/t/the-combination-of-parse-and-length/122282)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 4\
**Last updated:** [November 16, 2024, 9:05am UTC](https://discourse.julialang.org/t/the-combination-of-parse-and-length/122282 "2024-11-16T09:05:01Z")

</div>

Hello, Why is the following combination wrong? w = "Hello" print(parse(Int,length(w))) Thank you.

---

## [Base.== error](https://discourse.julialang.org/t/base-error/122706)

<div class="topic-metadata">

**Author:** [@abdo](https://discourse.julialang.org/u/abdo)\
**Replies:** 2\
**Last updated:** [November 16, 2024, 7:12am UTC](https://discourse.julialang.org/t/base-error/122706 "2024-11-16T07:12:17Z")

</div>

Point2D(x::Real, y::Real) Creates a Point2D object with dimensions x and y Can take either two Numbers or a string similat to “(1, 2)” Example julia-repl julia\> Point2D(1,2) (1, 2) strng = “(1, -2.4)” Point2D(strn…

---

## [How to load a file-as-a-module when an Environment is present](https://discourse.julialang.org/t/how-to-load-a-file-as-a-module-when-an-environment-is-present/122680)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [November 15, 2024, 2:45pm UTC](https://discourse.julialang.org/t/how-to-load-a-file-as-a-module-when-an-environment-is-present/122680 "2024-11-15T14:45:26Z")

</div>

I need to load a module defined in a local file without using includet() (because of an issue with nested includet). I tried then LOAD\_PATH and at the beginning this works: a.jl : using Pkg Pkg.activate(@\_\_DIR\_\_) push…

---

## [PhD on Kinetic Monte Carlo for crystal growth](https://discourse.julialang.org/t/phd-on-kinetic-monte-carlo-for-crystal-growth/122695)

<div class="topic-metadata">

**Author:** [@j-fu](https://discourse.julialang.org/u/j-fu)\
**Replies:** 0\
**Last updated:** [November 15, 2024, 9:30pm UTC](https://discourse.julialang.org/t/phd-on-kinetic-monte-carlo-for-crystal-growth/122695 "2024-11-15T21:30:21Z")

</div>

PhD on Kinetic Monte Carlo for crystal growth at Leibniz Institute for Crystal Growth Berlin. One of the simulation tools is being developed in Julia.

---

## [Recommendation to solve linear systems with very large positive definite symmetric sparse matrix (~10^6 x 10^6)](https://discourse.julialang.org/t/recommendation-to-solve-linear-systems-with-very-large-positive-definite-symmetric-sparse-matrix-10-6-x-10-6/122603)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 14\
**Last updated:** [November 15, 2024, 8:10pm UTC](https://discourse.julialang.org/t/recommendation-to-solve-linear-systems-with-very-large-positive-definite-symmetric-sparse-matrix-10-6-x-10-6/122603 "2024-11-15T20:10:00Z")

</div>

Since there are many people in this forum that have a wide knowledge in not only programming but also in numerical analysis, I would like to ask for a recommendation on which solvers to consider to solve stardard linear …

---

## [Package Development: Why is Ref needed to pass a global constant to a function?](https://discourse.julialang.org/t/package-development-why-is-ref-needed-to-pass-a-global-constant-to-a-function/122566)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 13\
**Last updated:** [November 15, 2024, 7:47pm UTC](https://discourse.julialang.org/t/package-development-why-is-ref-needed-to-pass-a-global-constant-to-a-function/122566 "2024-11-15T19:47:05Z")

</div>

I currently have the following setup (which works great) but somehow seems inelegant: src/MyPackage.jl module MyPackage include("mysrc.jl") const CONFIG = Ref{Config}() end src/mysrc.jl @with\_kw struct Config a :…

---

## [MATLAB is faster for my large system of ODEs?](https://discourse.julialang.org/t/matlab-is-faster-for-my-large-system-of-odes/122610)

<div class="topic-metadata">

**Author:** [@martru](https://discourse.julialang.org/u/martru)\
**Replies:** 21\
**Last updated:** [November 15, 2024, 6:12pm UTC](https://discourse.julialang.org/t/matlab-is-faster-for-my-large-system-of-odes/122610 "2024-11-15T18:12:50Z")

</div>

Excuse the deliberately provocative title :slight\_smile: I have a very large system of ODEs of the form: dot{x} = Ax + Bu A is a sparse matrix 5505x5505. B\*u is a 5505 element vector. Using ode45 in matlab, it solves …

---

## [Error when running \`using Plots; pythonplot();\` in old environment](https://discourse.julialang.org/t/error-when-running-using-plots-pythonplot-in-old-environment/122670)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [November 15, 2024, 4:09pm UTC](https://discourse.julialang.org/t/error-when-running-using-plots-pythonplot-in-old-environment/122670 "2024-11-15T16:09:41Z")

</div>

I was loading an old Julia environment (maybe half a year old? It is 1.10.4). I then run julia\> using Plots julia\> pythonplot() And get a ERROR: InitError: PythonCall.PyException(PythonCall.Py(Ptr{PythonCall.C.PyObjec…

---

## [Better way to get the corresponding constructor from composite-type instances?](https://discourse.julialang.org/t/better-way-to-get-the-corresponding-constructor-from-composite-type-instances/122661)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 4\
**Last updated:** [November 15, 2024, 3:27pm UTC](https://discourse.julialang.org/t/better-way-to-get-the-corresponding-constructor-from-composite-type-instances/122661 "2024-11-15T15:27:25Z")

</div>

MWE: julia\> abstract type MyType{T} \<: Any end julia\> struct myT1{T} \<: MyType{T} a::T end julia\> struct myT2{T} \<: MyType{T} a::T end julia\> getBuilder(a::MyType) = getfield(Main, (nameof…

---

## [Any way to skip a constructor for Accessors.jl-like syntax?](https://discourse.julialang.org/t/any-way-to-skip-a-constructor-for-accessors-jl-like-syntax/122678)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 3\
**Last updated:** [November 15, 2024, 3:24pm UTC](https://discourse.julialang.org/t/any-way-to-skip-a-constructor-for-accessors-jl-like-syntax/122678 "2024-11-15T15:24:45Z")

</div>

So this internal :new expression seems to be working again. I’m wondering if it’s possible to unsafely skip inner constructors’ validation to instantiate tweaks to existing instances with setting syntax like Accessors.jl…

---

## [How do I assign and branch?](https://discourse.julialang.org/t/how-do-i-assign-and-branch/122179)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 9\
**Last updated:** [November 15, 2024, 3:00pm UTC](https://discourse.julialang.org/t/how-do-i-assign-and-branch/122179 "2024-11-15T15:00:45Z")

</div>

Here’s some code. tmp = myFunction() if !isnothing(tmp) doSomethingWith(tmp) end Some languages have a convenient way to express this. The disadvantage of what I have done is introduce a new temporary variable tmp,…

---

## [Pkg error messages in Pluto miss the often basic typo / not-loaded suggestions](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676)

<div class="topic-metadata">

**Author:** [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Replies:** 7\
**Last updated:** [November 15, 2024, 2:05pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676 "2024-11-15T14:05:05Z")

</div>

In Pluto, when Using \[pkg\_name\] fails to load a package it gives “Things you could try”. The package \[pkg\_name\].jl could not load because it failed to initialize. That's not nice! Things you could try: Restart the…

---

## [Revise with nested \`include\`?](https://discourse.julialang.org/t/revise-with-nested-include/97916)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 6\
**Last updated:** [November 15, 2024, 1:22pm UTC](https://discourse.julialang.org/t/revise-with-nested-include/97916 "2024-11-15T13:22:50Z")

</div>

Hi, I have a simple question about nested include when using Revise.jl. Consider the following nested structure: module1.jl: module Module1 function f1() println("abc") end include("module2.jl") end…

---

## [Adding new layer to GeoMakie.jl poly plot](https://discourse.julialang.org/t/adding-new-layer-to-geomakie-jl-poly-plot/122667)

<div class="topic-metadata">

**Author:** [@miguelborrero](https://discourse.julialang.org/u/miguelborrero)\
**Replies:** 3\
**Last updated:** [November 15, 2024, 12:23pm UTC](https://discourse.julialang.org/t/adding-new-layer-to-geomakie-jl-poly-plot/122667 "2024-11-15T12:23:33Z")

</div>

Hi there, I have two sets of Shapefile geometries. If I run: f, a, p = poly(shapefile\_df.polygon; axis = (; type = GeoAxis)) I will get the desired map. However, I would like to add another layer with a different colo…

---

## [Initial condition underdefined in NonlinearProblem](https://discourse.julialang.org/t/initial-condition-underdefined-in-nonlinearproblem/122619)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 7\
**Last updated:** [November 15, 2024, 9:36am UTC](https://discourse.julialang.org/t/initial-condition-underdefined-in-nonlinearproblem/122619 "2024-11-15T09:36:24Z")

</div>

The following works: using ModelingToolkit, NonlinearSolve # Define a nonlinear system @variables x y z @parameters σ ρ β eqs = \[0 ~ σ \* (y - x) 0 ~ x \* (ρ - z) - y 0 ~ x \* y - β \* z\] @mtkbuild ns = Nonli…

---

## [Dimension mismatch error](https://discourse.julialang.org/t/dimension-mismatch-error/122590)

<div class="topic-metadata">

**Author:** [@Vegetasan](https://discourse.julialang.org/u/Vegetasan)\
**Replies:** 10\
**Last updated:** [November 15, 2024, 8:41am UTC](https://discourse.julialang.org/t/dimension-mismatch-error/122590 "2024-11-15T08:41:50Z")

</div>

Hello everyone, I’m working on a project in Julia to predict reaction mechanisms for a given set of inputs using kinetic modeling. I’m fairly new to Julia, and everything seems to be running well except for a dimension …

---

## [My apology to the Julia community for being weak](https://discourse.julialang.org/t/my-apology-to-the-julia-community-for-being-weak/122582)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 4\
**Last updated:** [November 15, 2024, 6:11am UTC](https://discourse.julialang.org/t/my-apology-to-the-julia-community-for-being-weak/122582 "2024-11-15T06:11:37Z")

</div>

I apologize to the community and everyone who supports me for being so weak and for giving false hope that I could do something. I’m not a really strong programmer. I was a self-made “genius”, learning things the way ot…

---

## [Why/where does this allocate?](https://discourse.julialang.org/t/why-where-does-this-allocate/122607)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 10\
**Last updated:** [November 15, 2024, 2:50am UTC](https://discourse.julialang.org/t/why-where-does-this-allocate/122607 "2024-11-15T02:50:10Z")

</div>

I think this function in Julia allocates once, 16 bytes, at poptask (can’t easily run it alone): julia\> function wait() GC.safepoint() W = Base.workqueue\_for(Threads.threadid()) Base.pop…

---

## [Why doesn't multithreading over a vector/array lead to data race?](https://discourse.julialang.org/t/why-doesnt-multithreading-over-a-vector-array-lead-to-data-race/122621)

<div class="topic-metadata">

**Author:** [@ttx002000](https://discourse.julialang.org/u/ttx002000)\
**Replies:** 5\
**Last updated:** [November 15, 2024, 2:41am UTC](https://discourse.julialang.org/t/why-doesnt-multithreading-over-a-vector-array-lead-to-data-race/122621 "2024-11-15T02:41:59Z")

</div>

Hi All, I under stand the following function will lead to undefined behaviour s=0 Threads.@threads for ja in 1:1000 global s+=ja end as each thread is modifying the same variables at the same time. But why does…

[Previous page](https://discourse.julialang.org/latest.md?page=274)

[Next page](https://discourse.julialang.org/latest.md?page=276)
