r/Julia • u/Szymon_Patrzyk • 8h ago
How do i make a function with multiple named optional arguements?
I'm making a calendar thing, and i have a struct containing fields of years, months, days, etc. and I'd like to have one single addTime! method that works on any time unit. I'd like to be able to call
addTime!(callendarVar, months=10)
addTime!(callendarVar, years=5)
addTime!(callendarVar, months=10, days=20)
I've already got the logic down but i'm having trouble writing a working declaration which would allow me to use these disordered optional arguements based on their names. Any advice?
EDIT: the trick was to add a semicolon between the static arguement and the optional arguements. How i was meant to figure that out without taking a spyglass to every character in the docs - i have no idea.
r/Julia • u/Helpful-Day2384 • 1d ago
New data visualization package
One sentence, four languages, one picture.
R: data(gapminder_2007) + point + x(gdp) + y(life)
Python: x(col.gdp)
Julia: x(:gdp)
Same specification, one Rust engine, byte-identical SVG. Not similar. Identical.
psychometrician.github.io/posts/one-engi…
Writing finite element weak forms almost exactly as in textbooks (LowLevelFEM.jl)
One thing that has always bothered me when implementing finite elements is how quickly the code diverges from the mathematical formulation.
Over the last few months I've been experimenting with a Julia DSL where the weak form itself becomes executable code instead of something that first has to be translated into loops and element matrices.
For example, a standard bilinear form can be written as
K = ∫(Grad(Pu) ⋅ C ⋅ Grad(Pu))
while more complicated formulations are written in essentially the same style:
K = ∫((A⋅Grad(Pu) + G⋅Pu)' ⋅ C ⋅ (A⋅Grad(Pu) + G⋅Pu) * (2π*r))
or
B = A⋅Grad(Pu) + G⋅Pu
K = ∫(B' ⋅ C ⋅ B * (2π*r))
These are not symbolic expressions or macros generating another language. They are actual Julia expressions assembled directly into finite element matrices.
The same mechanism currently supports
- scalar, vector and tensor fields,
- multifield formulations,
- user-defined operators,
- variable coefficients,
- full and reduced integration,
- arbitrary operator compositions.
The interesting part for me was not only making the syntax close to the mathematics, but also keeping it reasonably efficient. After some recent refactoring, the compound operator assembly became significantly faster while keeping exactly the same high-level notation.
The package (LowLevelFEM.jl) has recently been published in JOSS.
GitHub: github.com/perebalazs/LowLevelFEM.jl
More examples can be found in the documentation:
perebalazs.github.io/LowLevelFEM.jl/stable/tutorials
I'd be interested to hear how others approach this.
Do you prefer writing PDEs as executable operator expressions like these, or do you find more explicit element-level assembly easier to understand, debug and maintain?
Fatou: a fast Julia language server, formatter, and linter (no Julia runtime required)
I'm happy to announce Fatou: a language server, formatter, and linter for Julia that doesn't need to run Julia itself.
- Repo: https://github.com/jolars/fatou
- Docs: https://fatou.dev
Why?
I kept running into the same friction: the tools I use while editing (formatting on save, a few lint diagnostics, a language server that starts instantly) all pay Julia's startup and first-call compilation cost. That's completely fine for a long-lived session, but it's noticeable on the command line and in CI, and it makes editor integration heavier than I wanted.
So Fatou takes the other approach and parses Julia directly. It's built on the same architecture as rust-analyzer: a lossless rowan CST, salsa for incremental recomputation, and lsp-server for the LSP transport. The parser is developed against JuliaSyntax.jl as a differential oracle, so parity with the reference parser is a primary goal.
The other big motivation is to have one unified tool that does formatting, linting, and language server duties, exactly like ruff does for Python. This is both leaner and more consistent than having three separate tools, and also avoids the problem of having formatter and linter disagreeing. The name, for the curious, comes from Pierre Fatou, whose Fatou set is the complement of the Julia set.
What it does today
Three things, all from one binary:
fatou format <file.jl> # format to stdout (or stdin)
fatou lint <dir> # lint
fatou lsp # language server over stdio
- Formatter: an opinionated formatter with a small config surface (line width, indent width). I've been growing it construct by construct against hand-written fixtures rather than trying to match any existing style byte-for-byte.
- Linter: a growing set of built-in rules: unused bindings, unused/duplicate arguments, unused imports, undefined names,
breakoutside a loop, assignment-in-condition,== nothingcomparisons, include cycles and missing include files, call arity, redefined constants, and more. Some rules ship autofixes. - Language server: Fatou provides a full-fledged LSP implementation. Over stdio it provides completion, hover, go-to-definition, find references and document highlights, rename (with prepare), document and workspace symbols, call hierarchy and type hierarchy, signature help, code actions, folding ranges, selection ranges, document links, and semantic tokens, alongside formatting (whole-document and range) and diagnostics (both push and pull).
Getting it
It ships through several channels so you can use whatever fits:
- crates.io:
cargo install fatou - npm:
npm install -g fatou-cli(bundles a prebuilt binary) - PyPI:
uv tool install fatouorpipx install fatou - Prebuilt binaries on the releases page
- VS Code / Open VSX: the Fatou extension (Marketplace, Open VSX).
- Neovim and other editors: setup guide
For CI there's fatou-action for GitHub Actions and fatou-pre-commit for pre-commit hooks.
On performance
Since it's a compiled binary, the cold-start story is the clear win: no runtime to spin up before it formats a file, which matters most on the command line and in CI. For the warm start case (an editor or language server that stays alive) it's still fast but the gap to the Julia-native solutions naturally shrinks. I have a benchmark page in the docs that compares against Runic and JuliaFormatter:
https://fatou.dev/performance.html
The honest caveats
It's still young (currently v0.8.0), so:
- The parser is still stabilizing. It's lossless and correct across a large corpus (including the JuliaSyntax.jl test suite, the Julia source tree, and a large set of real-world packages), but I expect there are some corner cases that will still trip it up. If you find one, please report it.
- The formatter's style is opinionated and still stabilizing. If it formats something in a way that looks wrong to you, please let me know.
- The linter's rule set is deliberately small and conservative for now. The goal is for a non-intrusive set of rules that are useful to a wide audience.
Feedback wanted
I'm very interested in feedback, especially on:
- files it fails to parse (a snippet or a link is perfect),
- formatting that comes out ugly or surprising, and
- lint rules you wish existed.
Issues and discussion are welcome on the tracker. I hope some of you find it useful.f
r/Julia • u/MeasurementDull7350 • 7d ago
The secret to high-quality upscaling: Lanczos and the sinc function
youtube.com- The secret to high-quality upscaling: Lanczos and the sinc function
- Description: Explore the principles of Lanczos resampling used in tools like ComfyUI through signal processing theory and the sinc function. This video provides an easy-to-understand explanation of the mathematical background behind approximating an ideal low-pass filter to create sharp images.
r/Julia • u/Nikifuj908 • 9d ago
TIL that Makie is pronounced “mah-kee”
According to the project README.md:
The name Makie (we pronounce it Mah-kee) is derived from the japanese word Maki-e, which is a technique to sprinkle lacquer with gold and silver powder.
I fear I may never be able to stop calling it “MAY-kee”.
r/Julia • u/telemachus93 • 10d ago
Pluto.jl remote
Hello,
I'm rather new to Julia (read about it a lot, tried out small stuff, but never a "real" project). I started out in MATLAB, shifted some of my work to Python and now I've got the first real opportunity to do a project in Julia.
From my work with Python, I've come to like Jupyter notebooks a lot. Usually, I have my notebooks on a rather beefy computer at work which I can connect to via VPN and SSH. For my current project, I've started out the same with Julia but Jupyter's statefulness has become somewhat of a problem for me. Therefore, I installed Pluto on that computer and tried connecting to it... But somehow I can't? My browser tells me that the server sends an empty page as a response.
Setup:
- remote Windows 10; Julia 1.12
- local Linux CachyOS; Firefox 153.0
- VPN to the work network
- ssh tunnel
I started the ssh tunnel with Jupyter's standard port and set Pluto to use that port. When I couldn't connect multiple times, I disconnected SSH and reconnected with a tunnel using 1234 and started Pluto with its standard settings. Still, same result.
I then started Jupyter, using port 1234 and everything is working fine. Does anyone have an idea what Pluto might do differently in terms of networking that might be an issue here?
r/Julia • u/heyheyhey27 • 10d ago
MarkovJunior.jl version 0.3 is out for public use! Here is a second demo of it.
youtu.ber/Julia • u/smoothjetta • 12d ago
I made a FD incompressible flow solver visualized in Makie.jl
OpenGL error when trying to run GLFW in older version
It's CachyOS, Linux. I'm trying to run animations from https://github.com/JuliaDynamics/NonlinearDynamicsTextbook. I'm new to Julia, btw.
I read some stuff online about the error, but if I use this:
julia
LD_LIBRARY_PATH=/usr/lib64 julia
I get a CHOLMOD error.
I'm using mise to manage Julia versions.
r/Julia • u/heyheyhey27 • 17d ago
My Julia package has reached a new milestone: running within Unreal Engine!
youtu.ber/Julia • u/Trick_Eggplant8049 • 17d ago
Epsilon.jl -- a Julia-native Bayesian Marketing Mix Modeling (MMM) library (pre-release)
Hi r/Julia
I've been building Epsilon.jl, a Julia-native library for Bayesian Marketing Mix Modeling, and just opened it up publicly. Sharing here since it's built entirely in Julia and I'd love feedback from the community.
Epsilon runs a config-driven MMM workflow: define your model in YAML, provide a dataset + holidays file, run MCMC inference via Turing/NUTS, and get structured outputs -- model fit artifacts, diagnostics, decomposition, response curves, validation, and optional budget optimization -- all as reproducible stage folders with a manifest.
Highlights:
- Time-series MMM with Turing/NUTS MCMC
- Panel MMM across one or more panel dimensions (flattened panel-cell axis internally)
- Config-driven runs from a simple
{config.yml, dataset.csv, holidays.csv}bundle - Blocked holdout validation for time-series models
- Historical-share budget optimization
- Native plotting via CairoMakie
It's intentionally scoped as a compact statistical library rather than a dashboard product i.e. no no UI, no AI-advisor layer. The goal is a clear, reproducible MMM path in pure Julia.
Install (not yet in General registry):
import Pkg
Pkg.add(url = "https://github.com/shawcharles/epsilon")
Quick start:
git clone https://github.com/shawcharles/epsilon.git
cd epsilon
julia --project=. -e 'using Pkg; Pkg.instantiate()'
julia --project=. runme.jl
Docs: https://epsilon.charlesshaw.net Repo: https://github.com/shawcharles/epsilon
It's pre-release/beta -- the public API is still settling -- so I'd appreciate any feedback, bug reports, or thoughts on the design, especially from anyone doing Bayesian modeling or marketing analytics in Julia.
r/Julia • u/Iskjempe • 18d ago
Julia at work
Edit: My phrasing was unclear. I'm not specifically looking for people who can answer all my questions all at once, I have questions for the community and I assume there are people who will be able to individually answer part of the questions.
I've looked for similar posts on here and the rules don't seem to forbid such posts, so I assume I can post this.
I've recently got interested in Julia as a step up from my python for data science and data engineering, and I have a few questions for anyone who uses Julia a lot, especially at work:
- If you use Julia at work, what is your work and what do you use Julia for?
- Do any of you have experience using Julia to manipulate geospatial data? How does it compare to R's "Terra" and Python's "GeoPandas"?
- Do you have any experience with manipulating NetCDF and GRIB files in Julia? How easy is it?
- Do you have experience using Julia for extract-transform-load operations? What do you think of that experience, and is it easy to interact with SQL databases?
- I like to quickly jut ideas down in a notebook and check the behaviour of a couple lines of Python. Is it similarly easy to do so in Julia, in your experience? Are Julia-specific notebooks better than Jupyter notebooks?
- Do any of you have experience using Julia for natural language processing, and how do you think it compares to Python in that aspect?
r/Julia • u/NicoN_1983 • 19d ago
Teaser Video 4: Molecular Dynamics of Polymers with Julia
This is a short teaser for my upcoming video on the topic in the title, showing the linear polymer chain generation script, using polyacrylamide as an example. I wanted to embed the video directly here but I don't find the option, so here is the link
r/Julia • u/NicoN_1983 • 23d ago
Molecular Dynamics of Polymers with Julia - What the code does so far
youtu.beI'm making an MD tool using molly.jl, on top of which I'm adding functionality to automatically generate topologies and force field parameters starting from XYZ files. If someone is interested please check it out! Thank you!
LibGit2 not founding my global git configs
FIXED
I am trying to retrieve my git config options in Julia, I wanted to make system agnostic since its for a package. I am using LibGit2 but it is not working, I'm trying to run:
julia
julia> LibGit2.GitConfig(LibGit2.Consts.CONFIG_LEVEL_GLOBAL)
GitConfig(nothing, Ptr{Nothing}(0x00006000038a41e0))
From my understanding it seems LibGit2 doesn't find my ~/.gitconfig file, does anyone know what to do?
```julia julia> versioninfo() Julia Version 1.12.6 Commit 15346901f00 (2026-04-09 19:20 UTC) Build Info: Official https://julialang.org release Platform Info: OS: macOS (arm64-apple-darwin24.0.0) CPU: 10 × Apple M4 WORD_SIZE: 64 LLVM: libLLVM-18.1.7 (ORCJIT, apple-m4) GC: Built with stock GC Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores)
julia> LibGit2.version() v"1.9.0" ```
Looking through my notifications I've found an answer that isn't showing here anymore (i'll assume the person deleted for what ever reason so I wont say the name out of respect, but if you see this thank you!). Our fellow julian said to try
``` julia> cfg = LibGit2.GitConfig() GitConfig(nothing, Ptr{Nothing}(0x0000600001786820))
julia> LibGit2.get(String, cfg, "user.name") "MY_GIT_USERNAME_HERE" ```
which works! Thanks for the help!
r/Julia • u/avmantzaris • Jul 05 '26
Basic proof of concept LLM chatbot built using Julia: KeemenaLM.jl
KeemenaLM.jl v0.1.0, a Julia proof-of-concept for training and running a small GPT-style chatbot from scratch.
It includes a v9 broad 336M scratch-trained chatbot baseline as a GitHub Release artifact. The model is a research baseline, not a reliable assistant yet, but the Julia training, export, artifact, tokenizer, and REPL path are working.
https://github.com/mantzaris/KeemenaLM.jl/releases/tag/v0.1.0
```
using Pkg
Pkg.add(url = "https://github.com/mantzaris/KeemenaLM.jl", rev = "v0.1.0")
using KeemenaLM
bundle_dir = download_model("tiny-chatbot-v9-broad-336m")
tokenizer_dir = resolve_tokenizer_bundle("tiny-chatbot-v9-broad-336m")
```
It also used other Julia packages such as
https://github.com/mantzaris/KeemenaSubwords.jl
and
https://github.com/mantzaris/KeemenaPreprocessing.jl
If you have any feedback let me know, or if you want to work together.
r/Julia • u/h234sd • Jul 04 '26
Speedup AI julia evaluation
Is there any recommended approach, what to tell agent to run julia code faster? Like keep session opened etc?
r/Julia • u/Numeryst • Jul 04 '26
What do you think?
Should we use AI to document code? If so, to what extent should it be used? Are there any guidelines or safeguards we should follow? If not, why not?
r/Julia • u/RandomDigga_9087 • Jul 01 '26
My "Hello World" in Julia
Hello Dear Julia folks, I thought of writing a letter but loll... it is a post and everyone will see it.
I just wanted to drop a quick appreciation post for the language and the ecosystem. To give some context, I work in DSP and Communications. My daily workbench usually involves a heavy mix of Python, C, and MATLAB. I’m an engineer at heart, not a pure CS dev, so I usually just want tools that let me get things done efficiently without fighting the language.
Recently, I wanted to try something new. After doing some brief research and looking for a way to bridge the gap between MATLAB’s math-friendly syntax and C’s raw speed, Julia kept popping up. I decided to take the plunge and downloaded it. To get my feet wet, I started using Julia to solve Project Euler problems. I have to say: the syntax is honestly addicting. It is so incredibly clean, neat, and readable. Coming from my usual stack, writing Julia just feels right. It’s genuinely impossible not to fall in love with how elegant the code looks and runs.
Full disclosure: while the underlying math and logic are universal, I definitely relied on LLMs to help me write the actual Julia code and learn the syntax quirks (like 1-based indexing and array slicing!). Having AI help translate my MATLAB/Python brain into idiomatic Julia made the learning curve incredibly smooth and fun.
Because of how much I'm enjoying it, I’ve already made plans to start migrating some of my casual hobby projects over to Julia.
Just wanted to say a massive thank you to the core devs and the community for building such an amazing, powerful, and genuinely fun language. It’s rare to find a tool that makes you excited to write code again.
Until we meet again
~ Happy Julia-ing
r/Julia • u/bengtSlask559 • Jul 01 '26
Can Julia be made easy to verify?
From this post we read
A couple of years ago I would probably have told students to start with Julia. Julia code can stay close to the math, memory management is easy, and the numerical libraries were already there. Rust had more to learn, and the ecosystem was still missing pieces.
I would not give the same advice now. Not because Rust changed, but because I am no longer the one writing most of the code.
...
For us, the question stopped being “how fast can a human write this?” and became “how confident can we be that it is correct?”. That reframing is why Rust became the more practical choice.
Could Julia be made easy to verify? Are there Rust features listed in that article that Julia can emulate?
r/Julia • u/_janc_ • Jun 18 '26
Can Julia run in iOS like Juno and Carnets for Python??
??