# New to Julia

**URL:** https://discourse.julialang.org/c/first-steps/8.md?page=19

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

**Page:** 20

---

## [I don't understand why it is slower with CuStaticSharedArray](https://discourse.julialang.org/t/i-dont-understand-why-it-is-slower-with-custaticsharedarray/126763)

<div class="topic-metadata">

**Author:** [@Ludovic\_Dumoulin](https://discourse.julialang.org/u/Ludovic_Dumoulin)\
**Replies:** 9\
**Last updated:** [March 17, 2025, 4:35pm UTC](https://discourse.julialang.org/t/i-dont-understand-why-it-is-slower-with-custaticsharedarray/126763 "2025-03-17T16:35:32Z")

</div>

Hello, I am new to Julia and I am trying to use an iterative scheme to solve a force balance equation, concretely the kernel without shared memory is quite simple: function kernel\_comp\_v\_noshmem!(vn, v, F) # Indexi…

---

## [Return value of \`begin ... end\`](https://discourse.julialang.org/t/return-value-of-begin-end/127010)

<div class="topic-metadata">

**Author:** [@LEXUGE](https://discourse.julialang.org/u/LEXUGE)\
**Replies:** 15\
**Last updated:** [March 17, 2025, 3:45pm UTC](https://discourse.julialang.org/t/return-value-of-begin-end/127010 "2025-03-17T15:45:43Z")

</div>

I understand the expression will be evaluated to a value. So a = 1 will be evaluated to 1 where as a=1; will not However, I expect begin a = 1; end to evaluate to nothing as well. Why does it evaluate to 1? Intuitiv…

---

## [PDE system solver](https://discourse.julialang.org/t/pde-system-solver/127046)

<div class="topic-metadata">

**Author:** [@Anish\_Kumar](https://discourse.julialang.org/u/Anish_Kumar)\
**Replies:** 0\
**Last updated:** [March 17, 2025, 9:46am UTC](https://discourse.julialang.org/t/pde-system-solver/127046 "2025-03-17T09:46:48Z")

</div>

Hi all, I am trying to solve

---

## [Right way to put code into a function?](https://discourse.julialang.org/t/right-way-to-put-code-into-a-function/126911)

<div class="topic-metadata">

**Author:** [@bpsomu](https://discourse.julialang.org/u/bpsomu)\
**Replies:** 6\
**Last updated:** [March 14, 2025, 10:14am UTC](https://discourse.julialang.org/t/right-way-to-put-code-into-a-function/126911 "2025-03-14T10:14:53Z")

</div>

I am writing a simulation code where there is an “input.toml” file which contains the initialization parameters (20 to 30 parameters) for the simulation. It works fine if I keep the code in the main where the variables s…

---

## [ODE returning f(t) = f(0) always](https://discourse.julialang.org/t/ode-returning-f-t-f-0-always/126757)

<div class="topic-metadata">

**Author:** [@matyaspayn](https://discourse.julialang.org/u/matyaspayn)\
**Replies:** 17\
**Last updated:** [March 12, 2025, 12:19pm UTC](https://discourse.julialang.org/t/ode-returning-f-t-f-0-always/126757 "2025-03-12T12:19:28Z")

</div>

Hello, I am currently trying to solve an ode where I have u(t) as a vector of length 1024, and I have du/dt = -u + AMf(u), where M is a matrix of 1024x1024. I specify some random u0, and solve the problem. I get a soluti…

---

## [Product distribution allocates (a lot)](https://discourse.julialang.org/t/product-distribution-allocates-a-lot/126771)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 9\
**Last updated:** [March 11, 2025, 3:12pm UTC](https://discourse.julialang.org/t/product-distribution-allocates-a-lot/126771 "2025-03-11T15:12:17Z")

</div>

Hi, I just found out that in the following example, sampling from a Distributions.Product distribution is much slower and allocates much more than implementing the sampler manually. Is there something that I’m overlookin…

---

## [Why is my kernel as slow in FP32 as in FP64 on A2000 Ada-based GPU?](https://discourse.julialang.org/t/why-is-my-kernel-as-slow-in-fp32-as-in-fp64-on-a2000-ada-based-gpu/126809)

<div class="topic-metadata">

**Author:** [@Ludovic\_Dumoulin](https://discourse.julialang.org/u/Ludovic_Dumoulin)\
**Replies:** 10\
**Last updated:** [March 11, 2025, 2:39pm UTC](https://discourse.julialang.org/t/why-is-my-kernel-as-slow-in-fp32-as-in-fp64-on-a2000-ada-based-gpu/126809 "2025-03-11T14:39:58Z")

</div>

Hello, I am new to Julia and I wanted to use Float32 to debug my code expecting it be faster as my gpu provide only 1/64 of its performance in Float64. I was surprised to see that using Float32 was almost as slow as Fl…

---

## [Broadcasting log, ouch!](https://discourse.julialang.org/t/broadcasting-log-ouch/126798)

<div class="topic-metadata">

**Author:** [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Replies:** 1\
**Last updated:** [March 11, 2025, 1:53am UTC](https://discourse.julialang.org/t/broadcasting-log-ouch/126798 "2025-03-11T01:53:50Z")

</div>

Beware, beware. julia\> Ldmax = 1; Lddyn = 500; Ldmin = Ldmax/Lddyn; julia\> log.(Ldmin, Ldmax) -0.0 julia\> log.((Ldmin, Ldmax)) (-6.214608098422191, 0.0)

---

## [Installation Problem on MacOS 15.3.1](https://discourse.julialang.org/t/installation-problem-on-macos-15-3-1/126473)

<div class="topic-metadata">

**Author:** [@blau49](https://discourse.julialang.org/u/blau49)\
**Replies:** 3\
**Last updated:** [March 11, 2025, 12:45pm UTC](https://discourse.julialang.org/t/installation-problem-on-macos-15-3-1/126473 "2025-03-11T12:45:46Z")

</div>

After installing Julia 1.11 on Mac OS 15.3.1 (Mac mini) and starting the following message occurs: “julia” kann nicht geöffnet werden, weil Julia nicht erlaubt ist, Dokumente in Terminal zu öffnen. Any suggestions?

---

## [How to update Julia?](https://discourse.julialang.org/t/how-to-update-julia/82058)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 22\
**Last updated:** [March 11, 2025, 10:09am UTC](https://discourse.julialang.org/t/how-to-update-julia/82058 "2025-03-11T10:09:51Z")

</div>

How to update Julia?? :exploding\_head:

---

## [Type With Variable Number Of Parameters](https://discourse.julialang.org/t/type-with-variable-number-of-parameters/126409)

<div class="topic-metadata">

**Author:** [@Soel](https://discourse.julialang.org/u/Soel)\
**Replies:** 22\
**Last updated:** [March 11, 2025, 7:39am UTC](https://discourse.julialang.org/t/type-with-variable-number-of-parameters/126409 "2025-03-11T07:39:20Z")

</div>

Hello Julians, I am trying to define a parametric type MyType{T1,T2,T3,...} where the number of Ti’s may vary according to constructor’s arg… I’ve done something similar to: struct MyType{T} m::Union{T,Tuple{Vararg{T…

---

## [Jupyter cannot find the Julia 1.11 kernel](https://discourse.julialang.org/t/jupyter-cannot-find-the-julia-1-11-kernel/121155)

<div class="topic-metadata">

**Author:** [@vsoler](https://discourse.julialang.org/u/vsoler)\
**Replies:** 16\
**Last updated:** [March 11, 2025, 7:06am UTC](https://discourse.julialang.org/t/jupyter-cannot-find-the-julia-1-11-kernel/121155 "2025-03-11T07:06:54Z")

</div>

There are some posts concerning the upgrade to version 1.11 with juliaup, but I cannot solve a problem that I have with Jupyter: it cannot find the new julia kernel. I’m sorry if someone feels that my question has been a…

---

## [Can you please review my code](https://discourse.julialang.org/t/can-you-please-review-my-code/126694)

<div class="topic-metadata">

**Author:** [@Gesee](https://discourse.julialang.org/u/Gesee)\
**Replies:** 8\
**Last updated:** [March 10, 2025, 9:48pm UTC](https://discourse.julialang.org/t/can-you-please-review-my-code/126694 "2025-03-10T21:48:12Z")

</div>

Hi everyone, I’m actually a 17 years old young Cameroonian and I started Julia just one year ago, I worked on a package named Notifyers.jl and I now I need some people to check the quality of my code. Here is the link t…

---

## [Error loading StochasticDiffEq and DifferentialEquations in 1.10.8 (Apple Silicon)](https://discourse.julialang.org/t/error-loading-stochasticdiffeq-and-differentialequations-in-1-10-8-apple-silicon/126740)

<div class="topic-metadata">

**Author:** [@cbilllingham1983](https://discourse.julialang.org/u/cbilllingham1983)\
**Replies:** 8\
**Last updated:** [March 10, 2025, 9:11pm UTC](https://discourse.julialang.org/t/error-loading-stochasticdiffeq-and-differentialequations-in-1-10-8-apple-silicon/126740 "2025-03-10T21:11:07Z")

</div>

Hi all, I’m using Julia 1.10.8 on my MacBook running Apple Silicon hardware. I am seeing some errors loading the packages StochasticDiffEq (v6.69.1) and DifferentialEquations (v7.16.0). Anyone had any issues with the…

---

## [Is there a way I can use track-allocation using like using @btime in jupyter lab?](https://discourse.julialang.org/t/is-there-a-way-i-can-use-track-allocation-using-like-using-btime-in-jupyter-lab/77874)

<div class="topic-metadata">

**Author:** [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Replies:** 1\
**Last updated:** [March 10, 2025, 1:20pm UTC](https://discourse.julialang.org/t/is-there-a-way-i-can-use-track-allocation-using-like-using-btime-in-jupyter-lab/77874 "2025-03-10T13:20:58Z")

</div>

Using start julia with track-allocation=user each time is not convenient. So I am wondering is there a way I can get more specifical infomation of allocations in jupyter.

---

## [DiffEqSensitivity fails to load in 1.10.8 on Apple Silicon](https://discourse.julialang.org/t/diffeqsensitivity-fails-to-load-in-1-10-8-on-apple-silicon/126724)

<div class="topic-metadata">

**Author:** [@cbilllingham1983](https://discourse.julialang.org/u/cbilllingham1983)\
**Replies:** 2\
**Last updated:** [March 10, 2025, 1:27am UTC](https://discourse.julialang.org/t/diffeqsensitivity-fails-to-load-in-1-10-8-on-apple-silicon/126724 "2025-03-10T01:27:58Z")

</div>

Hi I’m trying to run a script in Julia 1.10.8 on a MacBook running Apple Silicon hardware. I’ve run this script successfully in Julia 1.6.7 on Ubuntu 24.04 with x86 64 bit hardware. I have been unable to get Julia 1.10.8…

---

## [On type annotations](https://discourse.julialang.org/t/on-type-annotations/116305)

<div class="topic-metadata">

**Author:** [@Matthijs\_1971](https://discourse.julialang.org/u/Matthijs_1971)\
**Replies:** 88\
**Last updated:** [March 8, 2025, 9:28pm UTC](https://discourse.julialang.org/t/on-type-annotations/116305 "2025-03-08T21:28:57Z")

</div>

I wonder if there are any risks or issues with type annotations. In short, together with colleagues I am writing a coding standard. All Julia code at my company must be implemented following this standard. Some packages …

---

## [Finding Julia packages](https://discourse.julialang.org/t/finding-julia-packages/126663)

<div class="topic-metadata">

**Author:** [@Medaan\_pack](https://discourse.julialang.org/u/Medaan_pack)\
**Replies:** 6\
**Last updated:** [March 8, 2025, 8:59am UTC](https://discourse.julialang.org/t/finding-julia-packages/126663 "2025-03-08T08:59:21Z")

</div>

Hello Please tell me why the julia packages vanished?. Thank you very much

---

## [Sparse matrix vector multiplication on GPU](https://discourse.julialang.org/t/sparse-matrix-vector-multiplication-on-gpu/126693)

<div class="topic-metadata">

**Author:** [@baseb0l](https://discourse.julialang.org/u/baseb0l)\
**Replies:** 0\
**Last updated:** [March 7, 2025, 7:20pm UTC](https://discourse.julialang.org/t/sparse-matrix-vector-multiplication-on-gpu/126693 "2025-03-07T19:20:32Z")

</div>

Is there a way to perform sparse matrix vector multiplication on GPU? Thanks

---

## [Distinguish datatype from function](https://discourse.julialang.org/t/distinguish-datatype-from-function/126666)

<div class="topic-metadata">

**Author:** [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Replies:** 7\
**Last updated:** [March 7, 2025, 8:54am UTC](https://discourse.julialang.org/t/distinguish-datatype-from-function/126666 "2025-03-07T08:54:19Z")

</div>

Hello! Let’s say I want to define a dictionary from Strings to functions: julia\> temp = Dict{String, Function} Dict{String, Function} Then I add a value: julia\> temp\["abc"\] = DateTime ERROR: MethodError: no method ma…

---

## [Can't get a .jl file to read a .jdl2 file in the same route folder](https://discourse.julialang.org/t/cant-get-a-jl-file-to-read-a-jdl2-file-in-the-same-route-folder/126639)

<div class="topic-metadata">

**Author:** [@sjm10](https://discourse.julialang.org/u/sjm10)\
**Replies:** 3\
**Last updated:** [March 6, 2025, 3:00pm UTC](https://discourse.julialang.org/t/cant-get-a-jl-file-to-read-a-jdl2-file-in-the-same-route-folder/126639 "2025-03-06T15:00:03Z")

</div>

When running a file I get the following error: ERROR: LoadError: ArgumentError: No file exists at given path: Datasets.jld2 I have tried loading the file from its own route first but doesn’t seem to help. The datasets …

---

## [Type instability of array getindex](https://discourse.julialang.org/t/type-instability-of-array-getindex/126636)

<div class="topic-metadata">

**Author:** [@jacobga](https://discourse.julialang.org/u/jacobga)\
**Replies:** 2\
**Last updated:** [March 6, 2025, 2:04pm UTC](https://discourse.julialang.org/t/type-instability-of-array-getindex/126636 "2025-03-06T14:04:50Z")

</div>

The following example shows that there is a runtime dispatch on accessing an array. Why is that the case, and can I avoid it? struct example a::Array{Int64} end function examplefun(x::example) return @inbounds …

---

## [Error running multiple\_shoot example](https://discourse.julialang.org/t/error-running-multiple-shoot-example/126608)

<div class="topic-metadata">

**Author:** [@cbilllingham1983](https://discourse.julialang.org/u/cbilllingham1983)\
**Replies:** 2\
**Last updated:** [March 6, 2025, 11:39am UTC](https://discourse.julialang.org/t/error-running-multiple-shoot-example/126608 "2025-03-06T11:39:49Z")

</div>

Hi this is a follow up to an earlier post. I’m trying to use multiple\_shooting and I am just trying to run the basic example script shown: Can anyone confirm that the example code on that page is both syntactically an…

---

## [Julia developing workflow with vim and terminal](https://discourse.julialang.org/t/julia-developing-workflow-with-vim-and-terminal/126242)

<div class="topic-metadata">

**Author:** [@danieleavitabile](https://discourse.julialang.org/u/danieleavitabile)\
**Replies:** 20\
**Last updated:** [March 4, 2025, 8:29pm UTC](https://discourse.julialang.org/t/julia-developing-workflow-with-vim-and-terminal/126242 "2025-03-04T20:29:06Z")

</div>

Dear All, I edit files using vim, and run Julia in a terminal split, next to my editor. I am sure I won’t be the first one who adopts this setup. My workflow is currently the following: I edit a driver.jl file that s…

---

## [Create named tuple in C to pass to jl\_call](https://discourse.julialang.org/t/create-named-tuple-in-c-to-pass-to-jl-call/63547)

<div class="topic-metadata">

**Author:** [@kkaravokyri](https://discourse.julialang.org/u/kkaravokyri)\
**Replies:** 2\
**Last updated:** [March 4, 2025, 2:29pm UTC](https://discourse.julialang.org/t/create-named-tuple-in-c-to-pass-to-jl-call/63547 "2025-03-04T14:29:56Z")

</div>

I’m embedding Julia in C and I would like to be able to create named tuples with the number of filelds, their names and types being determined at runtime. I am currently able to create a standard tuple like this: jl\_va…

---

## [Non-constant types in out-of-place ODE solve with multshooting?](https://discourse.julialang.org/t/non-constant-types-in-out-of-place-ode-solve-with-multshooting/126482)

<div class="topic-metadata">

**Author:** [@cbilllingham1983](https://discourse.julialang.org/u/cbilllingham1983)\
**Replies:** 9\
**Last updated:** [March 4, 2025, 5:00am UTC](https://discourse.julialang.org/t/non-constant-types-in-out-of-place-ode-solve-with-multshooting/126482 "2025-03-04T05:00:30Z")

</div>

Hi, I’m trying to use multiple shooting for my analysis. I’ve been trying to reproduce the simple script shown of the Julia SciML documentation and I keep running into an error: ERROR: Detected non-constant types in an …

---

## [Discrete Adjoint Sensitivity Analysis for ODES in DifferentialEquations.jl](https://discourse.julialang.org/t/discrete-adjoint-sensitivity-analysis-for-odes-in-differentialequations-jl/100007)

<div class="topic-metadata">

**Author:** [@Rui\_Martins](https://discourse.julialang.org/u/Rui_Martins)\
**Replies:** 7\
**Last updated:** [March 3, 2025, 8:10pm UTC](https://discourse.julialang.org/t/discrete-adjoint-sensitivity-analysis-for-odes-in-differentialequations-jl/100007 "2025-03-03T20:10:10Z")

</div>

Hello, I wanted to ask if the DifferentialEquations.jl package for Julia implements discrete adjoint sensitivity analysis for adaptive explicit Runge-Kutta methods. If so, where can I find some documentation describing…

---

## [JumpProblems with moderately large numbers of jumps](https://discourse.julialang.org/t/jumpproblems-with-moderately-large-numbers-of-jumps/126503)

<div class="topic-metadata">

**Author:** [@jafoz](https://discourse.julialang.org/u/jafoz)\
**Replies:** 1\
**Last updated:** [March 3, 2025, 6:17pm UTC](https://discourse.julialang.org/t/jumpproblems-with-moderately-large-numbers-of-jumps/126503 "2025-03-03T18:17:23Z")

</div>

I’m trying to create a JumpProblem which has ~ 100 variable rate jumps, and running into some issues where constructing the JumpProblem is taking a long time (~300s). This is a minimal example of the problem - the full …

---

## [ArgParse visualization of argument type and default value](https://discourse.julialang.org/t/argparse-visualization-of-argument-type-and-default-value/126284)

<div class="topic-metadata">

**Author:** [@Oblomov](https://discourse.julialang.org/u/Oblomov)\
**Replies:** 2\
**Last updated:** [March 3, 2025, 7:18am UTC](https://discourse.julialang.org/t/argparse-visualization-of-argument-type-and-default-value/126284 "2025-03-03T07:18:16Z")

</div>

Hello all, does anybody know if there is a way to customize the way ArgParse shows the default type and value for arguments where this is set? I’m particularly annoyed by the fact that e.g. for an UInt value the default…

---

## [Semicolons inside function declaration](https://discourse.julialang.org/t/semicolons-inside-function-declaration/101970)

<div class="topic-metadata">

**Author:** [@enderw88](https://discourse.julialang.org/u/enderw88)\
**Replies:** 17\
**Last updated:** [March 1, 2025, 6:48pm UTC](https://discourse.julialang.org/t/semicolons-inside-function-declaration/101970 "2025-03-01T18:48:20Z")

</div>

I am picking up a stale package that reads a specific type of text file (IGC file if anyone out there flies gliders). I have seen a few instances of including a semi-colon inside the function declaration, like function…

[Previous page](https://discourse.julialang.org/c/first-steps/8.md?page=18)

[Next page](https://discourse.julialang.org/c/first-steps/8.md?page=20)
