System of primitive types in Jancy is a lot like the one in C/C++ with one exception: there is native support for integers with reversed byte-order (aka bigendians).
Bigendians are widely used throughout most network protocol stacks and everyone who was ever involved in network programming knows two things: number one, it kind of clutters the programs to constantly reverse byte order manually with all these ntohs/htons/ntohl/htonl calls. Even more importantly, number two – it’s sooo easy to forget to reverse byte order, thus getting a program which compiles just fine but has a logical bug in it! Since bigendians are so abundant in networking, and Jancy is intended for low-level IO programmers, bigendians got native support in Jancy.
Below is a list of all primitive types in Jancy.
bigendian unsigned short
bigendian unsigned int
bigendian unsigned long
int64_tdepending on platform)
unsigned intptr(aliases to
uint64_tdepending on platform)
POD- vs non-POD-types
In Jancy POD-type (plain-old-data) is a type of data which contains only user data bytes. Virtual method tables, safe data pointer validators, GC-box headers etc – all that is classified as meta-data. Any type containing meta-data – is a non-POD-type.
Primitive types and all their aggregations via arrays, structs or unions – are POD’s. Anything else – non-POD. You can
memcpy POD-types or modify them byte-by-byte – and that wouldn’t cause problems other than logical one (but not a crash!)