this post was submitted on 19 Jan 2026
0 points (50.0% liked)
Rust
7685 readers
25 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Part of why Python can do this is that it runs completely differently from Rust. Python is interpreted and can run completely arbitrary code at runtime. It's possible to
execarbitrary Python.Rust is compiled ahead of time. Once compiled, aside from inspecting how the output looks and what symbol names it uses, there's nothing that ties the output to Rust. At runtime, there is nothing to compile new arbitrary code, and compiling at runtime would be slow anyway. There is no interpreter built into the application or required to run it either.
This is also why C, C++, and many other compiled languages can't execute new arbitrary code at runtime.