Compile-time calculation: Difference between revisions

→‎{{header|Wren}}: Added a clarification to the preamble.
m (→‎{{header|C sharp}}: Regularize header markup to recommended on category page)
(→‎{{header|Wren}}: Added a clarification to the preamble.)
Line 1,486:
Also Wren has no notion of constants - at compile time or otherwise - and is thoroughly object-oriented. Even literals such as ''123'' and ''true'' are technically instances of the immutable built-in classes Num and Bool.
 
There is little public information on the workings of the bytecode compiler other than that it is single pass and stack based. However, from what I havegather said above, I'd be surprised ifthat it does anyno calculationscompile andtime thecalculations likelihoodat isall thatand the factorial calculation in the program below is therefore done at runtineruntime.
 
Not that it makes much difference in practice as the compiler which is written in C is so quick (at least with scripts of moderate length and on modern hardware) that the compile and runtime stages are indistinguishable to the user.
9,482

edits