# Internals & Design

**URL:** https://discourse.julialang.org/c/dev/5.md?page=18

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

**Page:** 19

---

## [First Pluto notebook launches are slower on Julia 1.9 beta 3](https://discourse.julialang.org/t/first-pluto-notebook-launches-are-slower-on-julia-1-9-beta-3/93429)

<div class="topic-metadata">

**Author:** [@fonsp](https://discourse.julialang.org/u/fonsp)\
**Replies:** 157\
**Last updated:** [February 10, 2023, 3:30pm UTC](https://discourse.julialang.org/t/first-pluto-notebook-launches-are-slower-on-julia-1-9-beta-3/93429 "2023-02-10T15:30:58Z")

</div>

Hi! :waving\_hand: Today, I ran some benchmarks to compare real-life launch times for first-time users of Julia 1.9.0-beta3 vs Julia 1.8.5. That means people who just installed Julia on their computer, and they are excite…

---

## [Hashing Method Cache IDs](https://discourse.julialang.org/t/hashing-method-cache-ids/94239)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 4\
**Last updated:** [February 8, 2023, 9:48pm UTC](https://discourse.julialang.org/t/hashing-method-cache-ids/94239 "2023-02-08T21:48:06Z")

</div>

Disclosure at the top, I’m asking a question here that is out of my depth, but I keep thinking about it and would really appreciate the thoughts of smart folks. A while back, I watched this Strange Loop Talk on Unison, …

---

## [RFC: Language Support for Traits — Yay or Nay?](https://discourse.julialang.org/t/rfc-language-support-for-traits-yay-or-nay/93914)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 45\
**Last updated:** [February 8, 2023, 1:51am UTC](https://discourse.julialang.org/t/rfc-language-support-for-traits-yay-or-nay/93914 "2023-02-08T01:51:46Z")

</div>

A repeated gripe I see from the local gray-hairs about Julia’s type system pertains to the lack of language support for multiple inheritance through traits—to manage those pesky behaviors that fall outside the type hiera…

---

## [Constant propagation and inference of constructed types](https://discourse.julialang.org/t/constant-propagation-and-inference-of-constructed-types/36279)

<div class="topic-metadata">

**Author:** [@benninkrs](https://discourse.julialang.org/u/benninkrs)\
**Replies:** 14\
**Last updated:** [February 7, 2023, 10:49pm UTC](https://discourse.julialang.org/t/constant-propagation-and-inference-of-constructed-types/36279 "2023-02-07T22:49:01Z")

</div>

Context: I had a parameterized struct type with convenience constructors that input some of the parameters as arguments. Based on previous experience, I expected that if such constructors are provided with constant valu…

---

## [Call FastClosures.jl \`@closure\` in Array Comprehensions?](https://discourse.julialang.org/t/call-fastclosures-jl-closure-in-array-comprehensions/93622)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 2\
**Last updated:** [February 3, 2023, 1:44am UTC](https://discourse.julialang.org/t/call-fastclosures-jl-closure-in-array-comprehensions/93622 "2023-02-03T01:44:42Z")

</div>

Like with any closure, array comprehensions present a performance challenge if they capture a variable whose identifier is reassigned: julia\> using BenchmarkTools julia\> const a=\[1:1000;\]; julia\> @btime let b=a; \[b\[x\]…

---

## [Compilation-ignoring timer?](https://discourse.julialang.org/t/compilation-ignoring-timer/93512)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 4\
**Last updated:** [February 3, 2023, 1:37am UTC](https://discourse.julialang.org/t/compilation-ignoring-timer/93512 "2023-02-03T01:37:54Z")

</div>

Does Julia have, or would it be possible to add, a compilation-ignoring timer? Use case: setting a time limit for running a function, as is common for optimizers. The first execution will be necessarily longer than the …

---

## [Edit an externally hosted standard library](https://discourse.julialang.org/t/edit-an-externally-hosted-standard-library/90740)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 4\
**Last updated:** [February 2, 2023, 9:12pm UTC](https://discourse.julialang.org/t/edit-an-externally-hosted-standard-library/90740 "2023-02-02T21:12:12Z")

</div>

Most packages can be edited with \]dev DataFrames. Code in Julia’s Base and internal stdlibs (those hosted in GitHub - JuliaLang/julia: The Julia Programming Language) can be edited by cloning Julia and using Revise.track…

---

## [Why don't \`Any\` constraints check that the parameter is a type](https://discourse.julialang.org/t/why-dont-any-constraints-check-that-the-parameter-is-a-type/93920)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 12\
**Last updated:** [February 2, 2023, 6:22pm UTC](https://discourse.julialang.org/t/why-dont-any-constraints-check-that-the-parameter-is-a-type/93920 "2023-02-02T18:22:58Z")

</div>

Why is a \<:Any constraint equivalent to there being no constraint? For abstract types: julia\> abstract type A{T \<: Any} end julia\> A{2} # Succeeds even though 2 doesn't subtype Any A{2} For concrete types: julia\> s…

---

## [Why doesn't empty call similar?](https://discourse.julialang.org/t/why-doesnt-empty-call-similar/93871)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [February 1, 2023, 4:29pm UTC](https://discourse.julialang.org/t/why-doesnt-empty-call-similar/93871 "2023-02-01T16:29:47Z")

</div>

The docstring for empty states that empty(v::AbstractVector, \[eltype\]) Create an empty vector similar to v, optionally changing the eltype. The method, though, is defined as empty(a::AbstractVector{T}, ::Type{U}…

---

## [Download with password (digression)](https://discourse.julialang.org/t/download-with-password-digression/93783)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 5\
**Last updated:** [January 30, 2023, 3:51pm UTC](https://discourse.julialang.org/t/download-with-password-digression/93783 "2023-01-30T15:51:04Z")

</div>

I took a look at the docs and (passwords and) .netrc is undocumented (maybe for good reasons… is it clearly supported, I would want its support removed, i.e. curl, is it claimed to be supported, or just an implementation…

---

## [Special case \`lmul!(0, ::AbstractArray)\`?](https://discourse.julialang.org/t/special-case-lmul-0-abstractarray/93557)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [January 26, 2023, 5:00pm UTC](https://discourse.julialang.org/t/special-case-lmul-0-abstractarray/93557 "2023-01-26T17:00:35Z")

</div>

julia\> using LinearAlgebra julia\> function lmul2!(s::Number, X::AbstractArray) iszero(s) && return fill!(X, s) @simd for I in eachindex(X) @inbounds X\[I\] = s\*X\[I\] end …

---

## [Generator as an "Array Initializer?"](https://discourse.julialang.org/t/generator-as-an-array-initializer/93379)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 14\
**Last updated:** [January 26, 2023, 5:43am UTC](https://discourse.julialang.org/t/generator-as-an-array-initializer/93379 "2023-01-26T05:43:04Z")

</div>

(inspired by this discussion) Would it make sense for the Array constructor to accept a generator as an “array initializer?” Array{Float64}(i+j for i=1:m, j=1:n) The downside is that it’s redundant with the :typed\_com…

---

## [Optional multiple dispatch with Glue Packages?](https://discourse.julialang.org/t/optional-multiple-dispatch-with-glue-packages/93480)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 8\
**Last updated:** [January 25, 2023, 5:44pm UTC](https://discourse.julialang.org/t/optional-multiple-dispatch-with-glue-packages/93480 "2023-01-25T17:44:54Z")

</div>

Now that built in glue packages are on their way, I wonder if it is worthwhile to consider a new design pattern of optional multiple dispatch. Typically in Julia we tend to take advantage of multiple dispatch rather tha…

---

## [Providing custom REPL PathCompletions](https://discourse.julialang.org/t/providing-custom-repl-pathcompletions/93515)

<div class="topic-metadata">

**Author:** [@JonasIsensee](https://discourse.julialang.org/u/JonasIsensee)\
**Replies:** 0\
**Last updated:** [January 25, 2023, 3:46pm UTC](https://discourse.julialang.org/t/providing-custom-repl-pathcompletions/93515 "2023-01-25T15:46:15Z")

</div>

Hierarchical dataformats such as HDF5.jl and JLD2.jl use path-like strings to refer to datasets, e.g. julia\> using JLD2 julia\> f = jldopen("20200918\_02\_rodcell\_bigdomain000012.h5") ┌ Warning: This file was not written …

---

## [How exactly are Julia Arrays Implemented?](https://discourse.julialang.org/t/how-exactly-are-julia-arrays-implemented/92564)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 9\
**Last updated:** [January 25, 2023, 3:00am UTC](https://discourse.julialang.org/t/how-exactly-are-julia-arrays-implemented/92564 "2023-01-25T03:00:57Z")

</div>

I’m curious how exactly Julia arrays are implemented. julia\> t = Array{Float64, 2} Matrix{Float64} (alias for Array{Float64, 2}) julia\> isabstracttype(t) false julia\> isprimitivetype(t) false julia\> isstructtype(t) t…

---

## [What is happening in this method definition "(generic function with 0 methods)"?](https://discourse.julialang.org/t/what-is-happening-in-this-method-definition-generic-function-with-0-methods/93363)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [January 23, 2023, 6:59pm UTC](https://discourse.julialang.org/t/what-is-happening-in-this-method-definition-generic-function-with-0-methods/93363 "2023-01-23T18:59:47Z")

</div>

julia\> struct S{T} end julia\> T(::S{T}) where {T \<: Any} = one(T) T (generic function with 0 methods) It seems Julia is confused by the function name being the same as a type parameter. I guess Julia should throw an er…

---

## [Why no single argument \`filter(f::function)\`?](https://discourse.julialang.org/t/why-no-single-argument-filter-f-function/92719)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 8\
**Last updated:** [January 21, 2023, 8:26am UTC](https://discourse.julialang.org/t/why-no-single-argument-filter-f-function/92719 "2023-01-21T08:26:27Z")

</div>

Is there a good reason that there is no single-argument version of filter that returns a filter-function? I.e. why is the following (or something similar) not in Base filter(f::Function) = Base.Fix1(filter, f) ? This …

---

## [Why does stateful iterators restrict length to \`Signed\`?](https://discourse.julialang.org/t/why-does-stateful-iterators-restrict-length-to-signed/93263)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 2:56pm UTC](https://discourse.julialang.org/t/why-does-stateful-iterators-restrict-length-to-signed/93263 "2023-01-20T14:56:53Z")

</div>

Iterators.Stateful has the definition mutable struct Stateful{T, VS, N\<:Integer} itr::T # A bit awkward right now, but adapted to the new iteration protocol nextvalstate::Union{VS, Nothing} # Number of …

---

## [Fixing the Piping/Chaining Issue](https://discourse.julialang.org/t/fixing-the-piping-chaining-issue/89654)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 212\
**Last updated:** [January 16, 2023, 5:45am UTC](https://discourse.julialang.org/t/fixing-the-piping-chaining-issue/89654 "2023-01-16T05:45:00Z")

</div>

Objective To satisfy Julia’s piping/chaining/currying/partial application problem with an elegant and functional approach worthy and idiomatic of Base Julia. If you want, skip the background reading material straight do…

---

## [Having human-readable and parseable display styles](https://discourse.julialang.org/t/having-human-readable-and-parseable-display-styles/92946)

<div class="topic-metadata">

**Author:** [@Jollywatt](https://discourse.julialang.org/u/Jollywatt)\
**Replies:** 5\
**Last updated:** [January 15, 2023, 5:03pm UTC](https://discourse.julialang.org/t/having-human-readable-and-parseable-display-styles/92946 "2023-01-15T17:03:43Z")

</div>

What’s the best way to have both human-readable and parseable display styles for your own type, when there are both multiline and inline versions of the human-readable style? For example, suppose I have a vector-like ty…

---

## [Docs workspace from Project.toml targets and extras?](https://discourse.julialang.org/t/docs-workspace-from-project-toml-targets-and-extras/92732)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 2\
**Last updated:** [January 11, 2023, 1:32am UTC](https://discourse.julialang.org/t/docs-workspace-from-project-toml-targets-and-extras/92732 "2023-01-11T01:32:34Z")

</div>

I feel that I shouldn’t need to maintain a separate environment (Project and Manifest files) for my documentation build, but rather should be able to do it using the target and extras entries in the root Project.toml. I…

---

## [Why \`inv(Complex(0.0, 0.0))\` returns \`Complex(NaN, NaN)\`?](https://discourse.julialang.org/t/why-inv-complex-0-0-0-0-returns-complex-nan-nan/92694)

<div class="topic-metadata">

**Author:** [@hyrodium](https://discourse.julialang.org/u/hyrodium)\
**Replies:** 12\
**Last updated:** [January 10, 2023, 4:15pm UTC](https://discourse.julialang.org/t/why-inv-complex-0-0-0-0-returns-complex-nan-nan/92694 "2023-01-10T16:15:39Z")

</div>

In Julia, inv(Complex(0.0, 0.0)) is evaluated as julia\> c = inv(Complex(0.0, 0.0)) NaN + NaN\*im julia\> isnan(c) true julia\> isinf(c) false julia\> versioninfo() Julia Version 1.8.4 Commit 00177ebc4fc (2022-12-23 21:32…

---

## [An idea for using ccall less in BigFloat operations](https://discourse.julialang.org/t/an-idea-for-using-ccall-less-in-bigfloat-operations/92755)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 0\
**Last updated:** [January 10, 2023, 1:15pm UTC](https://discourse.julialang.org/t/an-idea-for-using-ccall-less-in-bigfloat-operations/92755 "2023-01-10T13:15:05Z")

</div>

I got an idea for a way to slightly decrease the ccall-ing of libmpfr within the Base.MPFR module, which implements BigFloat. Julia defines the BigFloat type as a mutable struct with a number of fields, and it seems lik…

---

## [|n\> as notation for function piping n times?](https://discourse.julialang.org/t/n-as-notation-for-function-piping-n-times/92712)

<div class="topic-metadata">

**Author:** [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Replies:** 5\
**Last updated:** [January 10, 2023, 11:02am UTC](https://discourse.julialang.org/t/n-as-notation-for-function-piping-n-times/92712 "2023-01-10T11:02:43Z")

</div>

Suppose you wanted to repeatedly compose a certain function via piping. For sake of argument, say we want to do 3 |\> sqrt |\> sqrt |\> sqrt |\> sqrt One can do this for an arbitrary number of times n (where n = 4 above) u…

---

## [Why does each BigFloat allocate a big String in addition to the MPFR big float object?](https://discourse.julialang.org/t/why-does-each-bigfloat-allocate-a-big-string-in-addition-to-the-mpfr-big-float-object/92745)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 7\
**Last updated:** [January 10, 2023, 9:57am UTC](https://discourse.julialang.org/t/why-does-each-bigfloat-allocate-a-big-string-in-addition-to-the-mpfr-big-float-object/92745 "2023-01-10T09:57:25Z")

</div>

I’m doing allocation profiling on some code that uses BigFloats at precision 2048, and I noticed that each time a BigFloat is allocated, half of the allocation seems to go to the MPFR object, and the other half to a Stri…

---

## [Ordinal Indexing as a Language Feature](https://discourse.julialang.org/t/ordinal-indexing-as-a-language-feature/91970)

<div class="topic-metadata">

**Author:** [@ParadaCarleton](https://discourse.julialang.org/u/ParadaCarleton)\
**Replies:** 25\
**Last updated:** [January 9, 2023, 7:45pm UTC](https://discourse.julialang.org/t/ordinal-indexing-as-a-language-feature/91970 "2023-01-09T19:45:15Z")

</div>

So, I just had an interesting idea for a 2.0 redesign that could kill the problems with Dictionaries, array labeling, and OffsetArrays with one stone. Someone recently put out a very nice package which distinguishes betw…

---

## [Tell me about escape analysis and optimizing heap allocations](https://discourse.julialang.org/t/tell-me-about-escape-analysis-and-optimizing-heap-allocations/92658)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 4\
**Last updated:** [January 9, 2023, 4:05am UTC](https://discourse.julialang.org/t/tell-me-about-escape-analysis-and-optimizing-heap-allocations/92658 "2023-01-09T04:05:18Z")

</div>

Trying to read into the recent work on escape analysis a bit more, but I’m having trouble answering a couple basic questions of mine because my knowledge on this is very limited. Hopefully people in the know can provide …

---

## [General partial application in Base?](https://discourse.julialang.org/t/general-partial-application-in-base/28176)

<div class="topic-metadata">

**Author:** [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Replies:** 5\
**Last updated:** [December 25, 2022, 12:14am UTC](https://discourse.julialang.org/t/general-partial-application-in-base/28176 "2022-12-25T00:14:30Z")

</div>

We already have Base.Fix1 and Base.Fix2 for partial function application. It seems that it would be nice and probably often useful to define a similar facility for the general case, available upon request. Is this someth…

---

## [Tackling the AbstractArray fallback trap - wrapped sparse matrices](https://discourse.julialang.org/t/tackling-the-abstractarray-fallback-trap-wrapped-sparse-matrices/18592)

<div class="topic-metadata">

**Author:** [@klacru](https://discourse.julialang.org/u/klacru)\
**Replies:** 5\
**Last updated:** [January 5, 2023, 6:01pm UTC](https://discourse.julialang.org/t/tackling-the-abstractarray-fallback-trap-wrapped-sparse-matrices/18592 "2023-01-05T18:01:43Z")

</div>

When handling wrapped sparse matrices, for example Symmetric(sparse(...)), it easily happens, the performance is not as expected, because you get caught in the “abstract array fallback” trap: while you are expecting to u…

---

## [Why can't iteration figure out that all elements are identical in this case, and short-circuit the evaluation?](https://discourse.julialang.org/t/why-cant-iteration-figure-out-that-all-elements-are-identical-in-this-case-and-short-circuit-the-evaluation/92454)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 6\
**Last updated:** [January 3, 2023, 6:06pm UTC](https://discourse.julialang.org/t/why-cant-iteration-figure-out-that-all-elements-are-identical-in-this-case-and-short-circuit-the-evaluation/92454 "2023-01-03T18:06:15Z")

</div>

julia\> struct ConstVector \<: AbstractVector{Int} x :: Int len :: Int end julia\> Base.size(c::ConstVector) = (c.len,) julia\> @inline function Base.getindex(c::ConstVector, i::Int) …

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

[Next page](https://discourse.julialang.org/c/dev/5.md?page=19)
