# How to force runtime evaluation?

**URL:** <https://ziggit.dev/t/how-to-force-runtime-evaluation/943>\
**Category:** Help\
**Created:** [June 27, 2023, 10:54pm UTC](https://ziggit.dev/t/how-to-force-runtime-evaluation/943 "2023-06-27T22:54:09Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![kristoff](https://ziggit.dev/user_avatar/ziggit.dev/kristoff/32/9_2.png) [@kristoff](https://ziggit.dev/u/kristoff)\
**Post date:** [June 28, 2023, 10:49am UTC](https://ziggit.dev/t/how-to-force-runtime-evaluation/943/5 "2023-06-28T10:49:11Z")

</div>

The rule right now is that a function is called at comptime implicitly only when you’re already in a comptime context, otherwise it will need to be prefixed with `comptime`. There has been discussion about eventually have the compiler “try” to resolve function calls at comptime without explicitly asking for it, but none of that exists today.

So a function call in the top scope of a file is always comptime, while a function call inside main is always at runtime unless prefixed with `comptime`.

Not sure how that interacts with LLVM optimizations though, so you might get a non-comptime compile time resolution by LLVM when the function is simple enough.

---

_[View the full topic](https://ziggit.dev/t/how-to-force-runtime-evaluation/943)._
