GLBasic Apps

Previous topic - Next topic

coder14

I'm having a little dispute with some coder friends about GLB. I told them that GLB produces native apps for each platform, something which languages like Python, Java, Mono don't do. They say that GLB packs runtimes together with the app files, that's why the files are so large.

Does GLB pack runtimes with the final apps? Is it native code? :| Thanks in advance!

spacefractal

#1
there is runtime and they are separeted on some platform, and other included in the exe itself. Example is SDL, which its self take some place. Its few mb larger, but its only that. Howover my exe file for Greedy Mouse is 3.3mb with a command count over 10000commands. The only thing I dosent like by glbasic is really the compile time can been quite long compared to other languages, buts its perform nice and nice mobil platfom support.

That just like various other languages due the same due those kind of libraies that have been included.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrTAToad

Indeed - it's all native code, and some run-time libraries are packed into the executable (which most certain't aren't large).

coder14

Quote from: spacefractal on 2012-Jun-02
its runtime files which need to been included, just like many other lanuages does that.
What runtimes? The website says "100% Pure Machine Code Compiled Executables (No interpreters = FAST!) No DLLs needed at all". Why runtimes if native?  :O

MrTAToad

#4
Because various routines aren't included in the operating system.  For example, Linux doesn't include the GCC 3 library by default, Windows doesn't have the required C or SDL library , etc etc

The alernative would be to get the user to download and manually install everything needed before running the program...

Java and what not loads it's libraries either at program start or when needed (or a mixture of both).

"No DLLs needed at all" means no external libraries are used - they are all included within the program.

coder14

Quote from: MrTAToad on 2012-Jun-02
Because various routines aren't included in the operating system.  For example, Linux doesn't include the GCC 3 library by default, Windows doesn't have the required C or SDL library , etc etc
I know, but my C++ apps don't need any runtimes because all the libraries are linked at compile time. Why is this not the case with GLB? What is SDL and is there other libraries included?  :blink:

Darmakwolf

Coder14, your C++ apps don't need "runtimes" because they link when compiled, sure. Same with GLBasic. The SDL and required libraries are included with the exe. I dare you to write a C++ program that uses SDL and Open GL - see if it "just runs" on anyone's PC without them needing to install anything. If you can manage that, I bet you the file size will be similar to a GLBasic executable. The code from GLBasic is literally translated to C++ and compiled to native machine code. There is no interpreting going on. Those libraries are necessary for SDL and OpenGL functionality.

MrTAToad

SDL is a system for mainly dealing with 2D graphics and I/O

coder14

From the SDL website, "Simple DirectMedia Layer is a cross-platform multimedia library." Is this the one GLB uses?  :doubt:

Quote from: Darmakwolf on 2012-Jun-02
Coder14, your C++ apps don't need "runtimes" because they link when compiled, sure. Same with GLBasic. The SDL and required libraries are included with the exe. I dare you to write a C++ program that uses SDL and Open GL - see if it "just runs" on anyone's PC without them needing to install anything. If you can manage that, I bet you the file size will be similar to a GLBasic executable. The code from GLBasic is literally translated to C++ and compiled to native machine code. There is no interpreting going on. Those libraries are necessary for SDL and OpenGL functionality.

OK! GLB produces native apps and the major include is SDL which is required as API. Is the dll packed in the exe? C++ libraries are usually cpp or lib files that are linked at compile time and need not be distributed with the app later. GLB can also include the SDL source in the same way and need not include the dll. Any option to exclude SDL and distribute it separately?



TI-994A

Quote from: coder14 on 2012-Jun-02
From the SDL website, "Simple DirectMedia Layer is a cross-platform multimedia library." Is this the one GLB uses?  :doubt:

Hi coder14! I believe that it is.

Quote from: coder14 on 2012-Jun-02OK! GLB produces native apps and the major include is SDL which is required as API. Is the dll packed in the exe? C++ libraries are usually cpp or lib files that are linked at compile time and need not be distributed with the app later. GLB can also include the SDL source in the same way and need not include the dll. Any option to exclude SDL and distribute it separately?

GLBasic is a great development tool, but although it compiles to native machine code, they're not standalone EXEs. The SDL is a core and crucial component in GLBasic, which acts as an abstraction layer that facilitates the cross-platform support. However, this is not the same as the conventional "runtime" because the native code execution does not depend on it. It is a standardised library of media functions that calls the corresponding native function for the relevant platform.

You're right about one thing though; since the SDL falls under GPL, the source libraries could be integrated into the GLBasic IDE, to facilitate static linking of only the called functions, thereby freeing it from the inconvenience of DLL dependency. But since the SDL is packed into the EXE itself, this should not be much of an issue.

Besides this, I'm not really sure if any other libraries are included in the final EXE.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

MrTAToad

#10
QuoteOK! GLB produces native apps and the major include is SDL which is required as API. Is the dll packed in the exe?
It doesn't actually pack the DLL into the executable, it just included the required static library code...  DLL's are usually always external to the executable.

QuoteAny option to exclude SDL and distribute it separately?
You can compile for console and exclude SDL that way.  As for distributing it, it's easier just to download from the SDL website - I dont think Gernot would want to release his source code for everyone...


coder14

Quote from: TI-994A on 2012-Jun-02You're right about one thing though; since the SDL falls under GPL, the source libraries could be integrated into the GLBasic IDE, to facilitate static linking of only the called functions, thereby freeing it from the inconvenience of DLL dependency. But since the SDL is packed into the EXE itself, this should not be much of an issue.

Besides this, I'm not really sure if any other libraries are included in the final EXE.
Thanks! I was afraid it was a VM runtime like JRE and .Net framework. I think that Python and Mono also need a VM because they don't compile to native code.

Quote from: MrTAToad on 2012-Jun-02It doesn't actually pack the DLL into the executable, it just included the required static library code...  DLL's are usually always external to the executable.
If static then uncalled functions should not be included, but looks like the whole SDL library is included.

Quote from: MrTAToad on 2012-Jun-02You can compile for console and exclude SDL that way.  As for distributing it, it's easier just to download from the SDL website.
Is this "compile for console" option possible if our code has calls to SDL functions? Thanks.

spacefractal

#12
If you want external SDL as dll, then you would only get it to works on Windows platform. That is really not a good idea due that way glbasic works! Dont forget glbasic can compile to many other platforms than Windows.

Also its much less confuction for the enduser to get the application works in first try, because you are not need to download various runtimes files separated), which really can annoyring the user (I dont like when that happens).


Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

coder14

Quote from: spacefractal on 2012-Jun-02
If you want external SDL as dll, then you would only get it to works on Windows platform. That is really not a good idea due that way glbasic works! Dont forget glbasic can compile to many other platforms than Windows.

Also its much less confuction for the enduser to get the application works in first try, because you are not need to download various runtimes files separated), which really can annoyring the user (I dont like when that happens).
Good point! Is it only the SDL or are other libraries included with the exe?

MrTAToad

Yes, there is also DirectX for Windows and various other stuff for the other platforms...