zksecurity / noname

Noname: a programming language to write zkapps
https://zksecurity.github.io/noname/
179 stars 46 forks source link

UX: making ranges non-confusing #133

Open mimoo opened 3 months ago

mimoo commented 3 months ago

there was always a confusing with the range syntax in languages, which led to a lot of off by one errors. This was addressed in modern languages by using iterators (which we should definitely support at some point, see https://github.com/zksecurity/noname/issues/132). But ranges are still confusing. Rust even introduced a new notation, 0..3 and 0..=3 which imo looks great but doesn't make things less confusing.

How about we only support ranges that look like this: 0..=3 to emphasize that we're ranging from 0 to 3 including 3? I'm not sure if it's a stupid idea.