To read all comments associated with this story, please click here.
An interpreted language can be very memory efficient, since you can reduce high level operations to a single byte.
Simple example:
PRINT "THIS IS A STRING"
the PRINT gets turned into a token, say 0x25, followed by a 0x10 byte (16, string length) then the characters of the string.
LD HL, STRING_LABEL
JSR PRINT
The interpreter has a 1 byte overhead above the actual data space, whereas in assembly you have a 6 byte overhead.
For a single print statement, the rest of the interpreter is overkill. But for large programs, since the interpreter is a static cost, the cost of the interpreter becomes less and less in terms of the overall size cost of the program.
Not to mention any actual productivity benefits.
No, typically the cost of an interpreter has always been performance, not size.






Member since:
2006-06-24
If you have memory constraints, why on earth use a scripting language?