This is the theoretical goal right here: We want to feel like a dynamic language while being a static language. We want to be as fast as Python when it, for example, parses a simple argument and prints out the help message. We want to have that experience where it's essentially instant and nice, but in a compiled language.
First, we collect the necessary information and save it to some metadata. Then, we delete the notion that it was dynamically linking to Rock, making it think it's static now. Next, we compile our app to machine code using the dev backend to make it fast. We literally append the bytes to the end of the binary and load everything up in a map to ensure things are fast. Since we just created a lot of these bytes, everything remains hot in cache.
Rock's tracing aims to compete with Python and offer a fluid experience. Zig, on the other hand, has different goals but emphasizes simplicity and fast compilation. This focus on user experience is often overlooked by big companies with infinite servers, remote builds, and complex caching systems. However, for the average user, this aspect is crucial for building software that is enjoyable to use.
The fundamental message here is to cheat more—meaning, pay attention to details. The solution might be simple, but it requires a deep understanding of systems to take advantage of them. This isn't really cheating; it's about leveraging constraints effectively. A significant problem today is the tendency to build higher abstractions without understanding the underlying details. Without this knowledge, it's challenging to create something truly remarkable.
In the Q&A session, a question was raised about targeting a shared object and emitting dynamic relocations. The process involves building everything as Position-Independent Code (PIC) or Position-Independent Executable (PIE), skipping Thread-Local Storage (TLS). This approach can lead to emitting a general dynamic model, which is not efficient at runtime. The response highlighted that in Rock's case, many things are skipped, and they patch up calls directly.