# Internals & Design

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

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

**Page:** 22

---

## [Define map, filter, ... also as functionals](https://discourse.julialang.org/t/define-map-filter-also-as-functionals/87401)

<div class="topic-metadata">

**Author:** [@ludwig-austermann](https://discourse.julialang.org/u/ludwig-austermann)\
**Replies:** 10\
**Last updated:** [September 19, 2022, 12:16am UTC](https://discourse.julialang.org/t/define-map-filter-also-as-functionals/87401 "2022-09-19T00:16:27Z")

</div>

Hey all, I like the pipelining syntax, but I often encounter the problem that one has to write code like this: rand(10) |\> x -\> filter(\<=(0.5), x) I see that map, filter, accumulate, findfirst etc. all take a minimum …

---

## [Feature request: generalization of findmax/findmin to n values](https://discourse.julialang.org/t/feature-request-generalization-of-findmax-findmin-to-n-values/10286)

<div class="topic-metadata">

**Author:** [@davidbp](https://discourse.julialang.org/u/davidbp)\
**Replies:** 5\
**Last updated:** [September 17, 2022, 1:26am UTC](https://discourse.julialang.org/t/feature-request-generalization-of-findmax-findmin-to-n-values/10286 "2022-09-17T01:26:36Z")

</div>

Given an array X I would like to find the n maximum (or minimum) values of the array and the positions where they are located. In matlab there is the following function that just does this We have findmax that alread…

---

## [Function select only compatible args](https://discourse.julialang.org/t/function-select-only-compatible-args/87207)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 7\
**Last updated:** [September 15, 2022, 12:42pm UTC](https://discourse.julialang.org/t/function-select-only-compatible-args/87207 "2022-09-15T12:42:41Z")

</div>

In my opinion it would be nice if this could be done directly, : f1(a1; a2=1, a3="a") # a4, a5, ... f2(b1; b2='k', b3=2.0) # b4, b5, ... function f(x, y, z, a1, b1; kwargs...) # code f1(a1; kwargs...) # co…

---

## [An easy way to debug the julia code in base/](https://discourse.julialang.org/t/an-easy-way-to-debug-the-julia-code-in-base/44914)

<div class="topic-metadata">

**Author:** [@mitsuruk](https://discourse.julialang.org/u/mitsuruk)\
**Replies:** 10\
**Last updated:** [September 14, 2022, 4:41pm UTC](https://discourse.julialang.org/t/an-easy-way-to-debug-the-julia-code-in-base/44914 "2022-09-14T16:41:45Z")

</div>

Hi, Julian expert people. What is the easiest way to debug a modification to the source code in julia/base if I change the Julia code in base/string/? Specifically, I would like to know how to easily debugging way the …

---

## [Why does the first enum member value default to zero instead of one?](https://discourse.julialang.org/t/why-does-the-first-enum-member-value-default-to-zero-instead-of-one/87219)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [September 13, 2022, 6:13pm UTC](https://discourse.julialang.org/t/why-does-the-first-enum-member-value-default-to-zero-instead-of-one/87219 "2022-09-13T18:13:57Z")

</div>

I’m just curious since Julia uses 1-based indexing. E.g. julia\> @enum Color Red Blue julia\> Red Red::Color = 0 julia\> Blue Blue::Color = 1

---

## [Why doesn't \`vect\` return a union-typed result if the number of elements is small?](https://discourse.julialang.org/t/why-doesnt-vect-return-a-union-typed-result-if-the-number-of-elements-is-small/87155)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [September 13, 2022, 3:28pm UTC](https://discourse.julialang.org/t/why-doesnt-vect-return-a-union-typed-result-if-the-number-of-elements-is-small/87155 "2022-09-13T15:28:41Z")

</div>

Eg.: julia\> struct A end julia\> struct B end julia\> \[A(), B()\] 2-element Vector{Any}: A() B() Would it not be better to return julia\> Union{A,B}\[A(), B()\] 2-element Vector{Union{A, B}}: A() B() instead, as this…

---

## [Relocation target is out of range using JITLink](https://discourse.julialang.org/t/relocation-target-is-out-of-range-using-jitlink/79568)

<div class="topic-metadata">

**Author:** [@alexfanqi](https://discourse.julialang.org/u/alexfanqi)\
**Replies:** 8\
**Last updated:** [September 13, 2022, 1:49pm UTC](https://discourse.julialang.org/t/relocation-target-is-out-of-range-using-jitlink/79568 "2022-09-13T13:49:35Z")

</div>

Hi there, I am testing my luck to port julia to riscv64. I know this is not a supported platform, but I can almost get a sysimage with a bit dirty hacks, except that I get stuck in bootstrapping SuiteSparse/src/cholmod.…

---

## [Finding possible keyword arguments](https://discourse.julialang.org/t/finding-possible-keyword-arguments/40752)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 18\
**Last updated:** [September 13, 2022, 1:23pm UTC](https://discourse.julialang.org/t/finding-possible-keyword-arguments/40752 "2022-09-13T13:23:39Z")

</div>

This is inspired by this post: Is there a way of finding allowed keyword arguments for a function (e.g. bar) that passes its kwargs to another function, such as foo(;a=2,b=3) = a+b bar(;kwargs...) = foo(; kwargs...) s…

---

## [Stdio and Julia run time - implications for embedding Julia?](https://discourse.julialang.org/t/stdio-and-julia-run-time-implications-for-embedding-julia/87050)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 0\
**Last updated:** [September 10, 2022, 7:52pm UTC](https://discourse.julialang.org/t/stdio-and-julia-run-time-implications-for-embedding-julia/87050 "2022-09-10T19:52:13Z")

</div>

I came across Julia’s documentation on printf() and stdio in the Julia runtime. Is there any implication on how to safely mix stdio / iostream with Julia’s IO methods, when embedding Julia in a C/C++ program? This is fol…

---

## [Duplication of standard libraries](https://discourse.julialang.org/t/duplication-of-standard-libraries/87034)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 2\
**Last updated:** [September 10, 2022, 10:11am UTC](https://discourse.julialang.org/t/duplication-of-standard-libraries/87034 "2022-09-10T10:11:08Z")

</div>

It looks like there is a lot of duplication between julia/stdlib and julia/usr/share/julia/stdlib/v1.9. What is the deal with that?

---

## [Request for un'stdlibfication of Statistics](https://discourse.julialang.org/t/request-for-unstdlibfication-of-statistics/82443)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 78\
**Last updated:** [September 10, 2022, 8:15am UTC](https://discourse.julialang.org/t/request-for-unstdlibfication-of-statistics/82443 "2022-09-10T08:15:16Z")

</div>

I feel that many of us doing statistics and data science in Julia agree that the statistics ecosystem could be improved by a lot if we had more freedom to evolve Statistics, StatsBase.jl … to support Tables.jl tables ins…

---

## [Keeping the syntax and the need to memorise syntax simple](https://discourse.julialang.org/t/keeping-the-syntax-and-the-need-to-memorise-syntax-simple/44623)

<div class="topic-metadata">

**Author:** [@Nav](https://discourse.julialang.org/u/Nav)\
**Replies:** 99\
**Last updated:** [September 7, 2022, 10:49am UTC](https://discourse.julialang.org/t/keeping-the-syntax-and-the-need-to-memorise-syntax-simple/44623 "2022-09-07T10:49:53Z")

</div>

Hello. I’m new to Julia and am glad y’all have created such a programming language. However, when learning the syntax, I had the same problem as mentioned here. Programming is a bit less stressful when certain symbols a…

---

## [Compiling AST's](https://discourse.julialang.org/t/compiling-asts/86834)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 1\
**Last updated:** [September 6, 2022, 11:47am UTC](https://discourse.julialang.org/t/compiling-asts/86834 "2022-09-06T11:47:33Z")

</div>

I not infrequently find myself building up AST’s representing a function definition and wishing to compile them. I end up using eval which seems a bit too non-specific for this purpose. I think it would be useful to ha…

---

## [Error calling \`similar(Array{ComplexF32}, Float32)\`](https://discourse.julialang.org/t/error-calling-similar-array-complexf32-float32/86248)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 11\
**Last updated:** [August 30, 2022, 10:18am UTC](https://discourse.julialang.org/t/error-calling-similar-array-complexf32-float32/86248 "2022-08-30T10:18:12Z")

</div>

writing code that is agnostic about the array type but can still change the element\_type, one wants to keep the array type but change the element-type for example to real(eltype(ArrayType)) for efficiency reasons. The f…

---

## [Constructors for \`\<:Function\` types when possible, like in C++](https://discourse.julialang.org/t/constructors-for-function-types-when-possible-like-in-c/86611)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 7\
**Last updated:** [September 1, 2022, 2:13am UTC](https://discourse.julialang.org/t/constructors-for-function-types-when-possible-like-in-c/86611 "2022-09-01T02:13:32Z")

</div>

I was thinking about how C++20 added support for default constructors for stateless (with no captures) lambdas, meaning that nowadays all function object families may be default-constructible in C++. Then I realized tha…

---

## [Known bugs in new Julia releases](https://discourse.julialang.org/t/known-bugs-in-new-julia-releases/85566)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 14\
**Last updated:** [August 30, 2022, 4:26am UTC](https://discourse.julialang.org/t/known-bugs-in-new-julia-releases/85566 "2022-08-30T04:26:21Z")

</div>

Before we release Julia 1.8 I would like to get some clarity about how severe a known bug must be before it needs to be fixed before the next new release of Julia. Two months ago I reported what I thought was a bug t…

---

## [Deepsimilar()?](https://discourse.julialang.org/t/deepsimilar/86466)

<div class="topic-metadata">

**Author:** [@nicolas](https://discourse.julialang.org/u/nicolas)\
**Replies:** 7\
**Last updated:** [August 29, 2022, 10:56pm UTC](https://discourse.julialang.org/t/deepsimilar/86466 "2022-08-29T22:56:59Z")

</div>

I am writing an optimization package where users can input arrays of arrays. For simple arrays, initialization can be done using similar() without copying values. For arrays of arrays however, I haven’t found anything ot…

---

## [Dispatch on symbol name for \`getproperty\`](https://discourse.julialang.org/t/dispatch-on-symbol-name-for-getproperty/86470)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 8\
**Last updated:** [August 29, 2022, 10:42am UTC](https://discourse.julialang.org/t/dispatch-on-symbol-name-for-getproperty/86470 "2022-08-29T10:42:42Z")

</div>

The documentation for getproperty has this example: function Base.getproperty(obj::MyType, sym::Symbol) if sym === :special return obj.x + 1 else # fallback to getfield return getfield(obj, sym) …

---

## [Feasibility of nested forward diff with sparse partials](https://discourse.julialang.org/t/feasibility-of-nested-forward-diff-with-sparse-partials/86304)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 6\
**Last updated:** [August 25, 2022, 11:24am UTC](https://discourse.julialang.org/t/feasibility-of-nested-forward-diff-with-sparse-partials/86304 "2022-08-25T11:24:15Z")

</div>

Hi, I will first describe a use-case I have, the issues I have with existing tools, propose a solution to the problem, and finally ask my questions - to people with a deep knowledge of Julia - whether my proposed soluti…

---

## [About @assume\_effects](https://discourse.julialang.org/t/about-assume-effects/84668)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 10\
**Last updated:** [August 24, 2022, 6:56pm UTC](https://discourse.julialang.org/t/about-assume-effects/84668 "2022-08-24T18:56:22Z")

</div>

On first reading base/expr.jl (lines 382+ in latest) which documents the effects that Base.@assume\_effects currently recognizes, I understood this: :nothrow is safe for functions that do not throw, nor call nontrivial s…

---

## [Suggestion: introduce something like a @inferable or @typestable macro to the language](https://discourse.julialang.org/t/suggestion-introduce-something-like-a-inferable-or-typestable-macro-to-the-language/86042)

<div class="topic-metadata">

**Author:** [@zp3](https://discourse.julialang.org/u/zp3)\
**Replies:** 30\
**Last updated:** [August 21, 2022, 1:14am UTC](https://discourse.julialang.org/t/suggestion-introduce-something-like-a-inferable-or-typestable-macro-to-the-language/86042 "2022-08-21T01:14:16Z")

</div>

Hi, I’m quite new to Julia and so far I can say that I fairly like the language. Especially, the generic programming ability in combination with multiple-dispatch is a great idea which I explicitly love. :yum: That sai…

---

## [Is the linux armv7l binary deprecated?](https://discourse.julialang.org/t/is-the-linux-armv7l-binary-deprecated/85924)

<div class="topic-metadata">

**Author:** [@aptalca](https://discourse.julialang.org/u/aptalca)\
**Replies:** 2\
**Last updated:** [August 18, 2022, 2:07pm UTC](https://discourse.julialang.org/t/is-the-linux-armv7l-binary-deprecated/85924 "2022-08-18T14:07:43Z")

</div>

Hi, I maintain a julia mod for linuxserver.io’s code-server and openvscode-server docker images. I am pulling the x86\_64, armv7l and aarch64 binaries from the website’s downloads section: Download Julia I noticed that …

---

## [How to define \`promote\_rule\` without including \`Union{}\` as an argument?](https://discourse.julialang.org/t/how-to-define-promote-rule-without-including-union-as-an-argument/85609)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [August 11, 2022, 8:54am UTC](https://discourse.julialang.org/t/how-to-define-promote-rule-without-including-union-as-an-argument/85609 "2022-08-11T08:54:28Z")

</div>

E.g., while using Polynomials.jl, julia\> @which promote\_rule(Polynomial{Int}, Union{}) promote\_rule(::Type{\<:AbstractPolynomial{T}}, ::Type{\<:AbstractPolynomial{S}}) where {T, S} @ Polynomials ~/Dropbox/JuliaPackag…

---

## [How is \`x::T\` lowered? (the actual post)](https://discourse.julialang.org/t/how-is-x-t-lowered-the-actual-post/85590)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 4\
**Last updated:** [August 10, 2022, 11:52pm UTC](https://discourse.julialang.org/t/how-is-x-t-lowered-the-actual-post/85590 "2022-08-10T23:52:28Z")

</div>

I’d like to understand what the compiler does with code like function f(x) local y :: typeof(x) y = x end The docstring for typeassert says “The syntax x::type calls this function.”. But this isn’t just a simpl…

---

## [Should \`convert\` include a type-assertion to ensure that the conversion succeeds?](https://discourse.julialang.org/t/should-convert-include-a-type-assertion-to-ensure-that-the-conversion-succeeds/85577)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [August 10, 2022, 9:41am UTC](https://discourse.julialang.org/t/should-convert-include-a-type-assertion-to-ensure-that-the-conversion-succeeds/85577 "2022-08-10T09:41:02Z")

</div>

For example, in badly inferred code, one may obtain julia\> @code\_warntype (x -\> convert(Int, x\[1\]))(Any\[1\]) MethodInstance for (::var"#3#4")(::Vector{Any}) from (::var"#3#4")(x) @ Main REPL\[5\]:1 Arguments #self#::…

---

## [Document / export \`ht\_keyindex()\` from dict.jl?](https://discourse.julialang.org/t/document-export-ht-keyindex-from-dict-jl/83738)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 5\
**Last updated:** [August 8, 2022, 12:35pm UTC](https://discourse.julialang.org/t/document-export-ht-keyindex-from-dict-jl/83738 "2022-08-08T12:35:13Z")

</div>

I’d like to avoid repeated lookup of the memory address of some key in a dictionary. Consider the following code: function delete\_if\_even!(d::Dict, k) if haskey(d, k) && iseven(d\[k\]) delete!(d, k) else …

---

## [The default alignment of markdown table should be left-aligned?](https://discourse.julialang.org/t/the-default-alignment-of-markdown-table-should-be-left-aligned/85344)

<div class="topic-metadata">

**Author:** [@hyrodium](https://discourse.julialang.org/u/hyrodium)\
**Replies:** 0\
**Last updated:** [August 5, 2022, 1:03pm UTC](https://discourse.julialang.org/t/the-default-alignment-of-markdown-table-should-be-left-aligned/85344 "2022-08-05T13:03:40Z")

</div>

Julia’s default tables are right-aligned (See documentation), but many other markdown parsers default to left-aligned (e.g. GitHub markdown). I have made some PRs to some docs (PlotDocs.jl, Images.jl) because left-align…

---

## [AbstractVector vs AbstractRange: length vs size -- which is fundamental?](https://discourse.julialang.org/t/abstractvector-vs-abstractrange-length-vs-size-which-is-fundamental/64689)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [July 28, 2022, 9:01pm UTC](https://discourse.julialang.org/t/abstractvector-vs-abstractrange-length-vs-size-which-is-fundamental/64689 "2022-07-28T21:01:17Z")

</div>

It appears that julia master has changed a behavior from previous versions, and now size for an AbstractRange is defined as (length(r),) instead of the previous behavior where length was defined as prod(size(r)). This ma…

---

## [Should Julia be a systems language?](https://discourse.julialang.org/t/should-julia-be-a-systems-language/84861)

<div class="topic-metadata">

**Author:** [@kodintent](https://discourse.julialang.org/u/kodintent)\
**Replies:** 9\
**Last updated:** [July 28, 2022, 1:05am UTC](https://discourse.julialang.org/t/should-julia-be-a-systems-language/84861 "2022-07-28T01:05:30Z")

</div>

This is a rather speculative post about Julia being used for building systems from scratch, as an alternative to ‘the C way’. Recently i spent some time learning Rust, as it infers it can be systems programming ‘for all…

---

## [Which of \`::\` and \`where\` should take precedence?](https://discourse.julialang.org/t/which-of-and-where-should-take-precedence/84807)

<div class="topic-metadata">

**Author:** [@shaowei](https://discourse.julialang.org/u/shaowei)\
**Replies:** 4\
**Last updated:** [July 27, 2022, 5:11am UTC](https://discourse.julialang.org/t/which-of-and-where-should-take-precedence/84807 "2022-07-27T05:11:39Z")

</div>

Currently (Julia v1.7), where takes precedence over ::. For example: julia\> :(f(x::T where T \<: Integer)) :(f(x::(T where T \<: Integer))) However, this means that the return type annotation will not play nice with para…

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

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