Spogg wrote:Does this mean that Ruby code is interpreted on the fly rather than compiled into assembler? Or does it just have a lower priority than Stream?
The order would then seem to be Stream (Prims, DSP, ASM) then Ruby and finally Green if there's time. Correct?
Ruby is a script language, as are Python, Lua, JavaScript, to name a few others. The difference to programming languages like C/C++, Fortran or even Basic is that the latter are compiled to machine code (not Assembler, this is just another language to program machine code, although very close to machine code), whereas script languages are interpreted.
Interpretation can happen at runtime, so indeed they don't need to be compiled. The concept is hard to understand, so let me describe it this way:
Everything that Ruby offers -I'm talking of pure Ruby, not extensions or things you build with Ruby- is precompiled c-code. That means it is optimized for speed in terms of execution and everything exists as a kind of building blocks.
When we are scripting in Ruby, we basically put building blocks together in a certain order that is quite similar to a compiled application, but with the difference that the interpretation of our script code (the combining of the building blocks) takes some time (which you don't have in a completely compiled application, of course). It is always slower than a compiled application, but can get close to it, if scripted carefully.
The interpretation of the script code is done at 100 Hz in Flowstone, which is really fast.
Remember, this is just a simplified image of what a script language is like.
The second question can be answered with a simple yes. That's the order in terms of execution speed. In reality though it seems that green and Ruby are close together in terms of execution speed, which shouldn't wonder since the green prims are also precompiled.
Ruby will have advantages when it comes to managing things like arrays, but not for its speed advantage, but for the many tools it gives you at hand, that the green prims don't offer.