LLVM Compiler Overview version 2

Good day, everyone.

I’m starting this thread to get up to date on the latest developments in the Xojo compiler.

I would like to validate the comparison.

Suggestions and opinions are welcome.

Fase Xojo C++ Swift C# Python
Lexer Yes Yes Yes Yes Yes
Parser Yes Yes Yes Yes Yes
Semantic Analyzer Yes Yes Yes Yes Limited
IR LLVM IR LLVM IR/GIMPLE/etc. LLVM IR CIL / MSIL Bytecode
Optimizer LLVM Very advanced / CLANG+GCC LLVM LLVM Very limited
Ahead-of-Time Machine Code Yes Yes Yes Partial No
Front end quality 9/10 10 10 9 8
Level Level A Level A Level A Lebel B Level C
Compilation result They do not need a virtual machine to run. They do not need a virtual machine to run. They do not need a virtual machine to run. They generate a portable IR. Interpreted Bytecode
Comments C#, Java, JavaScript (V8), are at the same level.

Beside “Do not use Python”, what is the conclusion ?

My personal opinion.

The C language has the best compiler on the market. XOJO performs reasonably well compared to other A-level languages. Its compiler is good.

Python isn’t bad; it depends on what you’re using it for. If you’re looking for a native compiler, you can rule out Python.

Everyone know Ruby is the best :laughing:

Note:

I forgot to add Kotlin to the table. And Ruby…

:+1:

Actually I would be interested in those stats

1 Like

Ruby is not generally recognized for cutting-edge compiler technology. Historically, it has relied on an interpreter-based execution model, with later performance improvements introduced through JIT compilation techniques.

@Jose_Fernandez_del_Valle
My Ruby comment was sprinkled with some humor :grin:

1 Like

Add two more lines. Which I consider important.

Fase Xojo C++ Swift C# Python
Lexer Yes Yes Yes Yes Yes
Parser Yes Yes Yes Yes Yes
Semantic Analyzer Yes Yes Yes Yes Limited
IR LLVM IR (Clang - LLVM IR) / (GCC - GIMPLE) LLVM IR CIL / MSIL CPython Bytecode
Optimizer LLVM Very advanced / CLANG+GCC LLVM Roslyn + RyuJIT Very limited
Ahead-of-Time Machine Code Yes Yes Yes Partial No
AOT vs JIT AOT AOT AOT JIT + AOT Partial Interpreter
SSA (Static Single Assignment) YES YES YES YES NO
Front end quality 9/10 10 10 9 8
Level Level A Level A Level A Lebel B Level C
Compilation result They do not need a virtual machine to run. They do not need a virtual machine to run. They do not need a virtual machine to run. They generate a portable IR. Interpreted Bytecode
Comments C#, Java, JavaScript (V8), are at the same level.

My comparison shows that Xojo is much closer to C++ and Swift than is commonly believed, because it shares the same LLVM infrastructure for optimization and native code generation.

But Languages are not the same as the compiler that they use. You have to consider everything that makes up the language including the frameworks. For C++ and Swift, you have to specifically import the things that you need. Xojo just includes everything whether you need it or not. That’s why a console hello world app in c++ can be measured in KB and one from Xojo is measured in MB.

I’m not saying that Xojo isn’t a good language or that it doesn’t build good apps, but when you consider that there’s a lot of underlying things in Xojo that could not exist without being C or C++, things like the glue that connects Xojo to each of the OS Frameworks, you must concede that you cannot do an apples to apples comparison.

3 Likes

You’re right.

It’s difficult to make a direct comparison. In fact, I usually prefer to compare languages from an OOP perspective, since I like to encapsulate everything I write.

However, examining the compiler often reveals how powerful a language really is. It’s something hidden from view—something most people never notice. That’s why people tend to do everything in Python, simply because they like it.

Going a step further, JavaScript is extremely popular due to web development. It’s similar to how Excel’s popularity has grown to the point where many people eventually start developing applications in VBA.

The trend illustrates how people often choose languages based on familiarity or preference rather than suitability.

However, the ability to compile is key. As you aptly summarize in this phrase: “Xojo just includes everything whether you need it or not.”