Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is possible to add more immutability in Go. There are many proposals for this: https://github.com/go101/go101/wiki/Go-immutable-value-propo....

The main reason nothing happened in this direction is the core team think it is not important enough.



It's very clear that the reason these kinds of proposals haven't been accepted has nothing to do with the core team not believing they're important enough, but instead because of the impact that they have on the rest of the language.


What impact in your opinion?


Immutability is a fundamental property of a language, it's not something that can be bolted on post-facto in a version update. Go as a language doesn't provide immutability.


If the "for ;;" loop semantics can be bolted on post-facto in a version update, nothing else couldn't.

Go provides certain immutability.


It does not. Believe what you will.


You are not familiar with Go.


It's tough to retrofit new restrictions to old code. C/c++ code still doesn't have "const" everywhere it could. You have to make the default immutable - write "var" or "mut", not "const" - or it doesn't get used everywhere it should. But that breaks old code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: