# Internals & Design

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

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

**Page:** 38

---

## [Extend \`mod\` first argument to Gaussian integers?](https://discourse.julialang.org/t/extend-mod-first-argument-to-gaussian-integers/45975)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 4\
**Last updated:** [September 3, 2020, 1:53pm UTC](https://discourse.julialang.org/t/extend-mod-first-argument-to-gaussian-integers/45975 "2020-09-03T13:53:08Z")

</div>

Would folks find it useful if mod(z,m) worked when z is a Gaussian integer? This is easy enough to implement: import Base.mod function mod(z::Complex{T}, m::Integer) where T\<:Integer a,b = reim(z) return mod(a…

---

## [The filter function is non-intuitive](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 25\
**Last updated:** [September 2, 2020, 9:30pm UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674 "2020-09-02T21:30:08Z")

</div>

So this is the current behaviour of the filter function, when given a function that returns a boolean and a collection (taken from the documentation): julia\> a = 1:10 1:10 julia\> filter(isodd, a) 5-element Array{Int64,…

---

## [Where is \`===\` actually defined?](https://discourse.julialang.org/t/where-is-actually-defined/45926)

<div class="topic-metadata">

**Author:** [@cnaak](https://discourse.julialang.org/u/cnaak)\
**Replies:** 5\
**Last updated:** [September 2, 2020, 3:03am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926 "2020-09-02T03:03:51Z")

</div>

In operators.jl one sees that ==(x, y) falls back to ===(x, y), but interestingly, ==='s definition in operators.jl is just… === I’ve never seen Julia syntax like it! :thinking: On the repl, one gets: julia\> methods(…

---

## [Non-sorted SparseMatrixCSC](https://discourse.julialang.org/t/non-sorted-sparsematrixcsc/37133)

<div class="topic-metadata">

**Author:** [@MaximilianJHuber](https://discourse.julialang.org/u/MaximilianJHuber)\
**Replies:** 23\
**Last updated:** [September 1, 2020, 8:04pm UTC](https://discourse.julialang.org/t/non-sorted-sparsematrixcsc/37133 "2020-09-01T20:04:27Z")

</div>

Adding elements to a sparse one after another is slow due to sorting, allocating and copying. Is there another AbstractSparseMatrix that is more friendly to bit-by-bit construction. Or even one that can leverage the fact…

---

## [Input from System Clock](https://discourse.julialang.org/t/input-from-system-clock/45898)

<div class="topic-metadata">

**Author:** [@onButtonUp](https://discourse.julialang.org/u/onButtonUp)\
**Replies:** 4\
**Last updated:** [September 1, 2020, 6:01pm UTC](https://discourse.julialang.org/t/input-from-system-clock/45898 "2020-09-01T18:01:13Z")

</div>

Not sure if I am approaching a project from the wrong direction, but I wonder how the system clock may be used as an input to a Julia program. Say, every 50mS I want a signal (like an interrupt) to start a process. I don…

---

## [Can we have inferable fetch(task)?](https://discourse.julialang.org/t/can-we-have-inferable-fetch-task/45541)

<div class="topic-metadata">

**Author:** [@tkf](https://discourse.julialang.org/u/tkf)\
**Replies:** 5\
**Last updated:** [August 26, 2020, 10:47pm UTC](https://discourse.julialang.org/t/can-we-have-inferable-fetch-task/45541 "2020-08-26T22:47:38Z")

</div>

Continuing the discussion in ANN: Parallel \`for\` loops in FLoops.jl with composable and extensible fold-based API - #18 by c42f, I wonder if we can make fetch(task) inferable using invoke\_in\_world added in Here is a q…

---

## [Question about Julia sparse matrices design decisions](https://discourse.julialang.org/t/question-about-julia-sparse-matrices-design-decisions/45488)

<div class="topic-metadata">

**Author:** [@orenbenkiki](https://discourse.julialang.org/u/orenbenkiki)\
**Replies:** 3\
**Last updated:** [August 25, 2020, 3:02pm UTC](https://discourse.julialang.org/t/question-about-julia-sparse-matrices-design-decisions/45488 "2020-08-25T15:02:42Z")

</div>

I understand that Julia made the decision to support only a single sparse matrix format (in the standard library, anyway) - CSC (compressed sparse column). I tried searching and couldn’t find any discussion of why this …

---

## [Single-method function as a more re-evaluation-friendly \`const\`?](https://discourse.julialang.org/t/single-method-function-as-a-more-re-evaluation-friendly-const/45433)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 10\
**Last updated:** [August 25, 2020, 12:10am UTC](https://discourse.julialang.org/t/single-method-function-as-a-more-re-evaluation-friendly-const/45433 "2020-08-25T00:10:01Z")

</div>

So i was thinking about some of the conversations we had at JuliaCon about Julia’s ability to handle redefining const variables, and i was wondering if we should just always prefer to use a single-method function instead…

---

## [Parser deprecation warning](https://discourse.julialang.org/t/parser-deprecation-warning/45416)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 4\
**Last updated:** [August 23, 2020, 4:05pm UTC](https://discourse.julialang.org/t/parser-deprecation-warning/45416 "2020-08-23T16:05:07Z")

</div>

I’m trying to implement a deprecation warning in the parser. I think I’ve found the function to do it with, parser-depwarn. But it doesn’t appear to emit anything to the REPL. If I replace it with an error call, the erro…

---

## [One-sided ranges in array indexes](https://discourse.julialang.org/t/one-sided-ranges-in-array-indexes/45336)

<div class="topic-metadata">

**Author:** [@derikk](https://discourse.julialang.org/u/derikk)\
**Replies:** 11\
**Last updated:** [August 23, 2020, 11:12am UTC](https://discourse.julialang.org/t/one-sided-ranges-in-array-indexes/45336 "2020-08-23T11:12:40Z")

</div>

Suppose I have an array a = \[1, 2, 3, 4, 5\]. I can index into it at a single value: a\[2\] == 2. I can index it with a range: a\[2:4\] == \[2, 3, 4\]. I can even get the whole array back with a\[:\] == a. Where this pattern br…

---

## [Why ∀ is an invalid character?](https://discourse.julialang.org/t/why-is-an-invalid-character/45371)

<div class="topic-metadata">

**Author:** [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Replies:** 7\
**Last updated:** [August 22, 2020, 11:48pm UTC](https://discourse.julialang.org/t/why-is-an-invalid-character/45371 "2020-08-22T23:48:44Z")

</div>

It seems ∀ (\\forall) is not allowed for some reason: julia\> const ∀ = for ERROR: syntax: invalid character "∀" near column 7 Why is that? Is it just because it’s not on one of the character lists in the parser source c…

---

## [\`unsafe\_pointer\_to\_objref(::Ptr{T})\` is not type stable](https://discourse.julialang.org/t/unsafe-pointer-to-objref-ptr-t-is-not-type-stable/45256)

<div class="topic-metadata">

**Author:** [@mgkuhn](https://discourse.julialang.org/u/mgkuhn)\
**Replies:** 1\
**Last updated:** [August 20, 2020, 12:33pm UTC](https://discourse.julialang.org/t/unsafe-pointer-to-objref-ptr-t-is-not-type-stable/45256 "2020-08-20T12:33:57Z")

</div>

Example code: mutable struct Foo{T} v::Vector{T} n::Int # possibly lots more fields, which I don't want # to have to copy each time with unsafe\_{load,store!} end function demo() a = Foo{Int64}(\[1\], …

---

## [Discovery of possible keywords for kwargs... Maybe we need Base.optional\_keywords?](https://discourse.julialang.org/t/discovery-of-possible-keywords-for-kwargs-maybe-we-need-base-optional-keywords/44989)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 7\
**Last updated:** [August 16, 2020, 8:41pm UTC](https://discourse.julialang.org/t/discovery-of-possible-keywords-for-kwargs-maybe-we-need-base-optional-keywords/44989 "2020-08-16T20:41:25Z")

</div>

I think we need better tooling to discover optional keyword arguments. Maybe this needs to be dealt with in Base, rather than VSCode, Juno, etc. Consider the following scenario: In Makie, we have many plotting function…

---

## [Realistically, how close is Gaius.jl to becoming a full replacement for BLAS in Julia?](https://discourse.julialang.org/t/realistically-how-close-is-gaius-jl-to-becoming-a-full-replacement-for-blas-in-julia/42780)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 13\
**Last updated:** [August 16, 2020, 7:37pm UTC](https://discourse.julialang.org/t/realistically-how-close-is-gaius-jl-to-becoming-a-full-replacement-for-blas-in-julia/42780 "2020-08-16T19:37:06Z")

</div>

https://github.com/MasonProtter/Gaius.jl I the above and is amazed. I always thought that BLAS, MKL etc are so complex and so well optimised that they are pretty much irreplaceable. Even if Gauis is slower for cases, h…

---

## [Why is "macro" different from "function" if everything is an expression?](https://discourse.julialang.org/t/why-is-macro-different-from-function-if-everything-is-an-expression/45043)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 4\
**Last updated:** [August 16, 2020, 2:05pm UTC](https://discourse.julialang.org/t/why-is-macro-different-from-function-if-everything-is-an-expression/45043 "2020-08-16T14:05:00Z")

</div>

I’m learning the basics of macros. Coming from another LISP-inspired language (Wolfram Mathematica), I’m wondering why there is a distinction between macros and functions. Isn’t a macro just a function whose argument is …

---

## [Repl.it Jam: If you knew then what you know now](https://discourse.julialang.org/t/repl-it-jam-if-you-knew-then-what-you-know-now/44905)

<div class="topic-metadata">

**Author:** [@anon67531922](https://discourse.julialang.org/u/anon67531922)\
**Replies:** 10\
**Last updated:** [August 15, 2020, 7:24pm UTC](https://discourse.julialang.org/t/repl-it-jam-if-you-knew-then-what-you-know-now/44905 "2020-08-15T19:24:50Z")

</div>

Hi, Julia development began in 2009 with the first public release in 2012 (according to Wikipedia). A lot has happened in the past 10+ years. Surely, there is some legacy already baked into the code base. I’m kind of cu…

---

## [Why are tuples covariant?](https://discourse.julialang.org/t/why-are-tuples-covariant/45005)

<div class="topic-metadata">

**Author:** [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Replies:** 2\
**Last updated:** [August 15, 2020, 6:17pm UTC](https://discourse.julialang.org/t/why-are-tuples-covariant/45005 "2020-08-15T18:17:14Z")

</div>

The manual section on Parametric Types says that Julia’s type parameters are invariant but the section on Tuple Types says Tuple types are covariant in their parameters I’m just curious about the reason behind…

---

## [How can I run hooks before and after the execution of a command in the REPL?](https://discourse.julialang.org/t/how-can-i-run-hooks-before-and-after-the-execution-of-a-command-in-the-repl/44815)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 11\
**Last updated:** [August 14, 2020, 3:54pm UTC](https://discourse.julialang.org/t/how-can-i-run-hooks-before-and-after-the-execution-of-a-command-in-the-repl/44815 "2020-08-14T15:54:13Z")

</div>

I first opened an issue on VSCode’s Julia extension to make a bell sound after a long-running command. After more thought, I reached the conclusion that having hooks that run arbitrary Julia code before and after command…

---

## [\`'\` or \`transpose\` failing on strings is not beginner-friendly](https://discourse.julialang.org/t/or-transpose-failing-on-strings-is-not-beginner-friendly/44926)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [August 14, 2020, 11:52am UTC](https://discourse.julialang.org/t/or-transpose-failing-on-strings-is-not-beginner-friendly/44926 "2020-08-14T11:52:51Z")

</div>

While I understand that transpose is recursive, the fact that it fails on strings (together with the beautiful ' notation) is a problem for beginners. I would vote for a less pure solution that stops the recursion for A…

---

## [PSA: Julia is not at that stage of development anymore](https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872)

<div class="topic-metadata">

**Author:** [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Replies:** 1\
**Last updated:** [August 13, 2020, 1:53pm UTC](https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872 "2020-08-13T13:53:20Z")

</div>

You heard about this brand new exciting programming language called Julia and have some suggestions for how it should work. Wonderful! We’re happy to have you here and help you learn the language and listen to your ideas…

---

## [Should macros get an \`\_\_istoplevel\_\_\` or \`\_\_scope\_\_\` argument?](https://discourse.julialang.org/t/should-macros-get-an-istoplevel-or-scope-argument/44850)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 5\
**Last updated:** [August 13, 2020, 7:05am UTC](https://discourse.julialang.org/t/should-macros-get-an-istoplevel-or-scope-argument/44850 "2020-08-13T07:05:23Z")

</div>

Because the same code will behave differently in global vs local scope, if one wants to write a macro which can work in both, in theory it needs to know into which scope its being expanded, right? I’m running into this …

---

## [Should scalar calculation in Broadcast be "lazy"?](https://discourse.julialang.org/t/should-scalar-calculation-in-broadcast-be-lazy/44664)

<div class="topic-metadata">

**Author:** [@N5N3](https://discourse.julialang.org/u/N5N3)\
**Replies:** 12\
**Last updated:** [August 10, 2020, 3:22pm UTC](https://discourse.julialang.org/t/should-scalar-calculation-in-broadcast-be-lazy/44664 "2020-08-10T15:22:14Z")

</div>

At present, the broadcast in julia is always lazy, no matter the inputs’ axes. I think, at least for numeric calcution, if both the input(s) and output are scalar, we could perform the calculation immediately, as the st…

---

## [Why does Julia promote full array to sparse array?](https://discourse.julialang.org/t/why-does-julia-promote-full-array-to-sparse-array/44205)

<div class="topic-metadata">

**Author:** [@Paul\_McVay](https://discourse.julialang.org/u/Paul_McVay)\
**Replies:** 8\
**Last updated:** [August 10, 2020, 2:34pm UTC](https://discourse.julialang.org/t/why-does-julia-promote-full-array-to-sparse-array/44205 "2020-08-10T14:34:56Z")

</div>

Why does Julia promote full arrays to sparse arrays? If I try to subtract a sparse array from a full array, why does the full array become a sparse array? This doesn’t make any sense to me. It makes much more sense in my…

---

## [Seems useful to write a macro that prepends the method signature to the docstring?](https://discourse.julialang.org/t/seems-useful-to-write-a-macro-that-prepends-the-method-signature-to-the-docstring/44598)

<div class="topic-metadata">

**Author:** [@bzinberg](https://discourse.julialang.org/u/bzinberg)\
**Replies:** 3\
**Last updated:** [August 9, 2020, 5:58pm UTC](https://discourse.julialang.org/t/seems-useful-to-write-a-macro-that-prepends-the-method-signature-to-the-docstring/44598 "2020-08-09T17:58:20Z")

</div>

I’m imagining writing something like @doc\_with\_sig """ Return a car with the given list of wheels and the given engine. Throws an error if \`engine\` doesn't have enough horsepower. """ function make\_car(wheels::Vector{W…

---

## [Collecting possible improvements in word choice](https://discourse.julialang.org/t/collecting-possible-improvements-in-word-choice/44433)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 3\
**Last updated:** [August 6, 2020, 11:30pm UTC](https://discourse.julialang.org/t/collecting-possible-improvements-in-word-choice/44433 "2020-08-06T23:30:15Z")

</div>

On slack, @quinnj noted that valtype would be more clear as valuetype. From time to time people mention similar suggestions and I thought it reasonable to collect then here.

---

## [Same constructors, less code written](https://discourse.julialang.org/t/same-constructors-less-code-written/44120)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 7\
**Last updated:** [August 3, 2020, 3:03pm UTC](https://discourse.julialang.org/t/same-constructors-less-code-written/44120 "2020-08-03T15:03:48Z")

</div>

Now that Julia constructors are so well supported, we could avoid writing convert functions where there is a promote\_rule and the proper conversion is to apply the promotion selected type constructor. Please see my next…

---

## [A Question on the Type System: Concrete Types, Super-Types and Type Intersections](https://discourse.julialang.org/t/a-question-on-the-type-system-concrete-types-super-types-and-type-intersections/43869)

<div class="topic-metadata">

**Author:** [@barankarakus](https://discourse.julialang.org/u/barankarakus)\
**Replies:** 11\
**Last updated:** [July 29, 2020, 3:47pm UTC](https://discourse.julialang.org/t/a-question-on-the-type-system-concrete-types-super-types-and-type-intersections/43869 "2020-07-29T15:47:01Z")

</div>

Hi, I have a quick question on the type system of Julia. My mental model of a type is simply a set of values. We can say a value v is an instance of a type T if v is in the set T. We can also say a type T is a super-ty…

---

## [Reviewing old issues](https://discourse.julialang.org/t/reviewing-old-issues/43709)

<div class="topic-metadata">

**Author:** [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Replies:** 5\
**Last updated:** [July 26, 2020, 9:49pm UTC](https://discourse.julialang.org/t/reviewing-old-issues/43709 "2020-07-26T21:49:41Z")

</div>

There are almost 3k issues open in Julia’s GitHub repository: https://github.com/JuliaLang/julia/issues Taking a glance at those, it got me wondering. Has there been a sustained effort to review old issues and close th…

---

## [Why @view add a "true &&" before the view call?](https://discourse.julialang.org/t/why-view-add-a-true-before-the-view-call/43670)

<div class="topic-metadata">

**Author:** [@N5N3](https://discourse.julialang.org/u/N5N3)\
**Replies:** 1\
**Last updated:** [July 25, 2020, 3:32pm UTC](https://discourse.julialang.org/t/why-view-add-a-true-before-the-view-call/43670 "2020-07-25T15:32:23Z")

</div>

I’m try to look into the @avx macro offered by LoopVectorization.jl, which replace the Base.materialize(!) with the auther defined function. I want to use the same design to make my own module to support macro like @par…

---

## [Make Pkg.undo work accross sessions](https://discourse.julialang.org/t/make-pkg-undo-work-accross-sessions/43630)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 2\
**Last updated:** [July 25, 2020, 7:53am UTC](https://discourse.julialang.org/t/make-pkg-undo-work-accross-sessions/43630 "2020-07-25T07:53:15Z")

</div>

I use this shell function to easily install Julia packages: jins () { julia --startup-file=no -e 'using Pkg; Pkg.add("'"$1"'"); Pkg.precompile()' } So when something goes wrong, I can’t use Pkg.undo() and get: ERR…

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

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