Noobiest question of the day, I know. You see, I was checking out this great tutorial on lynda.comFoundations of Programming Fundamentals1_4 - YouTube where they explain the differences between compiled and interpreted languages, to sum up what I can gather:
compiled languages are those that need to be converted into an executable for the application to run
Interpreted languages are interpreted at run-time, never turned into an executable.
So what I can deduce from these ridiculously simplified definitions is that all my scripts in unity are being compiled since I can build my project into a, say, an .exe file in order to publish it on Steam, for example. However, I remember in a live training video in the unity webpage (I honestly can’t remember which one) someone corrected Mike Geig telling him that “scripts in unity are not being compiled but interpreted”… so what gives then? are scripts in unity being compiled, interpreted or some hybrid like the video tutorial of lynda mentions? Thanks in advance for the answers and sorry if this is way to nooby, I’m new in the world of programming
It is being compiled. You can find the dll of the scripts. I would think the term interpreted is used since Unity is running C++ with wrappers to call the C# side but the scripts are compiled.
Interpreted is used for server(Php,Python)/client(Javascript) side code as you can see the actual code (Right click show source code) then the browser or the server is running the code.
Unity does not seem to do that.
But whether is compiled or interpreted would not make any difference on your side.
This does make a difference for virtually all Unity developers as we have to wait for a fairly lengthy compilation phase (proportional to how much code you have, and how fast your CPU!) to complete before we get to test any changes to the code.
Reading the suggested reference it will be made clear that compiled/interpreted is a matter of degree for many languages such as Java or C#.
NOTE: weirdly, it seems that the compilation phase carried by Unity is not incremental - if it were, only the latest changes and some dependencies would be recompiled, and the wait would be reduced to almost insignificant.
The advantage of ‘more compiled’ vs ‘more interpreted’ is more compiled yields better performance.
‘More interpreted’ makes the test-tweak-retest loop way faster, making interpreted languages such as Python a great choice for many game designers.
Of course that isn’t the only criterion, otherwise we’d all be developing games in Python : )