Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / bytecode file

Author
Message
dontaskme
20
Years of Service
User Offline
Joined: 20th Jan 2004
Location: CH
Posted: 24th Oct 2018 13:13
Explain like I'm 5: What is this bytecode.byc file?

I'm working on PC only, and until now I thought I can compile an exe and run it as a complete standalone (well, apart of the media). When I remove the bytecode file from the media folder, or the media folder itself, the exe does not start as usual but gives an error, telling me it is not connected. But... I did not want to connect anywhere, I just wanted to run my helloworld.exe.
Coming from DBP I was used to compile one huge exe file including all resources - just one single file that would work on every PC with DirectX9. Now I guess I will have to include the media folder and the bytecode file into a package for PC users who do not have agk?

Side question: Is this the right place to ask this kind of questions? I've got some more here while I check out the trial version.
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 24th Oct 2018 15:06
AGK2 tier 1 is an interpreted language. That means, instead of compiling everything down to machine code, it is run, byte for byte, straight from the source code. This makes it much easier to create and maintain programs that will run on multiple platforms. Machine code must be generated for each platform as it is different for each one, but the source remains the same.

Now interpreting straight from the source that you write would be slow and inefficient. Instead, your program is compiled into p-code, short for portable code. This is basically your source code, rearranged into something which can be interpreted more efficiently and quickly. Most p-code actually resembles machine code, but for a virtual CPU. The .exe is actually the interpreter and some runtime functions, and the bytecode is your program converted into p-code.

https://en.wikipedia.org/wiki/P-code_machine
dontaskme
20
Years of Service
User Offline
Joined: 20th Jan 2004
Location: CH
Posted: 25th Oct 2018 13:35
Thanks TomToad!

Login to post a reply

Server time is: 2024-03-29 01:19:49
Your offset time is: 2024-03-29 01:19:49