# How does Any actually work?

**URL:** <https://discourse.julialang.org/t/how-does-any-actually-work/124135>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [December 23, 2024, 7:13pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135 "2024-12-23T19:13:32Z")\
**Posts on this page:** 9\
**Page:** 3

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [December 24, 2024, 3:51pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/41 "2024-12-24T15:51:56Z")

</div>

Maybe there is something in About.jl?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [December 24, 2024, 8:07pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/42 "2024-12-24T20:07:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![world-peace](https://avatars.discourse-cdn.com/v4/letter/w/9f8e36/32.png) [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Post date:** [December 25, 2024, 8:15am UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/43 "2024-12-25T08:15:25Z")

</div>

> [@mbauman](#):
>
> 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.

See

> [@world-peace](#):
>
> This doesn’t make sense to me, because as was already pointed out, `Vector` is an abstract type, and therefore it can be infinitely many possible things.

> [@mbauman](#):
>
> There’s no such thing as an instance of an abstract type. Every object in Julia has a concrete type.

See

> [@world-peace](#):
>
> To put a different angle on it, understanding why Python performance is poor is relatively simple. All types are effectively `Any`. At runtime, when a function is called with some arguments, Python has to go to the location of each argument, figure out what (runtime) type it has, then follow a pointer to a VTable. The VTable tells Python what instructions to execute to perform the operations of the function.

Why comment without reading the thread?

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [December 25, 2024, 12:43pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/44 "2024-12-25T12:43:42Z")

</div>

> [@world-peace](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [December 25, 2024, 1:02pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/45 "2024-12-25T13:02:33Z")

</div>

> [@kevbonham](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [December 25, 2024, 1:10pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/46 "2024-12-25T13:10:50Z")

</div>

> [@Mason](#):
>
> It’s fine to not understand the answer someone gives, and to say so.

💯 I meant to indicate that this was evidence that the point of misunderstanding is not clear. I didn’t realize this was a pattern 😞

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [December 25, 2024, 3:16pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/47 "2024-12-25T15:16:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [December 25, 2024, 3:16pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/48 "2024-12-25T15:16:54Z")

</div>

Closed on December 25, 2024, 3:16pm UTC



---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [December 25, 2024, 8:23pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135/49 "2024-12-25T20:23:24Z")

</div>

Archived on December 25, 2024, 8:23pm UTC



[Previous page](https://discourse.julialang.org/t/how-does-any-actually-work/124135.md?page=2)
