I would add that requiring modifications to dispatch to take effect immediately is one of those classic behaviors in dynamic languages that makes them hard/impossible to compile without heroic efforts (along with reified local scopes, the ability to add state to objects dynamically at any point, etc. – we should make a list some time). In Julia we’re nipping that one in the bud by defining the language to work in a way that can be implemented in the presence of compilation without insane contortions, namely with world ages that only take effect at the top-level, just the way that @kristoffer.carlsson described.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| How to Bypass the World Age Problem | 30 | 9073 | November 19, 2017 | |
| World age delay doesn't occur with `@eval` in `begin` or `let` blocks, but does with `eval` | 6 | 214 | December 5, 2025 | |
| Another world age problem | 6 | 417 | June 8, 2023 | |
| Running in world age ... while current world is | 9 | 2498 | May 20, 2019 | |
| World Age for beginners: one way to compile a dynamic language | 2 | 1126 | December 6, 2025 |