PDA

View Full Version : why bundle exe files (module incl.) are so big?



largo_winch
15-07-2011, 11:55
simple question: why it's not possible to create small and light exe files with thinbasic (via bundle module) ? the thinbasic code examples are often fitted with very few of lines and I think it must be useful to create small bundle exe for specific modules you are using? anybody can say why it isn't such profitable way for thinbasic? I don't understand developing of module and bundle exe creations and exe file, that's true, but there will be more light in my mind why thinbasic produce such big exe files? ;) thanks, bye, largo

ErosOlmi
15-07-2011, 12:49
thinBasic is not a compiler but an interpreter.

Bundled EXE are not machine code executable of your source but are a sort of compressed file containing all the modules needed by your script.
Consider a bundled EXE like a ZIP file in which there are all the part of thinBasic needed to execute your script in machines where thinBasic is not installed.

When you execute bundled exe, there is a minimal stub that explode on the disk all needed files (thinBasic.exe, thinCore.dll and other dlls representing the modules you have used in your script) plus a crypted/obfuscated version of your script source code. At that time your script is executed.
When script stop its execution, all exploded files are removed from disk.

You do not see all this process because all files are exploded on disk with system hidden attributes set to on. You can see them if you instruct your shell Explorer to show also system hidden file.

I'm sorry but this process cannot be changed due to the interpretative nature of thinBasic.
This method is used also in other programming language that are not native machine code compiled.
The same .Net framework does something similar but does not need to include the full framework because the framework is a pre-requisite so you have it already installed in your computer. Same is Java code. All of them need the full core and extended classes present in your target machine.

If you have thinBasic installed in all your target machine you can just distribute an obfuscated version of your script and it will work.

Ciao
Eros

largo_winch
16-07-2011, 11:10
thank you eros for further explanations. Now I understand more about thinbasic background. I don't know other interpreters, so all these program and module executions with separatley and special dll creations are quite new for me. I cannot compare speed execution with other machines but I think the bundle exe files are fast enough for mainly working with this interesting interpreter ;)
I don't know powerbasic where thinbasic basically comes from. but I like freebasic too.
good luck for next releases and new ideas in direction of class development. bye and ciao, largo