# Internals & Design

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

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

**Page:** 29

---

## [Why is \`=\` no function](https://discourse.julialang.org/t/why-is-no-function/47304)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 26\
**Last updated:** [October 20, 2020, 8:08pm UTC](https://discourse.julialang.org/t/why-is-no-function/47304 "2020-10-20T20:08:31Z")

</div>

Hey best community :slight\_smile: I was wondering, way = can’t be used like + or \*. I would like to do something like =(:a,3), typeof(=) and assign = =.

---

## [Why does indexed assignment return the assigned value instead of the container?](https://discourse.julialang.org/t/why-does-indexed-assignment-return-the-assigned-value-instead-of-the-container/71399)

<div class="topic-metadata">

**Author:** [@MatthijsBlom](https://discourse.julialang.org/u/MatthijsBlom)\
**Replies:** 1\
**Last updated:** [November 12, 2021, 6:47pm UTC](https://discourse.julialang.org/t/why-does-indexed-assignment-return-the-assigned-value-instead-of-the-container/71399 "2021-11-12T18:47:15Z")

</div>

Witness x = \['a'\] setindex!(x, 'b', 1) # \['b'\] x\[1\] = 'c' # 'c' This behaviour is documented: The syntax a\[i,j,...\] = x is converted by the compiler to (setindex!(a, x, i, j, ...); x). (The documentatio…

---

## [What does the return keyword do in a let/begin block?](https://discourse.julialang.org/t/what-does-the-return-keyword-do-in-a-let-begin-block/66865)

<div class="topic-metadata">

**Author:** [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Replies:** 5\
**Last updated:** [November 15, 2021, 8:18pm UTC](https://discourse.julialang.org/t/what-does-the-return-keyword-do-in-a-let-begin-block/66865 "2021-11-15T20:18:08Z")

</div>

Hi, I couldn’t find in the documentation an explanation to this behavior. let "let block without return" end |\> println # OUTPUT: let block without return let return "let block with return" end |\> println # OUT…

---

## [Are \`:=\`, \`$=\` operators still supported?](https://discourse.julialang.org/t/are-operators-still-supported/68846)

<div class="topic-metadata">

**Author:** [@o314](https://discourse.julialang.org/u/o314)\
**Replies:** 8\
**Last updated:** [November 15, 2021, 2:46am UTC](https://discourse.julialang.org/t/are-operators-still-supported/68846 "2021-11-15T02:46:50Z")

</div>

Are :=, $= operators still in use today ? If yes is there any examples of their usage. I can get a MWE for both of them . := OPERATOR A = rand(0:100,2,5) A\[:,1:2\] = 1:4 # works ok A := 1:10 # will throws a syntax ER…

---

## [Request for comments: a roadmap to faster sort() for primitive types using RadixSort](https://discourse.julialang.org/t/request-for-comments-a-roadmap-to-faster-sort-for-primitive-types-using-radixsort/70269)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 32\
**Last updated:** [November 14, 2021, 6:24pm UTC](https://discourse.julialang.org/t/request-for-comments-a-roadmap-to-faster-sort-for-primitive-types-using-radixsort/70269 "2021-11-14T18:24:12Z")

</div>

I have a fast radix sort. Perhaps 1.2–2x faster than SortingAlgorithms’s radix sort according to my very limited benchmarks. SorthingAlgorithms’ is also quite a bit faster than Base’s current defaults, putting the total …

---

## [Write - accented characters take extra byte](https://discourse.julialang.org/t/write-accented-characters-take-extra-byte/71271)

<div class="topic-metadata">

**Author:** [@yoh-meyers](https://discourse.julialang.org/u/yoh-meyers)\
**Replies:** 6\
**Last updated:** [November 11, 2021, 10:31pm UTC](https://discourse.julialang.org/t/write-accented-characters-take-extra-byte/71271 "2021-11-11T22:31:47Z")

</div>

Hello, When calling write with a string containing accented characters, I realise that 2 bytes are returned. E.g: julia\> write(stdout, "ñ") ñ2 julia\> write(stdout, "n") n1 This is an issue when the output is expecti…

---

## [IRTools and Core.Compiler](https://discourse.julialang.org/t/irtools-and-core-compiler/71311)

<div class="topic-metadata">

**Author:** [@KDr2](https://discourse.julialang.org/u/KDr2)\
**Replies:** 1\
**Last updated:** [November 11, 2021, 4:35pm UTC](https://discourse.julialang.org/t/irtools-and-core-compiler/71311 "2021-11-11T16:35:34Z")

</div>

I noticed IRTools.jl doesn’t work any longer on the latest Julia (1.8.x or the master branch). And from long ago, there exists a module named Core.Compiler, but I failed to find any document about this module. I have a …

---

## [\`unsafe\_wrap\` on memory created by \`:jl\_malloc\`](https://discourse.julialang.org/t/unsafe-wrap-on-memory-created-by-jl-malloc/66826)

<div class="topic-metadata">

**Author:** [@rayegun](https://discourse.julialang.org/u/rayegun)\
**Replies:** 5\
**Last updated:** [November 10, 2021, 1:31pm UTC](https://discourse.julialang.org/t/unsafe-wrap-on-memory-created-by-jl-malloc/66826 "2021-11-10T13:31:34Z")

</div>

I’m probably diving too deep trying to make things fast (again) but I was hoping there was a way to make this work. Sorry to bother, I’ve asked a lot of questions about memory management stuff recently. I have a C libra…

---

## [StatsBase Fit function](https://discourse.julialang.org/t/statsbase-fit-function/71234)

<div class="topic-metadata">

**Author:** [@valperez](https://discourse.julialang.org/u/valperez)\
**Replies:** 1\
**Last updated:** [November 10, 2021, 5:13am UTC](https://discourse.julialang.org/t/statsbase-fit-function/71234 "2021-11-10T05:13:20Z")

</div>

Hi there :slight\_smile: I’m trying to figure out how the fit function in StatsBase was programmed. I’m curious to see what method was used and how the tolerance is managed. I already looked in the documentation Abstract…

---

## [Constant propagation in recursive functions](https://discourse.julialang.org/t/constant-propagation-in-recursive-functions/22192)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 2\
**Last updated:** [November 7, 2021, 8:04pm UTC](https://discourse.julialang.org/t/constant-propagation-in-recursive-functions/22192 "2021-11-07T20:04:30Z")

</div>

While trying to build a simple example illustrating constant propagation, I made the following test (using the recursive variant of Euclid’s algorithm to compute a GCD): julia\> function gcd\_rec(a, b) b == 0 &&…

---

## [Taking \`push!\` and \`pop!\` seriously](https://discourse.julialang.org/t/taking-push-and-pop-seriously/34326)

<div class="topic-metadata">

**Author:** [@kevin.squire](https://discourse.julialang.org/u/kevin.squire)\
**Replies:** 19\
**Last updated:** [November 5, 2021, 6:13pm UTC](https://discourse.julialang.org/t/taking-push-and-pop-seriously/34326 "2021-11-05T18:13:49Z")

</div>

TL;DR: currently, push! and pop! conflate two different meanings (adding/removing elements to unordered/sorted collections vs. adding elements to the end of Vectors, Stacks, Deques, etc). These meanings should be split i…

---

## [Add "version" command to pkg](https://discourse.julialang.org/t/add-version-command-to-pkg/70549)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 15\
**Last updated:** [November 2, 2021, 10:26am UTC](https://discourse.julialang.org/t/add-version-command-to-pkg/70549 "2021-11-02T10:26:59Z")

</div>

The current behaviour is the following: I feel that “version” is a more natural command, and that it should be added to return the same thing as “status”. It should save a lot of people trying “version” first, and the…

---

## [Dispatch on type aliases?](https://discourse.julialang.org/t/dispatch-on-type-aliases/70691)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 7\
**Last updated:** [October 31, 2021, 5:23pm UTC](https://discourse.julialang.org/t/dispatch-on-type-aliases/70691 "2021-10-31T17:23:12Z")

</div>

Can Julia have dispatch based on type aliases? Something rather similar to Scala 3’s opaque type aliases. const MyTypeAlias = Float64 a::MyTypeAlias = 78.0 # The compiler should implicitly convert this from Float64 to M…

---

## [Is this a bug (scalar+ranges) with the parser?](https://discourse.julialang.org/t/is-this-a-bug-scalar-ranges-with-the-parser/70670)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 9\
**Last updated:** [October 31, 2021, 9:06am UTC](https://discourse.julialang.org/t/is-this-a-bug-scalar-ranges-with-the-parser/70670 "2021-10-31T09:06:41Z")

</div>

I want to add one scalar value with all value of a unitRange. Naively, I would do the x = 1:5 .+ 0.5 code, but I realize that actually the parser is doing y=1:(5 .+ 0.5). Below a full example: expected = \[1,2,3,4,5\] .+…

---

## [\[1.7-rc2\] Base.promote\_type inference](https://discourse.julialang.org/t/1-7-rc2-base-promote-type-inference/70563)

<div class="topic-metadata">

**Author:** [@OlivierHnt](https://discourse.julialang.org/u/OlivierHnt)\
**Replies:** 3\
**Last updated:** [October 30, 2021, 6:55am UTC](https://discourse.julialang.org/t/1-7-rc2-base-promote-type-inference/70563 "2021-10-30T06:55:21Z")

</div>

On Julia v1.7.0-rc2, Base.promote\_type seems to struggle with type stability for at least the Bool and Irrational types. To illustrate, this shows up in @code\_warntype π \< true, or: julia\> foo() = Base.promote\_type(Boo…

---

## [Compiling Plots in Termux -\> Error](https://discourse.julialang.org/t/compiling-plots-in-termux-error/70536)

<div class="topic-metadata">

**Author:** [@olav2021](https://discourse.julialang.org/u/olav2021)\
**Replies:** 0\
**Last updated:** [October 28, 2021, 6:56am UTC](https://discourse.julialang.org/t/compiling-plots-in-termux-error/70536 "2021-10-28T06:56:30Z")

</div>

Hello, I am writing Julia on an android/termux device and using Plots gives some kind of compiling error: julia\> using Plots \[ Info: Precompiling Plots \[91a5bcdd-55d7-5caf-9e0b-520d859cae80\] ERROR: LoadError: LoadErr…

---

## [Should we make \`IndexStyle(::Type{\<:AbstractVector})\` returns \`IndexLinear()\` by default?](https://discourse.julialang.org/t/should-we-make-indexstyle-type-abstractvector-returns-indexlinear-by-default/70085)

<div class="topic-metadata">

**Author:** [@N5N3](https://discourse.julialang.org/u/N5N3)\
**Replies:** 4\
**Last updated:** [October 22, 2021, 11:25am UTC](https://discourse.julialang.org/t/should-we-make-indexstyle-type-abstractvector-returns-indexlinear-by-default/70085 "2021-10-22T11:25:14Z")

</div>

Currently, we have eachindex(A::AbstractVector) = axes1(A) But the default IndexStyle of AbstractVector is IndexCartesian() The following example looks a little strange to me julia\> a = view(\[1,2,3\],\[1,2,3\]) 3-elemen…

---

## [Construct \`Union{T, U} where T\<:Integer where U\<:Float64\` from \`Union{TypeVar(:T, Integer), TypeVar(:U, Float64)}\`](https://discourse.julialang.org/t/construct-union-t-u-where-t-integer-where-u-float64-from-union-typevar-t-integer-typevar-u-float64/70230)

<div class="topic-metadata">

**Author:** [@kdheepak](https://discourse.julialang.org/u/kdheepak)\
**Replies:** 3\
**Last updated:** [October 22, 2021, 5:40pm UTC](https://discourse.julialang.org/t/construct-union-t-u-where-t-integer-where-u-float64-from-union-typevar-t-integer-typevar-u-float64/70230 "2021-10-22T17:40:20Z")

</div>

I’m trying to construct a type programmatically but failing to do so. The crux of my problem is that UnionAll(TypeVar(:T, Integer), Union{TypeVar(:T, Integer), TypeVar(:U, Float64)}) doesn’t return a UnionAll type, and …

---

## [What is \`slt\_int\`](https://discourse.julialang.org/t/what-is-slt-int/70157)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 8\
**Last updated:** [October 22, 2021, 12:01am UTC](https://discourse.julialang.org/t/what-is-slt-int/70157 "2021-10-22T00:01:09Z")

</div>

What is Core.Intrinsics.slt\_int? As seen in base/sort.jl, added 2013. Also, how can I find out the answer to this sort of question in general? I tried @edit, ?, web searches, and even git blame (a much less ideal soluti…

---

## [Is there a defined minimal interface for a type to work with SparseArrays?](https://discourse.julialang.org/t/is-there-a-defined-minimal-interface-for-a-type-to-work-with-sparsearrays/69602)

<div class="topic-metadata">

**Author:** [@suavesito](https://discourse.julialang.org/u/suavesito)\
**Replies:** 22\
**Last updated:** [October 21, 2021, 1:05pm UTC](https://discourse.julialang.org/t/is-there-a-defined-minimal-interface-for-a-type-to-work-with-sparsearrays/69602 "2021-10-21T13:05:14Z")

</div>

Hi! I’ve been trying to use Symbolics + SparseArrays, but I get errors because in SparseArrays to check for zeros it is used != 0 and that doesn’t work with Num. I learned about 30573 in which they discuss about this e…

---

## [Help building Julia Pkg.jl repo locally to work on an issue](https://discourse.julialang.org/t/help-building-julia-pkg-jl-repo-locally-to-work-on-an-issue/70021)

<div class="topic-metadata">

**Author:** [@Chandu-4444](https://discourse.julialang.org/u/Chandu-4444)\
**Replies:** 6\
**Last updated:** [October 21, 2021, 12:31pm UTC](https://discourse.julialang.org/t/help-building-julia-pkg-jl-repo-locally-to-work-on-an-issue/70021 "2021-10-21T12:31:01Z")

</div>

I was working on this issue #42687. As a part of this I need to setup this repo locally. But upon following the instruction given in the repo, I followed all the steps. But I’m getting this error upon executing import Pk…

---

## [Documentation of stdlibs?](https://discourse.julialang.org/t/documentation-of-stdlibs/70029)

<div class="topic-metadata">

**Author:** [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Replies:** 7\
**Last updated:** [October 19, 2021, 3:16pm UTC](https://discourse.julialang.org/t/documentation-of-stdlibs/70029 "2021-10-19T15:16:02Z")

</div>

Looking through the sources https://github.com/JuliaLang/julia/tree/v1.7.0-rc1/stdlib and comparing to the corresponding documentation, it’s unclear which modules seem to be stdlibs or not. As an example, Tar is an stdli…

---

## [Discussion about integer overflow](https://discourse.julialang.org/t/discussion-about-integer-overflow/69627)

<div class="topic-metadata">

**Author:** [@viraltux](https://discourse.julialang.org/u/viraltux)\
**Replies:** 188\
**Last updated:** [October 15, 2021, 5:02pm UTC](https://discourse.julialang.org/t/discussion-about-integer-overflow/69627 "2021-10-15T17:02:21Z")

</div>

Yes, it is a limitation but I would not call it big since we could use BigInt if Int64 is not enough and an overflow is something we can catch. I find more worrying this: \> julia\> 1 / 10^20000 \> Inf I’d rather have …

---

## [Is Julia's way of OOP superior to C++/Python? Why Julia doesn't use class-based OOP?](https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058)

<div class="topic-metadata">

**Author:** [@vedasulo](https://discourse.julialang.org/u/vedasulo)\
**Replies:** 146\
**Last updated:** [October 11, 2021, 6:16am UTC](https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058 "2021-10-11T06:16:44Z")

</div>

I am thinking How can it applied in large projects or software development projects, if there is no oop. I heard struct and things. But some answer told It is not oop. What are advantage and disadvantage of using oop i…

---

## [True interactive development](https://discourse.julialang.org/t/true-interactive-development/67318)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 36\
**Last updated:** [October 11, 2021, 6:12am UTC](https://discourse.julialang.org/t/true-interactive-development/67318 "2021-10-11T06:12:25Z")

</div>

I stumbled upon this blog while casually scanning hacker news. So I thought Julia REPL + Revise is top notch until it described “true interactive development” as follows: True interactive development is also about pr…

---

## [Adding two Array{Union{Missing,Float64}} returns Array{Float64}, is this by design?](https://discourse.julialang.org/t/adding-two-array-union-missing-float64-returns-array-float64-is-this-by-design/69472)

<div class="topic-metadata">

**Author:** [@viraltux](https://discourse.julialang.org/u/viraltux)\
**Replies:** 32\
**Last updated:** [October 10, 2021, 8:44pm UTC](https://discourse.julialang.org/t/adding-two-array-union-missing-float64-returns-array-float64-is-this-by-design/69472 "2021-10-10T20:44:49Z")

</div>

y = Array{Union{Missing,Float64}}(undef,100); y\[:\] = rand(100) ϵ = Array{Union{Missing,Float64}}(undef,100); ϵ\[:\] = rand(100) julia\> eltype(y.+ϵ) Float64 I am not sure but I imagine the idea behind doing this is return…

---

## [Allocation due to \`@noinline\` for unsafe\_read and unsafe\_write in io.jl](https://discourse.julialang.org/t/allocation-due-to-noinline-for-unsafe-read-and-unsafe-write-in-io-jl/69421)

<div class="topic-metadata">

**Author:** [@Paul\_Depping](https://discourse.julialang.org/u/Paul_Depping)\
**Replies:** 1\
**Last updated:** [October 8, 2021, 8:27am UTC](https://discourse.julialang.org/t/allocation-due-to-noinline-for-unsafe-read-and-unsafe-write-in-io-jl/69421 "2021-10-08T08:27:29Z")

</div>

I’m currently working with a lot of File IO, and I noticed that whenever i call the function write(s::IO, x::Union{Int16,UInt16,Int32,UInt32,Int64,UInt64,Int128,UInt128,Float16,Float32,Float64}), there is an Allocation. …

---

## [Matrix operations not symmetric](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 4\
**Last updated:** [October 6, 2021, 6:21am UTC](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244 "2021-10-06T06:21:14Z")

</div>

Hi. I am relatively new to Julia. Suppose I have a matrix A and I write v = A\[:, 1\]. Now v is a vector as expected. But u = A\[1, :\] is a vector again (I expected u to be adjoint instead of vector). What would the probl…

---

## [Pkg3 vs. Go's vgo](https://discourse.julialang.org/t/pkg3-vs-gos-vgo/10154)

<div class="topic-metadata">

**Author:** [@waldyrious](https://discourse.julialang.org/u/waldyrious)\
**Replies:** 9\
**Last updated:** [April 17, 2018, 10:06pm UTC](https://discourse.julialang.org/t/pkg3-vs-gos-vgo/10154 "2018-04-17T22:06:07Z")

</div>

The other day I came across the post A Proposal for Package Versioning in Go in Go’s blog, and the following passages in particular (edited for clarity) got me wondering about whether these concerns (and corresponding pr…

---

## [Shouldn't this throw an error?](https://discourse.julialang.org/t/shouldnt-this-throw-an-error/68898)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 2\
**Last updated:** [September 29, 2021, 11:13am UTC](https://discourse.julialang.org/t/shouldnt-this-throw-an-error/68898 "2021-09-29T11:13:34Z")

</div>

I have inadvertently made this mistake: F(x, f::F) where F = f(x) julia\> F(0.5, sin) ERROR: MethodError: no method matching F(::Float64, ::typeof(sin)) Shouldn’t the first line throw and error or are there cases where…

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

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