ark-lang / ark

A compiled systems programming language written in Go using the LLVM framework
https://ark-lang.github.io/
MIT License
677 stars 47 forks source link

Pointer arithmetic + array indexing syntactic sugar on pointers #650

Closed MovingtoMars closed 8 years ago

MovingtoMars commented 8 years ago

Another TODO.

My idea: Add uintptr. You can convert any pointer type to uintptr and uintptr to any pointer type.

kiljacken commented 8 years ago

While a neat way to handle arbitrary pointer manipulation, we should probably allow size-aware pointer offsetting, most likely by using array index syntax, e.g.:

thing: *Thing;
thing[n] == uintptr(thing) + n*sizeof(Thing)
felixangell commented 8 years ago

@kiljacken :+1: