Вопрос

The limited amount basetypes in DWScript can be very convenient, but doesn't it add a lot of overhead. Considering that integers are Int64, this should be quite a bit of overhead when you're working with byte values for example. Does DWScript optimize for this internally? If not, is there a way to use language extensions to add other basetypes, such as Byte?

In the event that this would cause problems with type inference, if it's possible to handle this in language extensions, inference for integer values could be deferred to the main Integer type or handled by the extension to select the smallest fitting datatype for example.

Это было полезно?

Решение

DWS uses Variants as an internal base type for storing all values. Since a Variant is significantly larger than a Byte, there's really nothing to be gained by using the Byte type in scripts.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top