How does Oxygene work behind the scene?

Hello dear Community,

unfortunately, i dont really understood quite well how oxygene works in background!

Does it work like free Pascal, C++ or C like a standard native language or does it have a runtime included like the CLR of .NET and so on?

And how am i able to understand, that in “Normal” Oxygene code, that means, without the C#, Java, Cocoa implementation, some of oxygene’s keywords are not useable in the code, for instance, the “paralell” keyword, or as well the future concept is not possible? Whats the reason behind this?

I would be really greatful for getting a response :slight_smile:

Sincerly yours,

Shpend

Oxygene (and our three other languages) can compile to four different platforms:

  • .NET, where it compiles to IL code and runs managed on the .NET Runtime (aka the CLR). Same as C# code would
  • Java, where it compiles to JVM byte code and runs managed on the Java (or Android) runtime. Same as Java Language code would
  • Cocoa, where it compiles to CPU-native code that runs own the Objective-C runtime in Mac and iOS. Same as Objectve-C and Apple Swift code would
  • Island, where ti compiles to CPU-native code that runs directly on the operating system’s core APIs (currently Windows and Linux, with 9.1 also Android NDK), using it’s own class system and core RTL. This mode is most similar to how FPC, Delphi or C/C++ work.

Parallel and Future support should be available on all platforms except Island, support for this on Island is planned, it just needs additional infrastructure in the core RTL that we need to create.

Does this answer your question?
—marc

At first, i have to thank you a lot for this fast response :slight_smile:

Honestly, you answerd my question a half ^^

When i open Visual Studio and im clicking: new Project -> RemObject Oxygene, and i press the start button, how does it compile, does it compile totally natively or does it have a garbage collection, ARC, etc…

Because there are 4 kind of projects i am able to choose(.NET, Java, Silver, Island) and Oxygene, but i dont know, does this version compiles directly to machine code or does this project-type use a runtime??

Is it by default : RemObject Oxygene : Island??

Thanks for all :slight_smile:
Shpend

Well, it depends on which type of project you choose, NET, Java, Cocoa or island :wink:

.NET, Java and Island use Garbage Collection, Cocoa uses ARC.

define “default”. all four options are equal. you pick the one for whatever platform you want to target.

—marc

Ok, but when 3 of 4 uses Garbage Collection, does this work without having a runtime?? (This question may be stupid, but im a beginner in this section^^)

Facit:
Island compiles directly to machine-code without a runtime (AND) uses a garbage Collection for disposing refobjects??

Thanks :slight_smile:

Yes, Island apps will have their own GC embedded. .NET and Java apps will use the GC provided by the respective runtimes.

1 Like

OK, but arn’t the island apps actually not slower than C/C++ Apps??
Because of its GC -Work and C/C++ uses internally (just (raw)pointer)

Just a question, #nohate^^

Not really, no.

Ok, but does your company provide some benchmarks??

As i said, i cant really imagine that it has the same speed of the C/C++ Compiler (GNU, MVC) because they are highly optimized and doesn’t have the garbage collector.

Would be really interesting to know how small/big the difference is between Island and C++!!:stuck_out_tongue_winking_eye:

Not currently, no.

It’ll largely depend on your code. The best way to find out is to benchmark and compare there exact scenarios you are interested in. FWIW, our compiler is also highly optimized :wink:

Ok thanks for all marc

I think and i tested a lot (yet no benchmark) but seemingly its pretty much the same speed as FPC :slight_smile:

When not more, but this i have to observe a little bit more :stuck_out_tongue:

Yours,
Shpend