need a dialect of Rust that uses `[]` for generics and `()` for array accesses
Conversation
I want it too
1
1
Old rust used to use `[]` for type params and I'm still sad that it lost it 😢
This site is a wild ride if you're not familiar with Rust as it was back in the day: brson.github.io/archaea/
1
1
Example of using [] for type params and .() for indexing: brson.github.io/archaea/foreac
1
1
I don't think that _exactly_ would have survived but since we use .0 etc for tuple access I think arrays coulda been the same.
1
1
Oh yeah, I think `()` for indexing like in Scala is fine too.
2
2
tricky thing for `.0` etc. is disambiguating the fact that you are looking up a field name vs a variable. As in:
let index = 1;
let data = vec![1, 2, 3];
data.index
…which I guess could be done using type information, but would be kind of surprising… 😅
oh yes, we have to use parenthetical disambiguation for callable fields too, don't we?
1
1
well if it's a field it has to be literal, right? You can't dynamically look up a field by putting its name into a variable and using that. At least in rust you can't.
1
1
yeah, was more talking if you were to extend it to support indexing, and wanted to be able to index using variables
1
1
Show replies



