RobertBendun / stacky

Stack based programming language
Boost Software License 1.0
4 stars 1 forks source link

Sized and (un)signed integer types #46

Open RobertBendun opened 3 years ago

RobertBendun commented 3 years ago

Removes ptr

Introduces

usize and isize are type aliases for type that matches their bit length. For example isize == i64 <=> sizeof(isize == i64)

Memory declarations produce pointers with correct type. For Foo 1 []u32 holds typeof(Foo) == u32

Conversion from smaller type to bigger type is implicit given their both (un)signed. (Not sure about this, time will tell)

Pointers

Addition, subtraction, load, store have different meaning according to what pointer is pointing to. For example: *i32 + u64 is val(*i32) + 4 * val(u64) (same as C)