TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Go 1/2 Proposal: Immutable Types

19 pointsby romsharkover 6 years ago
Hey guys, I just published the Go 1.x &#x2F; Go 2.x proposal to &quot;Immutable Types&quot; that I&#x27;ve been working on for the past month and it&#x27;s now official:<p>https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;27975<p>Please be sure to check it out and feel free to join the conversation! Even if this feature is never introduced to the language specification - reading the design document will make you a better Go developer, that I guarantee!<p>original design document: https:&#x2F;&#x2F;github.com&#x2F;romshark&#x2F;Go-1-2-Proposal---Immutability

1 comment

x0re4xover 6 years ago
Hi,<p>my humble opinion: how much would &quot;Immutable Types&quot; add to the language? How much complexity would it add? Things can already be made immutable from outside by hiding them in private variables&#x2F;struct elements.<p>The question is: why did Go became successful without having &quot;Immutable Types&quot;? (or &quot;Reference Types&quot;, ADTs too please?) Maybe those things are just frills, &quot;nice to have&quot; features.<p>Example like &quot;type ImmutableMapAndKey const map[const * const Object] const * const Object&quot; looks like really ugly Go to me... this is starting to look like C++...<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=cQ7STILAS0M" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=cQ7STILAS0M</a> (why Golang is Sucessful by Creator of Golang Rob-pike)<p>P.S.: I wouldn&#x27;t mind having &quot;Immutable Types&quot;, &quot;Reference Types&quot;, ADTs, etc. in Go. But not if it means abandoning simplicity of the language.
评论 #18127824 未加载
评论 #18133064 未加载
评论 #18128408 未加载