fubark / cyber

Fast and concurrent scripting.
https://cyberscript.dev
MIT License
1.18k stars 40 forks source link

Disallow variable shadowing and remove "let"? #26

Closed dumblob closed 1 year ago

dumblob commented 1 year ago

I wonder whether you would consider disallowing variable shadowing altogether (as e.g. V proves to be really valuable and actually not annoying in practice) and thus also remove the need for the let keyword?

fubark commented 1 year ago

11

dumblob commented 1 year ago

This is a misunderstanding. Forget the part "remove let keyword" which is just an unimportant side effect.

The main point is to disallow shadowing - i.e. a purely artificial constraint during the compilation step without any technical impact on anything later.

So this issue (#26) is not about what is being discussed in #11 .

fubark commented 1 year ago

It's too much of a restriction IMO, not something that is suitable for a scripting language.

dumblob commented 1 year ago

That is exactly the perception which I am challenging :wink:. V is being used as a scripting language (thanks to its millisecond-level compilation times on modern HW) and proves that this restriction is very valuable and actually not restricting as a person coming from shadowing languages would initially guess.

A good metric would be to see e.g. how many times this has been mentioned in the issue tracker of V and the "Discussions" tab of V (especially What don't you like about V / what would you like to be changed?). It seems maybe twice or four times altogether in about 4 years. Compare that to thousands of other "small issues" a young language has to overcome and suddenly the bigger picture turns upside down.

WDYT?