How does Any actually work?

Maybe there is something in About.jl?

3 Likes

Thereā€™s no such thing as an instance of an abstract type. Every object in Julia has a concrete type.

Dynamic languages classically let you do operations on things without knowing the type ahead of time. For example, an Any[x,y,z] vector is kinda like a python list. If you pull some value from it, the compiler needs to ask ā€œmetaā€ questions about the object to determine what type it is and figure out how to work with it. It also needs to ā€œholdā€ it in a very generic manner. Itā€™s these meta questions and generic storage thatā€™s responsible for poor performance.

What makes Julia special is that it can (sometimes) infer the exact concrete types of things and completely avoid meta questions and pessimized generic storage. Thatā€™s whatā€™s happening in fast (type-stable) code.

8 Likes

See

See

Why comment without reading the thread?

You have some of the most experienced Julia developers in the world, including creators of the language, here trying patiently to answer your questions. On Christmas Eve.

I have several times been satisfied with an answer only to have you say that you still donā€™t understand, so you are clearly not being as clear as you think. Please try to reign in the snark here.

13 Likes

Itā€™s fine to not understand the answer someone gives, and to say so.

What I find inexcusable, (and why I usually just put @world-peaceā€™s threads on mute) is the incredibly rude way they respond to people who are kindly trying to help them and also the sheer velocity with which they spawn new threads.

6 Likes

:100: I meant to indicate that this was evidence that the point of misunderstanding is not clear. I didnā€™t realize this was a pattern :disappointed:

Iā€™m going to close this thread now. You arenā€™t entitled to peopleā€™s time, effort or answers, certainly not after being repeatedly rude about it.

11 Likes