# \#design

**URL:** https://discourse.julialang.org/tag/design/152.md

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

---

## [Matrix padding](https://discourse.julialang.org/t/matrix-padding/135250)

<div class="topic-metadata">

**Author:** [@rokke](https://discourse.julialang.org/u/rokke)\
**Replies:** 6\
**Last updated:** [January 26, 2026, 12:37pm UTC](https://discourse.julialang.org/t/matrix-padding/135250 "2026-01-26T12:37:59Z")

</div>

ok, I started opening things up to look at doing Pretty-printing small n-d arrays, but I came across a interesting choice which I wanted to make sure wasn’t a deliberate design decision. the left and right padding are co…

---

## [Building a JuliaHealth-specific Genie.jl Dashboard](https://discourse.julialang.org/t/building-a-juliahealth-specific-genie-jl-dashboard/133085)

<div class="topic-metadata">

**Author:** [@kosuri-indu](https://discourse.julialang.org/u/kosuri-indu)\
**Replies:** 6\
**Last updated:** [November 16, 2025, 2:17pm UTC](https://discourse.julialang.org/t/building-a-juliahealth-specific-genie-jl-dashboard/133085 "2025-11-16T14:17:31Z")

</div>

Hello everyone! :waving\_hand: I am currently working towards building a JuliaHealth-specific Dashboard using Genie.jl. The main idea is to have one simple, unified interface where users can: Load or connect to health …

---

## [Performance implications of computations in keyword arguments](https://discourse.julialang.org/t/performance-implications-of-computations-in-keyword-arguments/131977)

<div class="topic-metadata">

**Author:** [@loisel](https://discourse.julialang.org/u/loisel)\
**Replies:** 9\
**Last updated:** [September 1, 2025, 11:54am UTC](https://discourse.julialang.org/t/performance-implications-of-computations-in-keyword-arguments/131977 "2025-09-01T11:54:19Z")

</div>

Long story short, I’m putting my entire function into default values of keyword arguments, and I want to know if this is bad. I’m working on a Julia package to solve PDEs. The “driver code” of such solvers often has a z…

---

## [Why the free variables in function body don't get bound at function definition time?](https://discourse.julialang.org/t/why-the-free-variables-in-function-body-dont-get-bound-at-function-definition-time/128860)

<div class="topic-metadata">

**Author:** [@Leon\_Niceday](https://discourse.julialang.org/u/Leon_Niceday)\
**Replies:** 52\
**Last updated:** [May 14, 2025, 8:54pm UTC](https://discourse.julialang.org/t/why-the-free-variables-in-function-body-dont-get-bound-at-function-definition-time/128860 "2025-05-14T20:54:08Z")

</div>

Hi, What is the advantage to having such a difference between how variables use another variables vs how functions use them? # Assigning to variable julia\> a=1; julia\> b=a 1 julia\> a="asdf"; julia\> b 1 # OK, as expe…

---

## [Is it OK to structure my packages like this (benign type piracy)?](https://discourse.julialang.org/t/is-it-ok-to-structure-my-packages-like-this-benign-type-piracy/126627)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 5\
**Last updated:** [March 6, 2025, 10:13pm UTC](https://discourse.julialang.org/t/is-it-ok-to-structure-my-packages-like-this-benign-type-piracy/126627 "2025-03-06T22:13:48Z")

</div>

Is this design OK? Is this supported by precompilation? What could go wrong? Could package extensions help here somehow, if necessary? The idea is basically to define a function with no methods in PackageA and only add …

---

## [Dagger + Dates = snakemake?](https://discourse.julialang.org/t/dagger-dates-snakemake/126111)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 3\
**Last updated:** [February 25, 2025, 9:42am UTC](https://discourse.julialang.org/t/dagger-dates-snakemake/126111 "2025-02-25T09:42:25Z")

</div>

I have a folder data with samples (csv files), I want to compute some statistics for each file and then make a summary. In snakemake you can define rules how to produce the output file from the inputs, and snakemake will…

---

## [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…

---

## [What is a good design for a settable global with a known type?](https://discourse.julialang.org/t/what-is-a-good-design-for-a-settable-global-with-a-known-type/121770)

<div class="topic-metadata">

**Author:** [@jakobjpeters](https://discourse.julialang.org/u/jakobjpeters)\
**Replies:** 4\
**Last updated:** [October 26, 2024, 8:49am UTC](https://discourse.julialang.org/t/what-is-a-good-design-for-a-settable-global-with-a-known-type/121770 "2024-10-26T08:49:45Z")

</div>

In a package, I have a const s = "" that is used in a couple of functions. One of these functions doesn’t have a way for a user to specify a different string to use instead. What is a good way to make the value settable? …

---

## [Making \`setindex\` public, how to document it, rethinking the Collections docs](https://discourse.julialang.org/t/making-setindex-public-how-to-document-it-rethinking-the-collections-docs/117419)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 13\
**Last updated:** [August 15, 2024, 12:03am UTC](https://discourse.julialang.org/t/making-setindex-public-how-to-document-it-rethinking-the-collections-docs/117419 "2024-08-15T00:03:06Z")

</div>

@aplavin is trying to make Base.setindex a public API of Julia, which seems like a good idea, given that many packages use it already and it seems like an OK interface. The question is, how to document it. The function i…

---

## [I don't get Base.IteratorElType](https://discourse.julialang.org/t/i-dont-get-base-iteratoreltype/113604)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 6\
**Last updated:** [April 30, 2024, 7:50am UTC](https://discourse.julialang.org/t/i-dont-get-base-iteratoreltype/113604 "2024-04-30T07:50:15Z")

</div>

Motivation I’m implementing a collect-like function for a certain subtype of AbstractArray, FixedSizeArray (@giordano). The function is supposed to take an arbitrary iterator, consume it, and return a FixedSizeArray valu…

---

## [Job Position @ EnviTrace](https://discourse.julialang.org/t/job-position-envitrace/111682)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 0\
**Last updated:** [March 15, 2024, 8:58pm UTC](https://discourse.julialang.org/t/job-position-envitrace/111682 "2024-03-15T20:58:21Z")

</div>

Our company (EnviTrace; https://envitrace.com) is seeking a quote for contract support to design Julia software and interactive web/mobile applications. The software will be deployed on the cloud. Interactive visualizat…

---

## [Should Any have an identity constructor method?](https://discourse.julialang.org/t/should-any-have-an-identity-constructor-method/109500)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 10\
**Last updated:** [January 31, 2024, 10:31am UTC](https://discourse.julialang.org/t/should-any-have-an-identity-constructor-method/109500 "2024-01-31T10:31:00Z")

</div>

Many non-concrete types have constructors, for example we have AbstractFloat(0.3) == 0.3 and Union{Int,Float64}(0.3) == 0.3. Should we also have a method like Any(x) = x? Then we would have map(Any, \[3,4,5\]) == map(ident…

---

## [How to Sensibly Implement Generic Slice Indexing for Custom Array Type](https://discourse.julialang.org/t/how-to-sensibly-implement-generic-slice-indexing-for-custom-array-type/109289)

<div class="topic-metadata">

**Author:** [@AlexanderNenninger](https://discourse.julialang.org/u/AlexanderNenninger)\
**Replies:** 3\
**Last updated:** [January 29, 2024, 8:38am UTC](https://discourse.julialang.org/t/how-to-sensibly-implement-generic-slice-indexing-for-custom-array-type/109289 "2024-01-29T08:38:01Z")

</div>

I have a custom array type that I want to implement custom Base.getindex for: struct MyReadOnlyArray{T, N} \<: AbstractArray{T, N} ... size::NTuple{N, Int} end Not it needs to be n-dimensional. For single entrie…

---

## [Reference counting and disposables](https://discourse.julialang.org/t/reference-counting-and-disposables/98875)

<div class="topic-metadata">

**Author:** [@stemann](https://discourse.julialang.org/u/stemann)\
**Replies:** 4\
**Last updated:** [August 12, 2023, 8:56am UTC](https://discourse.julialang.org/t/reference-counting-and-disposables/98875 "2023-08-12T08:56:09Z")

</div>

In ResourcePools.jl/pooled\_abstract\_array.jl at feature/multi-threading · IHPSystems/ResourcePools.jl · GitHub, I have two concepts - in addition to pooled resources / pools of resources: Reference counted instances - …

---

## [Is it ok to write interfaces that require field access on subtypes?](https://discourse.julialang.org/t/is-it-ok-to-write-interfaces-that-require-field-access-on-subtypes/98429)

<div class="topic-metadata">

**Author:** [@aleferna12](https://discourse.julialang.org/u/aleferna12)\
**Replies:** 6\
**Last updated:** [May 8, 2023, 9:12am UTC](https://discourse.julialang.org/t/is-it-ok-to-write-interfaces-that-require-field-access-on-subtypes/98429 "2023-05-08T09:12:04Z")

</div>

Hello! Since we can’t define fields on abstract types (at least yet, see this very long discussion), I was wondering whether the following design pattern is considered good practice in Julia: abstract type A end struc…

---

## [Allowing the object.method(args...) syntax as an alias for method(object, args ...)](https://discourse.julialang.org/t/allowing-the-object-method-args-syntax-as-an-alias-for-method-object-args/62051)

<div class="topic-metadata">

**Author:** [@gianmariomanca](https://discourse.julialang.org/u/gianmariomanca)\
**Replies:** 215\
**Last updated:** [March 14, 2023, 7:04am UTC](https://discourse.julialang.org/t/allowing-the-object-method-args-syntax-as-an-alias-for-method-object-args/62051 "2023-03-14T07:04:49Z")

</div>

I started exploring Julia very recently and I like it. I’ve been chatting about it with colleagues. Many people coming from OOP languages (Python…) like the syntax object.method(a,b,c…). Since you can get a preview of …

---

## [Why is \`Test\` so meta-programming heavy?](https://discourse.julialang.org/t/why-is-test-so-meta-programming-heavy/94619)

<div class="topic-metadata">

**Author:** [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Replies:** 29\
**Last updated:** [February 20, 2023, 8:14pm UTC](https://discourse.julialang.org/t/why-is-test-so-meta-programming-heavy/94619 "2023-02-20T20:14:33Z")

</div>

I am quite puzzled by the design choices of Julia’s Test - so I thought I should write my current understanding so that people can tell me what they think, or if I am misunderstanding something. As I understand it, Juli…

---

## [Keeping well-defined mathematical functions orthogonal to a project structs design](https://discourse.julialang.org/t/keeping-well-defined-mathematical-functions-orthogonal-to-a-project-structs-design/92601)

<div class="topic-metadata">

**Author:** [@dalbandea](https://discourse.julialang.org/u/dalbandea)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 5:51pm UTC](https://discourse.julialang.org/t/keeping-well-defined-mathematical-functions-orthogonal-to-a-project-structs-design/92601 "2023-01-06T17:51:09Z")

</div>

I have a doubt regarding a design pattern. To expose it I’m going to refer to IterativeSolvers.jl’s Conjugate Gradient algorithm. For the end user, they supply the function cg(A, b; kwargs...), which solves the equation…

---

## [Design Q: Order of arguments: input data and algorithm type](https://discourse.julialang.org/t/design-q-order-of-arguments-input-data-and-algorithm-type/91768)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 4\
**Last updated:** [December 17, 2022, 4:17pm UTC](https://discourse.julialang.org/t/design-q-order-of-arguments-input-data-and-algorithm-type/91768 "2022-12-17T16:17:34Z")

</div>

Hey all, (wasn’t sure in which category to post it) We are doing a lot of refactoring across many JuliaDynamics packages at the moment. A question that always comes up in the refactoring concerns the order of arguments…

---

## [Julia better rewritten in rust?](https://discourse.julialang.org/t/julia-better-rewritten-in-rust/84151)

<div class="topic-metadata">

**Author:** [@Yebjhar\_Wulden](https://discourse.julialang.org/u/Yebjhar_Wulden)\
**Replies:** 17\
**Last updated:** [August 3, 2022, 12:33pm UTC](https://discourse.julialang.org/t/julia-better-rewritten-in-rust/84151 "2022-08-03T12:33:53Z")

</div>

seeing the julia code is actually wrtten in c++, scheme, c and mainly julia so comes a question to my mind what if the c++/c code were rewritten in rust? or haskell basically any memory-safe good-performance language? …

---

## [\[pre-ANN/RFC\] VectorInterface.jl](https://discourse.julialang.org/t/pre-ann-rfc-vectorinterface-jl/85231)

<div class="topic-metadata">

**Author:** [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Replies:** 4\
**Last updated:** [August 3, 2022, 8:34pm UTC](https://discourse.julialang.org/t/pre-ann-rfc-vectorinterface-jl/85231 "2022-08-03T20:34:22Z")

</div>

This is more a “request for comments” than an announcement. I’ve just created (but not registered) a package called VectorInterface.jl. Why? The following is a copy of the README. It is long, but I wanted to do a decent …

---

## [How to deal with inconsistent objects due to mutation](https://discourse.julialang.org/t/how-to-deal-with-inconsistent-objects-due-to-mutation/77960)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 19\
**Last updated:** [March 17, 2022, 7:58am UTC](https://discourse.julialang.org/t/how-to-deal-with-inconsistent-objects-due-to-mutation/77960 "2022-03-17T07:58:42Z")

</div>

This is a bit of a basic philosophical question about type and API design. I would love the input of more experienced coders, since I suspect I might be approaching my problem wrong. I have a type in essence similar to: …

---

## [Any guides on designing an interface?](https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 3\
**Last updated:** [March 5, 2022, 7:37pm UTC](https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173 "2022-03-05T19:37:36Z")

</div>

I sometimes read things like how the Pkg.jl developers have thought long about how the API/Interface should look. The problem seems clear: “Make a useful interface”, but I don’t have any clue on how it can be approached.…

---

## [Inheritance in Parametric Types](https://discourse.julialang.org/t/inheritance-in-parametric-types/74811)

<div class="topic-metadata">

**Author:** [@davibarreira](https://discourse.julialang.org/u/davibarreira)\
**Replies:** 7\
**Last updated:** [January 19, 2022, 12:56pm UTC](https://discourse.julialang.org/t/inheritance-in-parametric-types/74811 "2022-01-19T12:56:38Z")

</div>

Friends, I have a small conundrum in terms on code design, and some input is more than welcomed. So, I’m developing a plotting library, and I have a struct called Marker. Now, the code implements different markers, e.g.…

---

## [Tips on code design for writing new packages](https://discourse.julialang.org/t/tips-on-code-design-for-writing-new-packages/72989)

<div class="topic-metadata">

**Author:** [@davibarreira](https://discourse.julialang.org/u/davibarreira)\
**Replies:** 2\
**Last updated:** [December 12, 2021, 8:48pm UTC](https://discourse.julialang.org/t/tips-on-code-design-for-writing-new-packages/72989 "2021-12-12T20:48:23Z")

</div>

When starting a new package, I’m always overwhelmed by the multiple possibilities of how to desig my code. I was wondering what are some good references out there on how “design your code” for package development in Juli…

---

## [On beauty of Distributions.jl pdf interface](https://discourse.julialang.org/t/on-beauty-of-distributions-jl-pdf-interface/67895)

<div class="topic-metadata">

**Author:** [@thisismygitrepo](https://discourse.julialang.org/u/thisismygitrepo)\
**Replies:** 20\
**Last updated:** [September 14, 2021, 11:18am UTC](https://discourse.julialang.org/t/on-beauty-of-distributions-jl-pdf-interface/67895 "2021-09-14T11:18:51Z")

</div>

Julia is often touted for its syntax that resembles math notation. I have a kind of objection here. Getting values of this density function with this syntax is awkward to say the least. Shouldn’t this be simply p(0:0…

---

## [Golang-like member functions](https://discourse.julialang.org/t/golang-like-member-functions/65254)

<div class="topic-metadata">

**Author:** [@peteole](https://discourse.julialang.org/u/peteole)\
**Replies:** 12\
**Last updated:** [July 27, 2021, 7:30am UTC](https://discourse.julialang.org/t/golang-like-member-functions/65254 "2021-07-27T07:30:58Z")

</div>

Hi, I recently found out about the notation for callables: function (obj::MyType)(x::Int) return obj.mymember\*x end I realized this syntax is extremely similar to the golang and rust-notation for member functions. …

---

## [Julian design for API library with Websocket client](https://discourse.julialang.org/t/julian-design-for-api-library-with-websocket-client/60281)

<div class="topic-metadata">

**Author:** [@Spirarel](https://discourse.julialang.org/u/Spirarel)\
**Replies:** 2\
**Last updated:** [May 1, 2021, 12:00am UTC](https://discourse.julialang.org/t/julian-design-for-api-library-with-websocket-client/60281 "2021-05-01T00:00:15Z")

</div>

I’m writing a Julia library to interact with an API that communicates via HTTP.Websockets. I’m struggling to find good, non-toy-repl, examples that illustrate the kind of contract a Julia dev would expect. In OO land it’…

---

## [Recommended way to cache results of expensive functions?](https://discourse.julialang.org/t/recommended-way-to-cache-results-of-expensive-functions/55239)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 6\
**Last updated:** [February 14, 2021, 9:52am UTC](https://discourse.julialang.org/t/recommended-way-to-cache-results-of-expensive-functions/55239 "2021-02-14T09:52:59Z")

</div>

Suppose that I have a function f: Int --\> Float64 that conducts some expensive computation, but the integer inputs into f typically have only a very small number of possible values. I thus want to cache the results for s…

---

## [Program design: Types with only fixed Parameters?](https://discourse.julialang.org/t/program-design-types-with-only-fixed-parameters/54316)

<div class="topic-metadata">

**Author:** [@florian](https://discourse.julialang.org/u/florian)\
**Replies:** 1\
**Last updated:** [January 31, 2021, 12:42pm UTC](https://discourse.julialang.org/t/program-design-types-with-only-fixed-parameters/54316 "2021-01-31T12:42:45Z")

</div>

Hi everyone, I’m trying to get used to programming with custom types and am in the following situation: Suppose I want to write a Program that calls an API, and there are different types of calls. First, I made a struc…

[Next page](https://discourse.julialang.org/tag/design/152.md?match_all_tags=true&page=1&tags%5B%5D=design)
