# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=6

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

**Page:** 7

---

## [What's the point of algebraic data types (Moshi.jl)](https://discourse.julialang.org/t/whats-the-point-of-algebraic-data-types-moshi-jl/135281)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 24\
**Last updated:** [July 9, 2026, 8:14pm UTC](https://discourse.julialang.org/t/whats-the-point-of-algebraic-data-types-moshi-jl/135281 "2026-07-09T20:14:25Z")

</div>

Symbolics.jl uses Moshi.jl extensively, and it yields obscure types like SymbolicUtils.BasicSymbolicImpl.var"##Storage#AddMul"{T}. After reading Algebraic Data Type - Intro | Moshi, I still don’t get it. The motivating e…

---

## [List comprehension can't find an already defined variable](https://discourse.julialang.org/t/list-comprehension-cant-find-an-already-defined-variable/138020)

<div class="topic-metadata">

**Author:** [@martin\_sanchez](https://discourse.julialang.org/u/martin_sanchez)\
**Replies:** 1\
**Last updated:** [July 9, 2026, 7:12am UTC](https://discourse.julialang.org/t/list-comprehension-cant-find-an-already-defined-variable/138020 "2026-07-09T07:12:34Z")

</div>

I was dealing with an error and in the end it seems to reduce to array comprehension: c=0 z = \[1,2,3,4\] println(\[c+=i for i in z\]) it throws an error: ERROR: LoadError: UndefVarError: c not defined in local scope Su…

---

## [Package mode broken in REPL on Win11 unless started through VSCode extension](https://discourse.julialang.org/t/package-mode-broken-in-repl-on-win11-unless-started-through-vscode-extension/137985)

<div class="topic-metadata">

**Author:** [@ducksoverip](https://discourse.julialang.org/u/ducksoverip)\
**Replies:** 2\
**Last updated:** [July 8, 2026, 2:53am UTC](https://discourse.julialang.org/t/package-mode-broken-in-repl-on-win11-unless-started-through-vscode-extension/137985 "2026-07-08T02:53:19Z")

</div>

Ok, this is a weird one: if I start the Julia 1.12.6 REPL on my Windows 11 machine by opening up cmd.exe or PowerShell and typing julia in the prompt, it reads my startup.jl and duly starts the REPL. However, pressing \] …

---

## [Inverting ComplexF32 with Metal.jl throws an error](https://discourse.julialang.org/t/inverting-complexf32-with-metal-jl-throws-an-error/137991)

<div class="topic-metadata">

**Author:** [@phx](https://discourse.julialang.org/u/phx)\
**Replies:** 2\
**Last updated:** [July 7, 2026, 11:50pm UTC](https://discourse.julialang.org/t/inverting-complexf32-with-metal-jl-throws-an-error/137991 "2026-07-07T23:50:02Z")

</div>

Hi everyone! I’m working with Metal.jl on an Apple Silicon GPU and I’ve encountered the following issue. When computing the inverse of ComplexF32 numbers, some Float64 numbers seem to sneak in and cause Metal.jl to throw…

---

## [Arbitrary anchor in Documenter](https://discourse.julialang.org/t/arbitrary-anchor-in-documenter/126311)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 2\
**Last updated:** [July 7, 2026, 9:38am UTC](https://discourse.julialang.org/t/arbitrary-anchor-in-documenter/126311 "2026-07-07T09:38:14Z")

</div>

The Documenter docs show how it’s possible to explicitly name a header with something like # \[Header\](@id my\_custom\_header\_name) which can then be linked to in the documentation with something like \[Custom Header\](@re…

---

## [New Working Local Coding Agent for Julia](https://discourse.julialang.org/t/new-working-local-coding-agent-for-julia/137962)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 5\
**Last updated:** [July 6, 2026, 9:16pm UTC](https://discourse.julialang.org/t/new-working-local-coding-agent-for-julia/137962 "2026-07-06T21:16:33Z")

</div>

I have tested dozens of combinations of agents, quantisations, ‘speedup tricks’, etc. over past several months on Julia coding (specifically for mathematical programming and statistical learning) with dismal results, unt…

---

## [MWE package?](https://discourse.julialang.org/t/mwe-package/126792)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 10\
**Last updated:** [July 5, 2026, 12:48pm UTC](https://discourse.julialang.org/t/mwe-package/126792 "2026-07-05T12:48:12Z")

</div>

I see this previous thread on Discourse: Suggestion for a new package: MinimalWorkingExamples.jl; but it looks like maybe this never got off the ground? Coming from an R background, it’s extremely helpful (both as an as…

---

## [Juliac with TypedTables](https://discourse.julialang.org/t/juliac-with-typedtables/137926)

<div class="topic-metadata">

**Author:** [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Replies:** 7\
**Last updated:** [July 5, 2026, 1:13am UTC](https://discourse.julialang.org/t/juliac-with-typedtables/137926 "2026-07-05T01:13:42Z")

</div>

I want to compile functions processing tables with help of juliac. I use TypedTables. Unfortunately the code cannot be compiled as soon the tables have more than 32 columns. This is probably caused by the type-instabilit…

---

## [How to use ForwardDiff.jl with inv and matrix exponential?](https://discourse.julialang.org/t/how-to-use-forwarddiff-jl-with-inv-and-matrix-exponential/137880)

<div class="topic-metadata">

**Author:** [@Xu\_Shan](https://discourse.julialang.org/u/Xu_Shan)\
**Replies:** 15\
**Last updated:** [July 4, 2026, 8:31pm UTC](https://discourse.julialang.org/t/how-to-use-forwarddiff-jl-with-inv-and-matrix-exponential/137880 "2026-07-04T20:31:45Z")

</div>

I have a question listed here: Why does ForwardDiff.jl give me all-zero Jacobian matrix?, and I found it might be due to part of the function which contains inv and exp (matrix exponential…) from ExponentialUtilities. I …

---

## [Is it possible to update NearestNeighbors.jl trees after construction?](https://discourse.julialang.org/t/is-it-possible-to-update-nearestneighbors-jl-trees-after-construction/137892)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 3\
**Last updated:** [July 4, 2026, 4:38pm UTC](https://discourse.julialang.org/t/is-it-possible-to-update-nearestneighbors-jl-trees-after-construction/137892 "2026-07-04T16:38:14Z")

</div>

Is it possible to update the data in a tree after construction? Say we need to add more points to the tree, how to push! or append!? I’ve read the documentation and there is no example for that. By reading the source cod…

---

## [VSCodeDebugger is precompiled in every debug or run session in VS Code](https://discourse.julialang.org/t/vscodedebugger-is-precompiled-in-every-debug-or-run-session-in-vs-code/137883)

<div class="topic-metadata">

**Author:** [@Yue-Zhengyuan](https://discourse.julialang.org/u/Yue-Zhengyuan)\
**Replies:** 1\
**Last updated:** [July 4, 2026, 3:49am UTC](https://discourse.julialang.org/t/vscodedebugger-is-precompiled-in-every-debug-or-run-session-in-vs-code/137883 "2026-07-04T03:49:30Z")

</div>

When running Julia files in a new process in VS Code, I find that the VSCodeDebugger is being compiled every time I start the process. Precompiling packages ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/1 ◐ VSCodeDebugg…

---

## [Run WASM files in julia](https://discourse.julialang.org/t/run-wasm-files-in-julia/137918)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 0\
**Last updated:** [July 3, 2026, 6:52am UTC](https://discourse.julialang.org/t/run-wasm-files-in-julia/137918 "2026-07-03T06:52:34Z")

</div>

Hello, I want to know if there is any Julia packages that are capable of taking a .wasm file and returning the functions stored in that file? I know that WasmTime.jl exists, but seems somewhat abandoned (it still uses a…

---

## [Reading compressed csv gzopen cuts file short](https://discourse.julialang.org/t/reading-compressed-csv-gzopen-cuts-file-short/137885)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 4\
**Last updated:** [July 1, 2026, 5:31pm UTC](https://discourse.julialang.org/t/reading-compressed-csv-gzopen-cuts-file-short/137885 "2026-07-01T17:31:48Z")

</div>

I seem to have stumbled into some kind of bug. I am working with large compressed CSV files. I’m loading the data with: mydata = gzopen(x-\>CSV.read(x, DataFrame), mydatafile) Then I just get this warning: ┌ Warning: t…

---

## [Good etiquette with wrapping a c-library](https://discourse.julialang.org/t/good-etiquette-with-wrapping-a-c-library/137881)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 11\
**Last updated:** [July 1, 2026, 12:12pm UTC](https://discourse.julialang.org/t/good-etiquette-with-wrapping-a-c-library/137881 "2026-07-01T12:12:40Z")

</div>

I am slowly wrapping a C-library in Julia. The c-library often gives a resultcode which indicates success or various problems. I am wondering what the preferred way of dealing with the resultcode is. Pass the resultc…

---

## [High-Performance, Lane-Based Segmented Sieve in Julia](https://discourse.julialang.org/t/high-performance-lane-based-segmented-sieve-in-julia/137854)

<div class="topic-metadata">

**Author:** [@Claugo](https://discourse.julialang.org/u/Claugo)\
**Replies:** 6\
**Last updated:** [July 1, 2026, 10:27am UTC](https://discourse.julialang.org/t/high-performance-lane-based-segmented-sieve-in-julia/137854 "2026-07-01T10:27:47Z")

</div>

Hi everyone I wanted to share a program I’ve been working on within my GC60 project, which focuses on high-magnitude prime searching (beyond the 64-bit barrier). The goal wasn’t just to write a fast sieve, but to explor…

---

## [PV-loop area](https://discourse.julialang.org/t/pv-loop-area/137839)

<div class="topic-metadata">

**Author:** [@violabini](https://discourse.julialang.org/u/violabini)\
**Replies:** 6\
**Last updated:** [June 30, 2026, 11:52am UTC](https://discourse.julialang.org/t/pv-loop-area/137839 "2026-06-30T11:52:05Z")

</div>

I am developing a 0D model for the cardiac circulation and I would like to compute the workload as the internal area of the Pressure Volume -loop. Do you know any method that allow me to do this even if my PV loop is ext…

---

## [Base.retry: what is it for?](https://discourse.julialang.org/t/base-retry-what-is-it-for/137815)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 1\
**Last updated:** [June 26, 2026, 9:17am UTC](https://discourse.julialang.org/t/base-retry-what-is-it-for/137815 "2026-06-26T09:17:55Z")

</div>

I understand the documentation for Base.retry. It seems useful but it does not seem to be used in Julia Base and in the standard library. Is there a specific reason?

---

## [Maximum\_a\_posteriori not honoring abstol and reltol? Turing.jl](https://discourse.julialang.org/t/maximum-a-posteriori-not-honoring-abstol-and-reltol-turing-jl/133402)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 7\
**Last updated:** [June 26, 2026, 6:45am UTC](https://discourse.julialang.org/t/maximum-a-posteriori-not-honoring-abstol-and-reltol-turing-jl/133402 "2026-06-26T06:45:38Z")

</div>

So, my student has a problem where he’s just been letting maximum\_a\_priori run for as long as it needs… which is taking like 2000+ seconds… I suggested to try abstol or reltol to make sure it wasn’t spending all its time…

---

## [How to write a type to a file?](https://discourse.julialang.org/t/how-to-write-a-type-to-a-file/137798)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 8\
**Last updated:** [June 26, 2026, 4:45am UTC](https://discourse.julialang.org/t/how-to-write-a-type-to-a-file/137798 "2026-06-26T04:45:37Z")

</div>

I’m writing a program to compute the halftone function, and I need to write a struct to a file because it takes a long time to compute. It consists of an OffsetVector of any real floating-point type. I’ve figured out h…

---

## [Static HTML Exports for Makie Proof of Concept](https://discourse.julialang.org/t/static-html-exports-for-makie-proof-of-concept/137597)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 6\
**Last updated:** [June 25, 2026, 6:46pm UTC](https://discourse.julialang.org/t/static-html-exports-for-makie-proof-of-concept/137597 "2026-06-25T18:46:03Z")

</div>

@bjarthur and I were exploring the state of static export of some dynamic Makie plots that vary in time. With the help of some AI agents (Google Antigravity CLI with Gemini Flash 3.5) we eventually found a path. I’ve cre…

---

## [Do you use Julia's extensive Unicode support?](https://discourse.julialang.org/t/do-you-use-julias-extensive-unicode-support/137702)

<div class="topic-metadata">

**Author:** [@li210](https://discourse.julialang.org/u/li210)\
**Replies:** 36\
**Last updated:** [June 25, 2026, 5:42pm UTC](https://discourse.julialang.org/t/do-you-use-julias-extensive-unicode-support/137702 "2026-06-25T17:42:04Z")

</div>

Julia puts emphasis on the possible use of non-ASCII symbols in code. Most of supported operators are Unicode characters, some well known mathematical symbols (albeit practically unseen in programming), some are quite ob…

---

## [Auto-differentiation of Numba LLVM IR using Enzyme.jl: linear algebra and opaque external functions](https://discourse.julialang.org/t/auto-differentiation-of-numba-llvm-ir-using-enzyme-jl-linear-algebra-and-opaque-external-functions/137799)

<div class="topic-metadata">

**Author:** [@ymardoukhi](https://discourse.julialang.org/u/ymardoukhi)\
**Replies:** 0\
**Last updated:** [June 25, 2026, 12:43pm UTC](https://discourse.julialang.org/t/auto-differentiation-of-numba-llvm-ir-using-enzyme-jl-linear-algebra-and-opaque-external-functions/137799 "2026-06-25T12:43:56Z")

</div>

This is related to the thread Get Numba LLVM IR differentiated in Julia using Enzyme.jl: differentiating Python functions decorated as Numba CFunc functions. I am sorry that this thread is quite long, but I tried to be a…

---

## [A package with multiple support for multiple GPU types](https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789)

<div class="topic-metadata">

**Author:** [@BananaMaster3](https://discourse.julialang.org/u/BananaMaster3)\
**Replies:** 3\
**Last updated:** [June 25, 2026, 4:00am UTC](https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789 "2026-06-25T04:00:08Z")

</div>

Hey all! I’m currently working on a package that uses the GPU. Being a good citizen, I’m adding support for different pipelines (via KernelAbstractions.jl, if that helps). How should I architect this in the package? I …

---

## [How does JETLS.jl cache/index external package symbols and docs?](https://discourse.julialang.org/t/how-does-jetls-jl-cache-index-external-package-symbols-and-docs/137611)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 4\
**Last updated:** [June 24, 2026, 8:25am UTC](https://discourse.julialang.org/t/how-does-jetls-jl-cache-index-external-package-symbols-and-docs/137611 "2026-06-24T08:25:34Z")

</div>

I maintain a VS Code–based editor that bundles a fork of julia-vscode. We currently don’t start LanguageServer.jl, partly to avoid SymbolServer.jl’s large serialized symbol cache and a fragile re-indexing path. We’re als…

---

## [What's a good prompt for AI agents running Julia numerical simulation tests](https://discourse.julialang.org/t/whats-a-good-prompt-for-ai-agents-running-julia-numerical-simulation-tests/137766)

<div class="topic-metadata">

**Author:** [@YiboXia](https://discourse.julialang.org/u/YiboXia)\
**Replies:** 2\
**Last updated:** [June 23, 2026, 7:51pm UTC](https://discourse.julialang.org/t/whats-a-good-prompt-for-ai-agents-running-julia-numerical-simulation-tests/137766 "2026-06-23T19:51:19Z")

</div>

Hi guys， Recently I have been using an AI coding agent(claude code) to do some numerical simulation test. The agent frequently crashes the run in many cases, for example with julia -e "..." Does anyone have some reliab…

---

## [Use \`Core.stdout\` and \`Core.stderr\` per default](https://discourse.julialang.org/t/use-core-stdout-and-core-stderr-per-default/134256)

<div class="topic-metadata">

**Author:** [@PatrickHaecker](https://discourse.julialang.org/u/PatrickHaecker)\
**Replies:** 1\
**Last updated:** [June 23, 2026, 3:26pm UTC](https://discourse.julialang.org/t/use-core-stdout-and-core-stderr-per-default/134256 "2026-06-23T15:26:37Z")

</div>

When using the --trim functionality, it quickly becomes inconvenient to always write the io to be Core.stdout when the non-trimmable Base.stdout was so convient as the default parameter (I focus here on stdout, but the s…

---

## [Certificate failure with Zscaler](https://discourse.julialang.org/t/certificate-failure-with-zscaler/137745)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 4\
**Last updated:** [June 23, 2026, 9:08am UTC](https://discourse.julialang.org/t/certificate-failure-with-zscaler/137745 "2026-06-23T09:08:29Z")

</div>

My company has recently switched to using Zscaler On my Windows laptop I use WSL juliaup update WARNING: cannot verify julialang-s3.julialang.org’s certificate, issued by ‘CN=Zscaler\_Trust.xxx.com (t)\\ ,OU=IT,O=XXX,…

---

## [Why does ForwardDiff.jl give me all-zero Jacobian matrix?](https://discourse.julialang.org/t/why-does-forwarddiff-jl-give-me-all-zero-jacobian-matrix/137714)

<div class="topic-metadata">

**Author:** [@Xu\_Shan](https://discourse.julialang.org/u/Xu_Shan)\
**Replies:** 5\
**Last updated:** [June 22, 2026, 7:45am UTC](https://discourse.julialang.org/t/why-does-forwarddiff-jl-give-me-all-zero-jacobian-matrix/137714 "2026-06-22T07:45:14Z")

</div>

Hi guys, I am using one Julia-based model from https://github.com/LandEcosystems/Sindbad.jl, and tries to use ForwardDiff.jl to calculate the Jacobian of the cost function to the optimized parameters. I run the pipeline…

---

## [Makie and LaTeX](https://discourse.julialang.org/t/makie-and-latex/137700)

<div class="topic-metadata">

**Author:** [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Replies:** 5\
**Last updated:** [June 20, 2026, 6:09am UTC](https://discourse.julialang.org/t/makie-and-latex/137700 "2026-06-20T06:09:22Z")

</div>

Hi. I was wondering whether there was a way to support stuff like \\boldsymbol{x} within Makie. It seems that using LateXStrings or MathTeXEngine do not allow to use such commands. Or am I missing something else? The to…

---

## [Keep n largest values compared by f](https://discourse.julialang.org/t/keep-n-largest-values-compared-by-f/137699)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [June 19, 2026, 5:04pm UTC](https://discourse.julialang.org/t/keep-n-largest-values-compared-by-f/137699 "2026-06-19T17:04:31Z")

</div>

I am iterating through about 10^6 values x and want to keep n of those for which f(x) is the largest.n is around 1000. I have looked at similar topics (1, 2, 3), some suggest maintaining a vector (see below), some min-m…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=5)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=7)
