Compiled to Native or VM

General FreeBASIC programming questions.
Post Reply
LonnieTC
Posts: 9
Joined: Aug 18, 2022 23:14

Compiled to Native or VM

Post by LonnieTC »

Hello All,

I am looking into possibly using FreeBASIC as part of a project and was wondering if the fbc compiler actually compiles to native binary or does it create a VM like Java?

If it compiles applications down to binary then that is exactly what I am seeking since I am planning on using it as the main core to load various shared libraries (i.e. DLL's compiled in native C/C++) and then pass control to them in different threads so that compiling to native should be as fast as writing a main code in C/C++ after it is compiled.

Thanks in advance and have a great day
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: Compiled to Native or VM

Post by angros47 »

It compiled to native code (both 32 bits and 64 bits)
Basically, the compiler emits assembly code (or intermediate C code) that is then translated to machine code.

It is also possible to compile to a VM (for example, with Emscripten) but by default FreeBasic produces 100% native binary code.

It can also be used to create dynamic libraries (in the examples you will see both how to load a dynamic library and how to create one)
LonnieTC
Posts: 9
Joined: Aug 18, 2022 23:14

Re: Compiled to Native or VM

Post by LonnieTC »

Thanks for the information this and I am digging into it more now.
Post Reply