# Internals & Design

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

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

**Page:** 21

---

## [What is replacement for jl\_typeof in the library?](https://discourse.julialang.org/t/what-is-replacement-for-jl-typeof-in-the-library/89792)

<div class="topic-metadata">

**Author:** [@dmitry-kazakov](https://discourse.julialang.org/u/dmitry-kazakov)\
**Replies:** 1\
**Last updated:** [November 5, 2022, 8:26am UTC](https://discourse.julialang.org/t/what-is-replacement-for-jl-typeof-in-the-library/89792 "2022-11-05T08:26:36Z")

</div>

The libjulia relocatable library has no jl\_typeof anymore. From the sources I see that it was replaced by a preprocessor macro. Is there a substitute usable from language bindings?

---

## [Invalidation Prevention Syntax Needed?](https://discourse.julialang.org/t/invalidation-prevention-syntax-needed/89723)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 8\
**Last updated:** [November 3, 2022, 11:27pm UTC](https://discourse.julialang.org/t/invalidation-prevention-syntax-needed/89723 "2022-11-03T23:27:09Z")

</div>

I am really impressed by recent improvements due to the good fight against invalidations. I’m just wondering if the ubiquity of invalidations doesn’t indicate a missing syntax feature. I know Julia is not at that stage o…

---

## [Non-allocating distance function](https://discourse.julialang.org/t/non-allocating-distance-function/89651)

<div class="topic-metadata">

**Author:** [@ynue](https://discourse.julialang.org/u/ynue)\
**Replies:** 6\
**Last updated:** [November 3, 2022, 4:33am UTC](https://discourse.julialang.org/t/non-allocating-distance-function/89651 "2022-11-03T04:33:05Z")

</div>

I have recently realised that isapprox(a, b) is for the most part equivalent to norm(a - b) \< tol. In particular when a and b are vectors, this implementation allocates the vector of the difference. julia\> a, b = rand(1…

---

## [Inconsistency in \`sum\` of an empty generator](https://discourse.julialang.org/t/inconsistency-in-sum-of-an-empty-generator/89638)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 5\
**Last updated:** [November 2, 2022, 3:46pm UTC](https://discourse.julialang.org/t/inconsistency-in-sum-of-an-empty-generator/89638 "2022-11-02T15:46:57Z")

</div>

On Julia 1.3, the following two empty generators both throw an error when you apply sum to them: julia\> g1 = (1 for i in Int\[\]); julia\> g2 = (x for x in \[-1\] if x \> 0); julia\> eltype(g1) Any julia\> eltype(g2) Any ju…

---

## [Adding Hwloc as a julia dependency](https://discourse.julialang.org/t/adding-hwloc-as-a-julia-dependency/89664)

<div class="topic-metadata">

**Author:** [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Replies:** 3\
**Last updated:** [November 2, 2022, 6:34pm UTC](https://discourse.julialang.org/t/adding-hwloc-as-a-julia-dependency/89664 "2022-11-02T18:34:18Z")

</div>

During the Multithreading BoF @kpamnany and I were discussing adding Hwloc as a dependency of julia itself. Some reasons for adding it to julia would be to simplify the cpu detection code we have. Currently there is a l…

---

## [\`help?\> X\` should suggest \`Base.X\` if \`X\` is an un-exported member of \`Base\`](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539)

<div class="topic-metadata">

**Author:** [@bert](https://discourse.julialang.org/u/bert)\
**Replies:** 8\
**Last updated:** [November 2, 2022, 4:59pm UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539 "2022-11-02T16:59:16Z")

</div>

I think it would be helpful if when searching help?\> X for an object X that is defined in, but not exported from, Base, if the help?\> X menu offered to show you the documentation of Base.X rather than just say Couldn't f…

---

## [Reduce compilation time by avoiding specialization](https://discourse.julialang.org/t/reduce-compilation-time-by-avoiding-specialization/89493)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 4\
**Last updated:** [October 30, 2022, 12:36pm UTC](https://discourse.julialang.org/t/reduce-compilation-time-by-avoiding-specialization/89493 "2022-10-30T12:36:35Z")

</div>

I’m trying to speed up function tracing in Umlaut.jl. According to the profiler, about 30% of time is spent in a generic function mkcall(), which records the call, does some argument transformation and then simply invoke…

---

## [Are there any plans to support BLIS in Julia?](https://discourse.julialang.org/t/are-there-any-plans-to-support-blis-in-julia/19620)

<div class="topic-metadata">

**Author:** [@cpsarras](https://discourse.julialang.org/u/cpsarras)\
**Replies:** 20\
**Last updated:** [October 28, 2022, 12:21pm UTC](https://discourse.julialang.org/t/are-there-any-plans-to-support-blis-in-julia/19620 "2022-10-28T12:21:40Z")

</div>

Given the flexibility of the BLIS API and the ability to fuse kernels, I was just wondering if there are any plans of incorporating this functionality in Julia.

---

## [Should the eachindex function be part of the Indexing interface?](https://discourse.julialang.org/t/should-the-eachindex-function-be-part-of-the-indexing-interface/89296)

<div class="topic-metadata">

**Author:** [@eliascarv](https://discourse.julialang.org/u/eliascarv)\
**Replies:** 3\
**Last updated:** [October 27, 2022, 4:08am UTC](https://discourse.julialang.org/t/should-the-eachindex-function-be-part-of-the-indexing-interface/89296 "2022-10-27T04:08:47Z")

</div>

Currently, the Indexing interface is composed of 4 functions: However, among these functions, there is not one that returns the valid indexes of the indexable object. In its documentation, it is shown that the eachi…

---

## [Will any Julia 1.x contain substantive breaking changes?](https://discourse.julialang.org/t/will-any-julia-1-x-contain-substantive-breaking-changes/89138)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 14\
**Last updated:** [October 26, 2022, 2:26pm UTC](https://discourse.julialang.org/t/will-any-julia-1-x-contain-substantive-breaking-changes/89138 "2022-10-26T14:26:42Z")

</div>

Continuing the discussion from PSA: Julia is not at that stage of development anymore: I was under the impression that semantic versioning requires that version to be called Julia 2.0. I would be sad if we introduced a…

---

## [Is \`Base.@constprop\` strictly for internal usage?](https://discourse.julialang.org/t/is-base-constprop-strictly-for-internal-usage/89273)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 5\
**Last updated:** [October 26, 2022, 1:43pm UTC](https://discourse.julialang.org/t/is-base-constprop-strictly-for-internal-usage/89273 "2022-10-26T13:43:34Z")

</div>

Is it likely to become a part of the public API in the future? Or is this strictly for internal use, and package developers are discouraged from using it? This often helps with type inference, so it would be great to ha…

---

## [Minimal self-containing example of code transformation using generated functions?](https://discourse.julialang.org/t/minimal-self-containing-example-of-code-transformation-using-generated-functions/88535)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 3\
**Last updated:** [October 25, 2022, 4:39pm UTC](https://discourse.julialang.org/t/minimal-self-containing-example-of-code-transformation-using-generated-functions/88535 "2022-10-25T16:39:12Z")

</div>

Cassette, IRTools, Diffractor and others use generated functions to transform a method’s CodeInfo / IRCode. Although I used these tools dozen times, I never managed to understand or reproduce it. Is there a minimal self-…

---

## [Abstract and System-Native Types of Integers and Floats: Int, Integer, Float, AbstractFloat](https://discourse.julialang.org/t/abstract-and-system-native-types-of-integers-and-floats-int-integer-float-abstractfloat/88985)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 7\
**Last updated:** [October 22, 2022, 8:00pm UTC](https://discourse.julialang.org/t/abstract-and-system-native-types-of-integers-and-floats-int-integer-float-abstractfloat/88985 "2022-10-22T20:00:54Z")

</div>

Two questions: Why is the abstract type for an integer called Integer, meanwhile the abstract type for a float is AbstractFloat? This seems like an inconsistent naming pattern: either changing Integer to AbstractInt, …

---

## [The default iteration interface can cause memory leak?](https://discourse.julialang.org/t/the-default-iteration-interface-can-cause-memory-leak/88986)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 5\
**Last updated:** [October 20, 2022, 10:55pm UTC](https://discourse.julialang.org/t/the-default-iteration-interface-can-cause-memory-leak/88986 "2022-10-20T22:55:39Z")

</div>

I just read about the post “Iterate on it” which says the current implementation of iterate could cause a memory leak since the xs must remain alive over the entire loop and that is uneconomic for linked lists: next = i…

---

## [Indexing a number](https://discourse.julialang.org/t/indexing-a-number/88735)

<div class="topic-metadata">

**Author:** [@Woodmouth](https://discourse.julialang.org/u/Woodmouth)\
**Replies:** 13\
**Last updated:** [October 14, 2022, 9:08pm UTC](https://discourse.julialang.org/t/indexing-a-number/88735 "2022-10-14T21:08:27Z")

</div>

If a number is generally treated as a list, \> 1\[1\] 1 \> 1\[2\] BoundsError \>length(1) 1 and so on, how come 1\[:\] gives an error? I would have expected the result to be the same as \[1\]\[:\]. I think this should be included…

---

## [Destructuring syntax does not respect const annotation](https://discourse.julialang.org/t/destructuring-syntax-does-not-respect-const-annotation/88751)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [October 14, 2022, 8:55pm UTC](https://discourse.julialang.org/t/destructuring-syntax-does-not-respect-const-annotation/88751 "2022-10-14T20:55:32Z")

</div>

The const keyword seems to have no effect when used with the destructuring syntax in Julia 1.7+. julia\> t = (;a = 1, b = 2); julia\> const (;a, b) = t (a = 1, b = 2) julia\> a = 3 # re-definition produces no error or wa…

---

## [Any at UnitRange seems unoptimal](https://discourse.julialang.org/t/any-at-unitrange-seems-unoptimal/88650)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 20\
**Last updated:** [October 13, 2022, 4:17pm UTC](https://discourse.julialang.org/t/any-at-unitrange-seems-unoptimal/88650 "2022-10-13T16:17:01Z")

</div>

Hey Julianners! One of the most used struct UnitRange. I feel something is odd here. Why we have Any\[Core.Const(1), Int64\]? This sounds pretty unoptimal. using InteractiveUtils unitrange\_any(N) = begin c=1:N end uni…

---

## [Documentation: how should names be qualified?](https://discourse.julialang.org/t/documentation-how-should-names-be-qualified/88529)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 3\
**Last updated:** [October 11, 2022, 1:47pm UTC](https://discourse.julialang.org/t/documentation-how-should-names-be-qualified/88529 "2022-10-11T13:47:59Z")

</div>

There seem to be different styles in the documentation regarding qualified names. For example, the docstring for Threads.foreach describes the functions as Threads.foreach(f, channel::Channel; schedule::…

---

## [Documentation: how to add cross-references to functions in other modules?](https://discourse.julialang.org/t/documentation-how-to-add-cross-references-to-functions-in-other-modules/88504)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 1\
**Last updated:** [October 11, 2022, 1:14pm UTC](https://discourse.julialang.org/t/documentation-how-to-add-cross-references-to-functions-in-other-modules/88504 "2022-10-11T13:14:29Z")

</div>

I’m trying to add cross-references to some Julia docstrings, but I’m running into problems. Take for example the docstring for Base.@sync in base/task.jl (shortened): """ @sync Wait until all lexically-enclosed use…

---

## [Shorthand syntax for defining functors](https://discourse.julialang.org/t/shorthand-syntax-for-defining-functors/88380)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 17\
**Last updated:** [October 9, 2022, 4:11am UTC](https://discourse.julialang.org/t/shorthand-syntax-for-defining-functors/88380 "2022-10-09T04:11:21Z")

</div>

Currently, to define a function with a custom type in julia, we use functors: julia\> struct MyType \<: Function end julia\> (::MyType)() = println("Hello world!") julia\> (::MyType)(name) = println("Hello $(name)!") jul…

---

## [Should inv(::Rational) make copies of the numerator and denominator?](https://discourse.julialang.org/t/should-inv-rational-make-copies-of-the-numerator-and-denominator/88314)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 3\
**Last updated:** [October 6, 2022, 11:30am UTC](https://discourse.julialang.org/t/should-inv-rational-make-copies-of-the-numerator-and-denominator/88314 "2022-10-06T11:30:02Z")

</div>

Usually operations on Rational numbers don’t return references to their arguments: julia\> d = Rational{BigInt}(2) 2//1 julia\> d.num === (1\*d).num false julia\> d.num === (0+d).num false I assumed that this holds in ge…

---

## [NamedTuple constructor syntax](https://discourse.julialang.org/t/namedtuple-constructor-syntax/88220)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 2\
**Last updated:** [October 4, 2022, 4:27pm UTC](https://discourse.julialang.org/t/namedtuple-constructor-syntax/88220 "2022-10-04T16:27:58Z")

</div>

If I define a NamedTuple type like this MyTupleType = NamedTuple{(:a, :b), Tuple{Float64, String}} # or equivalently MyTupleType = @NamedTuple{a::Float64, b::String} I can use this to construct new named tuples with m…

---

## [By= argument for maximum, minimum, findmax, findmin](https://discourse.julialang.org/t/by-argument-for-maximum-minimum-findmax-findmin/88135)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [October 3, 2022, 12:01am UTC](https://discourse.julialang.org/t/by-argument-for-maximum-minimum-findmax-findmin/88135 "2022-10-03T00:01:18Z")

</div>

What do you think about having a by= argument for maximum, minimum, findmax, findmin? The difference from the f argument is that the return value of the f form is in the codomain of f while for by it would be in the doma…

---

## [Make julia without repl precompile](https://discourse.julialang.org/t/make-julia-without-repl-precompile/88066)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 2:53am UTC](https://discourse.julialang.org/t/make-julia-without-repl-precompile/88066 "2022-10-01T02:53:46Z")

</div>

Making julia takes a while. Much of this time is spent generating and executing REPL precompile statements. Is there an option to make without precompile for faster development iterations?

---

## [Documentation for how macros handle keyword arguments](https://discourse.julialang.org/t/documentation-for-how-macros-handle-keyword-arguments/88009)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 2:51am UTC](https://discourse.julialang.org/t/documentation-for-how-macros-handle-keyword-arguments/88009 "2022-10-01T02:51:41Z")

</div>

Macros seem to have a pretty weird way of dealing with keyword arguments, especially keyword arguments that are passed with ;. It seems arguments after ; are moved to the front of the macro call, except if the macro is c…

---

## [Why there is no in-place \`map!\` on arrays?](https://discourse.julialang.org/t/why-there-is-no-in-place-map-on-arrays/87956)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 13\
**Last updated:** [September 29, 2022, 7:57pm UTC](https://discourse.julialang.org/t/why-there-is-no-in-place-map-on-arrays/87956 "2022-09-29T19:57:20Z")

</div>

I am wondering why we could not have a in-place map! so that the destination and the source are the same: julia\> a = \[1, 2, 3\]; julia\> map!(-, a) 3-element Vector{Int64}: -1 -2 -3 I am using this pattern a lot and …

---

## [About static compilation and static analysis](https://discourse.julialang.org/t/about-static-compilation-and-static-analysis/87492)

<div class="topic-metadata">

**Author:** [@martin.d.maas](https://discourse.julialang.org/u/martin.d.maas)\
**Replies:** 22\
**Last updated:** [September 28, 2022, 8:14pm UTC](https://discourse.julialang.org/t/about-static-compilation-and-static-analysis/87492 "2022-09-28T20:14:53Z")

</div>

Hi everyone, I just wanted to share some thoughts about the state of Julia 1.X, and what I see as the most important missing features of the language. I intend to make this a “no-rush feature request” for Julia 2.0, rat…

---

## [What do we call the type specific versions of methods?](https://discourse.julialang.org/t/what-do-we-call-the-type-specific-versions-of-methods/87848)

<div class="topic-metadata">

**Author:** [@Alex\_Ellison](https://discourse.julialang.org/u/Alex_Ellison)\
**Replies:** 2\
**Last updated:** [September 27, 2022, 12:56am UTC](https://discourse.julialang.org/t/what-do-we-call-the-type-specific-versions-of-methods/87848 "2022-09-27T00:56:33Z")

</div>

Hey, semantics question. If I write a method with a parametric type, it can (always?) results in distinct llvm code depending on the argument type(s) going in. There is still one method, but two somethings. Do we have a …

---

## [CategoricalArrays forces OpenSpecFun\_jll recompilation](https://discourse.julialang.org/t/categoricalarrays-forces-openspecfun-jll-recompilation/87759)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 25\
**Last updated:** [September 26, 2022, 4:47pm UTC](https://discourse.julialang.org/t/categoricalarrays-forces-openspecfun-jll-recompilation/87759 "2022-09-26T16:47:58Z")

</div>

@tim.holy here’s a fresh invalidation issue. CategoricalArrays seems to invalidate OpenSpecFun\_jll compilation. \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_…

---

## [Proposal to extend the syntax of list comprehensions with a \`let\` clause](https://discourse.julialang.org/t/proposal-to-extend-the-syntax-of-list-comprehensions-with-a-let-clause/87256)

<div class="topic-metadata">

**Author:** [@HanD](https://discourse.julialang.org/u/HanD)\
**Replies:** 38\
**Last updated:** [September 19, 2022, 6:14pm UTC](https://discourse.julialang.org/t/proposal-to-extend-the-syntax-of-list-comprehensions-with-a-let-clause/87256 "2022-09-19T18:14:26Z")

</div>

I would like to propose a new syntactic sugar to the list comprehension syntax. Take the following, somewhat forced example: \[2abs(x) for x in -20:20 if abs(x) \> 10\] Here, the abs function is invoked twice. Of cours…

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

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