titzer / virgil

A fast and lightweight native programming language
1.2k stars 42 forks source link

Change system and pointer APIs to pervasively use the `Range` type #132

Open k-sareen opened 1 year ago

k-sareen commented 1 year ago

Currently APIs such as Ptr.atContents and System.file{Read,Write}K assume the input will be an Array<byte>. Changing to a Range<byte> would make it more general.

titzer commented 1 year ago

I have done some work on this recently, e.g. Pointer.atContents can work with ranges now.

For the built-in System component, I was thinking of adding new methods that take a Range<byte> and then deprecating the old ones. This requires a stable rev, as they must first be introduced into v3i and then (with the Pointer.atContents change above integrated into stable) added the native implementations after the rev.

k-sareen commented 1 year ago

Yes that makes sense. Sorry for being AWOL again -- just have too many deadlines. Will be more free after mid-April. Might try my hand at making an LSP server again.