FHannes
FHannes

Reputation: 781

DWScript basetype efficiency

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.

Upvotes: 2

Views: 179

Answers (1)

Mason Wheeler
Mason Wheeler

Reputation: 84550

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.

Upvotes: 2

Related Questions