# Internals & Design

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

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

**Page:** 34

---

## [V0.7 Pkg: Passing arguments to test](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 4\
**Last updated:** [February 25, 2021, 9:33am UTC](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555 "2021-02-25T09:33:54Z")

</div>

Hi, Is there any way to pass arguments to test scripts when called via the Pkg REPL? From command line, I’m able to do $ julia ./test/runtests.jl \<args\> But is it possible to do similar from REPL, like (v0.7) pkg\> t…

---

## [Pass runtime variables to module's \_\_init\_() function](https://discourse.julialang.org/t/pass-runtime-variables-to-modules-init-function/55960)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 5\
**Last updated:** [February 24, 2021, 11:32pm UTC](https://discourse.julialang.org/t/pass-runtime-variables-to-modules-init-function/55960 "2021-02-24T23:32:47Z")

</div>

Julia docs point out that one can define an init() function for a module, which is run when the module is imported. It would be interesting to have a possibility to pass some runtime variables to the init function. The…

---

## ["T not defined" when defining parametric one-line function with return type](https://discourse.julialang.org/t/t-not-defined-when-defining-parametric-one-line-function-with-return-type/55827)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 3\
**Last updated:** [February 23, 2021, 9:08am UTC](https://discourse.julialang.org/t/t-not-defined-when-defining-parametric-one-line-function-with-return-type/55827 "2021-02-23T09:08:27Z")

</div>

I noticed the following seemingly weird error when defining an abstract generic type: abstract type SomeAbstractType{T} end func(x::SomeAbstractType{T})::Bool where {T} = error("func is not implemented.") and getting a…

---

## [How can I check out a pull request](https://discourse.julialang.org/t/how-can-i-check-out-a-pull-request/55771)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [February 22, 2021, 11:50am UTC](https://discourse.julialang.org/t/how-can-i-check-out-a-pull-request/55771 "2021-02-22T11:50:11Z")

</div>

Hello, I want to check out the following pull request for testing: https://github.com/JuliaLang/julia/pull/39779 The following approaches failed: ufechner@TUD277255:~/repos/julia$ git checkout cf1226e55d033336f109ae0…

---

## [What's the best practice to avoid forcing users into adding specific fields of their struct?](https://discourse.julialang.org/t/whats-the-best-practice-to-avoid-forcing-users-into-adding-specific-fields-of-their-struct/55751)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 5\
**Last updated:** [February 22, 2021, 7:01am UTC](https://discourse.julialang.org/t/whats-the-best-practice-to-avoid-forcing-users-into-adding-specific-fields-of-their-struct/55751 "2021-02-22T07:01:33Z")

</div>

I’d like to user-friendly interface in my simulator. So, I don’t wanna force users to add some specific struct fields. However, I encountered some issues in my usage pattern. For example, FymEnv is a type given by my …

---

## [Non-escaping array buffer re-use and the sufficiently smart compiler](https://discourse.julialang.org/t/non-escaping-array-buffer-re-use-and-the-sufficiently-smart-compiler/55660)

<div class="topic-metadata">

**Author:** [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Replies:** 11\
**Last updated:** [February 21, 2021, 11:49pm UTC](https://discourse.julialang.org/t/non-escaping-array-buffer-re-use-and-the-sufficiently-smart-compiler/55660 "2021-02-21T23:49:29Z")

</div>

This comes up pretty often in deep learning land because in-place operations do not generally please the AD framework. A quick demo: julia\> function test(n) a = ones(Int64, n, n) a = a .+ 2 …

---

## [Feature: Higher order type constructors](https://discourse.julialang.org/t/feature-higher-order-type-constructors/55456)

<div class="topic-metadata">

**Author:** [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Replies:** 14\
**Last updated:** [February 20, 2021, 4:00pm UTC](https://discourse.julialang.org/t/feature-higher-order-type-constructors/55456 "2021-02-20T16:00:23Z")

</div>

Apologies if this has already been discussed before. I couldn’t find an issue on GitHub or a discussion on Discourse that seems to address this (though I feel like I remember seeing one before…). It would be really nice…

---

## [Defining tests next to functions](https://discourse.julialang.org/t/defining-tests-next-to-functions/32155)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 17\
**Last updated:** [February 19, 2021, 8:37am UTC](https://discourse.julialang.org/t/defining-tests-next-to-functions/32155 "2021-02-19T08:37:02Z")

</div>

For languages without classes tests are in my opinion a great way to document functions. For example, when I have the function function str2int(letter::String) letter = uppercase(letter) @assert occursin(r"\[A-Z\]+", l…

---

## [Information hiding or modulization in Julia's C/C++ codes](https://discourse.julialang.org/t/information-hiding-or-modulization-in-julias-c-c-codes/55373)

<div class="topic-metadata">

**Author:** [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Replies:** 6\
**Last updated:** [February 19, 2021, 7:21am UTC](https://discourse.julialang.org/t/information-hiding-or-modulization-in-julias-c-c-codes/55373 "2021-02-19T07:21:00Z")

</div>

As suggested in https://github.com/JuliaLang/julia/issues/36903, I also believe that Julia’s ABI needs to be sorted out. In addition to the public/private distinction, IMO, it might be better to promote more modularizat…

---

## [Why is \`copy(adjoint)\` not an adjoint object?](https://discourse.julialang.org/t/why-is-copy-adjoint-not-an-adjoint-object/55371)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 12\
**Last updated:** [February 18, 2021, 7:03am UTC](https://discourse.julialang.org/t/why-is-copy-adjoint-not-an-adjoint-object/55371 "2021-02-18T07:03:11Z")

</div>

This surprised me: julia\> typeof(copy(rand(4,4)')) Matrix{Float64} (alias for Array{Float64, 2}) julia\> typeof(deepcopy(rand(4,4)')) LinearAlgebra.Adjoint{Float64, Matrix{Float64}} I have an algorithm which looks pret…

---

## [Downloading from github behind a firewall - Peer’s Certificate issuer is not recognized](https://discourse.julialang.org/t/downloading-from-github-behind-a-firewall-peer-s-certificate-issuer-is-not-recognized/43003)

<div class="topic-metadata">

**Author:** [@feacluster](https://discourse.julialang.org/u/feacluster)\
**Replies:** 12\
**Last updated:** [February 17, 2021, 9:27pm UTC](https://discourse.julialang.org/t/downloading-from-github-behind-a-firewall-peer-s-certificate-issuer-is-not-recognized/43003 "2021-02-17T21:27:25Z")

</div>

I am behind a corporate firewall but am authenticated to access the internet. I can access any site using curl . But I keep running into this error in Julia when installing packages: │ \[18:12:51\] curl: (60) Peer’s Certi…

---

## [Do not assume BB binary is used everywhere](https://discourse.julialang.org/t/do-not-assume-bb-binary-is-used-everywhere/54760)

<div class="topic-metadata">

**Author:** [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Replies:** 47\
**Last updated:** [February 16, 2021, 8:18pm UTC](https://discourse.julialang.org/t/do-not-assume-bb-binary-is-used-everywhere/54760 "2021-02-16T20:18:13Z")

</div>

As I predicted, now you are just reinventing the wheel and create a new distro within a distro that is completely incompatible with the host system and can’t be used to interact with the system at all.

---

## [Understanding how GC is triggered](https://discourse.julialang.org/t/understanding-how-gc-is-triggered/55015)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 9\
**Last updated:** [February 13, 2021, 8:50pm UTC](https://discourse.julialang.org/t/understanding-how-gc-is-triggered/55015 "2021-02-13T20:50:52Z")

</div>

In the following comment https://github.com/JuliaData/DataFrames.jl/pull/2612#issuecomment-776914558 I have code and results of running it that I do not understand. Some calls to innerjoin function cause 90% GC time, alt…

---

## [Functional version of Base library](https://discourse.julialang.org/t/functional-version-of-base-library/54987)

<div class="topic-metadata">

**Author:** [@anon74562486](https://discourse.julialang.org/u/anon74562486)\
**Replies:** 11\
**Last updated:** [February 10, 2021, 9:13pm UTC](https://discourse.julialang.org/t/functional-version-of-base-library/54987 "2021-02-10T21:13:39Z")

</div>

Is there a functional version of the Base library? is it possible to do this? x = rand(10, 10) r\_x = x |\> reshape((1, length(x))) |\> # convert x to a 1xlength(x) Matrix r |\> # apply r …

---

## [Proposed signed\_sub function](https://discourse.julialang.org/t/proposed-signed-sub-function/54766)

<div class="topic-metadata">

**Author:** [@bobcassels](https://discourse.julialang.org/u/bobcassels)\
**Replies:** 8\
**Last updated:** [February 9, 2021, 12:28am UTC](https://discourse.julialang.org/t/proposed-signed-sub-function/54766 "2021-02-09T00:28:45Z")

</div>

I need to take differences of unsigned numbers. For that purpose I propose to add a signed\_sub function, that subtracts UInts, producing a (signed) Int result. For UInt64, it would be: function signed\_sub(x::UInt64, y::…

---

## [Which paper(s) to read on Julia design?](https://discourse.julialang.org/t/which-paper-s-to-read-on-julia-design/54864)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 5\
**Last updated:** [February 8, 2021, 11:21pm UTC](https://discourse.julialang.org/t/which-paper-s-to-read-on-julia-design/54864 "2021-02-08T23:21:02Z")

</div>

I want to get a bit more insight into the design of Julia, including details on the language itself, compiler, code generation, etc. I’m not looking for all the gory details, but just enough to understand better what goe…

---

## [LLVM vector casting? bitcast … vector\<4xi64\> to vector\<8xi32\>](https://discourse.julialang.org/t/llvm-vector-casting-bitcast-vector-4xi64-to-vector-8xi32/54757)

<div class="topic-metadata">

**Author:** [@Rana\_Ian](https://discourse.julialang.org/u/Rana_Ian)\
**Replies:** 2\
**Last updated:** [February 6, 2021, 10:21pm UTC](https://discourse.julialang.org/t/llvm-vector-casting-bitcast-vector-4xi64-to-vector-8xi32/54757 "2021-02-06T22:21:52Z")

</div>

Hi, Has anyone seen something like bitcast … vector\<4xi64\> to vector\<8xi32\> There’s an LLVM thread requesting to add those semantics. So, it doesn’t seem to be available in that form. But I thought I would ask here in…

---

## [Why does defining a vararg method define a zero argument method?](https://discourse.julialang.org/t/why-does-defining-a-vararg-method-define-a-zero-argument-method/50872)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 32\
**Last updated:** [February 4, 2021, 8:53pm UTC](https://discourse.julialang.org/t/why-does-defining-a-vararg-method-define-a-zero-argument-method/50872 "2021-02-04T20:53:42Z")

</div>

When defining a vararg method, a zero argument method is implicitly created: julia\> foo(args...) = sum(\[args...\]) foo (generic function with 1 method) julia\> foo() ERROR: MethodError: no method matching zero(::Type{Any…

---

## [Are \_symmetric\_ multimethods worth it?](https://discourse.julialang.org/t/are-symmetric-multimethods-worth-it/54471)

<div class="topic-metadata">

**Author:** [@seertaak](https://discourse.julialang.org/u/seertaak)\
**Replies:** 15\
**Last updated:** [February 3, 2021, 11:40pm UTC](https://discourse.julialang.org/t/are-symmetric-multimethods-worth-it/54471 "2021-02-03T23:40:13Z")

</div>

Multimethods are awesome. I think anyone who’s interested in Julia will agree with that. But I would like to ask an “out there” question: are symmetic multimethods - vs non-symmetric ones - worth the trouble? Reasons I’…

---

## [Released version vs. source compiled - optimizations?](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 6\
**Last updated:** [January 31, 2021, 9:32pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329 "2021-01-31T21:32:40Z")

</div>

One “bug” I recently found appears to differ between the packaged and released version of Julia and the one I compile from source. Extra allocations associated with unused ArgumentError · Issue #37639 · JuliaLang/julia …

---

## [Getting function's module by a MethodInstance](https://discourse.julialang.org/t/getting-functions-module-by-a-methodinstance/53419)

<div class="topic-metadata">

**Author:** [@ulysses](https://discourse.julialang.org/u/ulysses)\
**Replies:** 5\
**Last updated:** [January 25, 2021, 5:24pm UTC](https://discourse.julialang.org/t/getting-functions-module-by-a-methodinstance/53419 "2021-01-25T17:24:36Z")

</div>

I’m looping over method instances in a module using @tim.holy’s marvelous MethodAnalysis.jl. I need to run @code\_typed for those instances to extract some type information. For that I first resolve the function using get…

---

## [Range(stop)](https://discourse.julialang.org/t/range-stop/53478)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 17\
**Last updated:** [January 22, 2021, 11:24pm UTC](https://discourse.julialang.org/t/range-stop/53478 "2021-01-22T23:24:03Z")

</div>

Should Julia have a range(stop) similar to the Python range(stop)? In Julia master (1.7.0-DEV), we recently merged an all keyword range(; start, stop, length, step) in #38041. In addition to allowing all range arguments…

---

## [Shorthand for dispatch types](https://discourse.julialang.org/t/shorthand-for-dispatch-types/53631)

<div class="topic-metadata">

**Author:** [@owiecc](https://discourse.julialang.org/u/owiecc)\
**Replies:** 5\
**Last updated:** [January 21, 2021, 10:24pm UTC](https://discourse.julialang.org/t/shorthand-for-dispatch-types/53631 "2021-01-21T22:24:22Z")

</div>

What do you think of providing a shorthand for creating types that are defined just for dispatching to relevant methods. For example (https://bkamins.github.io/julialang/2020/11/27/abt.html): abstract type ABRule end st…

---

## [External talk: "GopherCon 2020: Austin Clements - Pardon the Interruption: Loop Preemption in Go 1.14"](https://discourse.julialang.org/t/external-talk-gophercon-2020-austin-clements-pardon-the-interruption-loop-preemption-in-go-1-14/53555)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 0\
**Last updated:** [January 18, 2021, 7:59pm UTC](https://discourse.julialang.org/t/external-talk-gophercon-2020-austin-clements-pardon-the-interruption-loop-preemption-in-go-1-14/53555 "2021-01-18T19:59:43Z")

</div>

I really enjoyed watching this talk about how Go has added preemption to their coroutines to avoid stop-the-world GC latency caused by long-running tight-loops in tasks: GopherCon 2020: Austin Clements - Pardon the Inte…

---

## [Invalid version string during Windows build](https://discourse.julialang.org/t/invalid-version-string-during-windows-build/53474)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 1\
**Last updated:** [January 17, 2021, 7:50am UTC](https://discourse.julialang.org/t/invalid-version-string-during-windows-build/53474 "2021-01-17T07:50:04Z")

</div>

I encountered the following error when trying to build Julia on Windows via Cygwin. $ make -j8 ... JULIA usr/lib/julia/sys.ji ... error during bootstrap: LoadError("sysimg.jl", 3, LoadError("Base.jl", 226, LoadError…

---

## [Tail-call optimization and function-barrier -based accumulation in loops](https://discourse.julialang.org/t/tail-call-optimization-and-function-barrier-based-accumulation-in-loops/25831)

<div class="topic-metadata">

**Author:** [@tkf](https://discourse.julialang.org/u/tkf)\
**Replies:** 13\
**Last updated:** [January 16, 2021, 3:20am UTC](https://discourse.julialang.org/t/tail-call-optimization-and-function-barrier-based-accumulation-in-loops/25831 "2021-01-16T03:20:29Z")

</div>

Tail-call optimization/elimination was brought up in several threads like this one in discourse and this one in GitHub. The main interest seems to be purely based on the nice-to-have performance benefit and the core devs…

---

## [Intersection of ProductIterator](https://discourse.julialang.org/t/intersection-of-productiterator/53357)

<div class="topic-metadata">

**Author:** [@OlivierHnt](https://discourse.julialang.org/u/OlivierHnt)\
**Replies:** 2\
**Last updated:** [January 15, 2021, 12:49am UTC](https://discourse.julialang.org/t/intersection-of-productiterator/53357 "2021-01-15T00:49:56Z")

</div>

I noticed that intersect on Iterators.ProductIterator{\<:NTuple{N,UnitRange}} generates all the values and stores them in a Vector. I was expecting it to return an Iterators.ProductIterator{\<:NTuple{N,UnitRange}} since in…

---

## [Unexpected Segfault on \`deepcopy\` (perhaps in GC, JL 1.4)](https://discourse.julialang.org/t/unexpected-segfault-on-deepcopy-perhaps-in-gc-jl-1-4/52885)

<div class="topic-metadata">

**Author:** [@dehann](https://discourse.julialang.org/u/dehann)\
**Replies:** 3\
**Last updated:** [January 13, 2021, 8:22pm UTC](https://discourse.julialang.org/t/unexpected-segfault-on-deepcopy-perhaps-in-gc-jl-1-4/52885 "2021-01-13T20:22:07Z")

</div>

Hi Community, We recently got a segfault on a deepcopy of a larger composite Julia object. This is the first of it’s kind in many years of use. We’re tracking that as an issue in the local package, with details and st…

---

## [Collect and type inference](https://discourse.julialang.org/t/collect-and-type-inference/53152)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [January 13, 2021, 12:00pm UTC](https://discourse.julialang.org/t/collect-and-type-inference/53152 "2021-01-13T12:00:20Z")

</div>

While the type-widening of collect for EltypeUnknown is extremely useful for generic code, my recent experience with a large codebase with time-consuming and occasionally failing inference suggests that these two alterna…

---

## [Are there Julia operational semantics available?](https://discourse.julialang.org/t/are-there-julia-operational-semantics-available/52923)

<div class="topic-metadata">

**Author:** [@0x0f0f0f](https://discourse.julialang.org/u/0x0f0f0f)\
**Replies:** 4\
**Last updated:** [January 8, 2021, 12:59am UTC](https://discourse.julialang.org/t/are-there-julia-operational-semantics-available/52923 "2021-01-08T00:59:09Z")

</div>

I am interested in using Julia for my thesis. Is there any formal system backing Julia’s semantics? At least the core language? For example, in other languages:

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

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