[LLVMdev] Re: Why JITC?

Oscar Fuentes oscarfv at telefonica.net
Mon Aug 7 11:04:24 PDT 2006

Mike Hearn <mike at plan99.net> writes:

> I guess this is slightly offtopic, but the post about the JIT and garbage
> collection made me wonder why LLVM supports JIT compilation at all. It has
> much smaller scope for optimisation due to the speed requirements, takes
> more memory and causes the same work to be repeated over and over for each
> execution. 
> What reason is there for anything to use JIT compilation over
> ahead-of-time compiling to native code?

Some applications grows and/or changes at runtime. For instance, my
programming language has macro facilities similar to those on Lisp,
which means that you can use the full language at compile time. This
is used on a database server this way: the application starts being
compiled and the environment is inspected (database schema, etc). This
affects the code generated by several macros. Finally, the
macroexpanded source code is compiled into binary code. The final
result is a binary application customized for the database it serves.

The database application serves code to clients, also customized
depending on the database and on the client. The "static" part of a
client is just the compiler plus some bootstrap code that asks for
source code to the server.

The client application can be modified at runtime by the server. The
server application can be modified at runtime due to changes on the
database schema or on the business rules.

Finally, complex client requests are compiled to native code by the


More information about the llvm-dev mailing list