proposal | go | |
---|---|---|
48 | 2,237 | |
3,388 | 126,590 | |
0.4% | 1.0% | |
6.1 | 10.0 | |
24 days ago | 4 days ago | |
HTML | Go | |
BSD 3-clause "New" or "Revised" License | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proposal
-
The Defer Technical Specification: It Is Time
I know they implemented an optimization back in go 1.13. Not sure if that will help.
https://github.com/golang/proposal/blob/master/design/34481-...
-
Lies we tell ourselves to keep using Golang
the most basic example was the declined proposal https://github.com/golang/proposal/blob/master/design/32437-...
Some people didn't like the "try" keyword it reminded them too much of exceptions, some people didn't like that they couldnt see a return inline (which was the purpose of the proposal in the first place).
it's not that there are no solutions. the main problem is the go team's insistence to have "one true way" (tm) of doing something and unfortunately this gap between people who want to see every return inline and people who want to see the clean solution separate from the error handling is not something that can be bridged by technical means. the only solution is to implement both ways and lets see which one wins.
-
Does Go Have Subtyping?
The conclusion is pretty weird to me.
Go does rely on monomorphization for generics, just like C++ and Rust. The only difference is that this is an implementation detail, so Go can group multiple monomorphizations without worrying about anything else [1]. This form of hybrid monomorphization is being increasingly common, GHC does that and Rust is also trying to do so [2], so nothing special for Go here.
On the other hand, explaining variance as a lifted polymorphism is---while not incorrect per se---also weird in part because a lack of variance is at worst just an annoyance. You can always make an adopter to unify heterogeneous types. Rust calls it `Box`, Go happens to call it an interface type instead. Both languages even do not allow heterogeneous concrete (or runtime) types in a single slice! So variance has no use in both languages because no concrete types are eligible for variance anyway.
I think the conclusion got weird because the term "subtyping" is being misused. Subtyping, in the broadest sense, is just a non-trivial type relation. Many languages thus have a multiple notion of subtyping, often (almost) identical to each other but sometimes not. Go in particular has a lot of them, and even some relation like "T implements U" is a straightforward record subtyping. It is no surprise that the non-uniform value representation has the largest influence, and only monomorphization schemes and hetero-to-homogeneous adapters vary in this particular group.
[1] https://github.com/golang/proposal/blob/master/design/generi...
[2] https://rust-lang.github.io/compiler-team/working-groups/pol...
- Backward Compatibility, Go 1.21, and Go 2
-
Defining interfaces in C++ with ‘concepts’ (C++20)
https://github.com/golang/proposal/blob/master/design/generi...
-
Why Turborepo is migrating from Go to Rust – Vercel
Go Team wanted generics since the start. It was always a problem implementing them without severely hurting compile time and creating compilation bloat. Rust chose to ignore this problem, by relying on LLVM backend for optimizations and dead code elimination.
-
Are you a real programmer if you use VS Code? No Says OP in the byte sized drama
Hold up, did the members actually push this forward or was support just often memed about and suddenly this proposal was made: https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md
-
Major standard library changes in Go 1.20
As far as I can tell, the consensus for generics was "it will happen, but we really want to get this right, and it's taking time."
I know some people did the knee-jerk attacks like "Go sucks, it should have had generics long ago" or "Go is fine, it doesn't need generics". I don't think we ever needed to take those attitudes seriously.
> Will error handling be overhauled or not?
Error handling is a thorny issue. It's the biggest complaint people have about Go, but I don't think that exceptions are obviously better, and the discriminated unions that power errors in Rust and some other languages are conspicuously absent from Go. So you end up with a bunch of different proposals for Go error handling that are either too radical or little more than syntactic sugar. The syntactic sugar proposals leave much to be desired. It looks like people are slowly grinding through these proposals until one is found with the right balance to it.
I honestly don't know what kind of changes to error handling would appear in Go 2 if/when it lands, and I think the only reasonable answer right now is "wait and find out". You can see a more reasonable proposal here:
https://github.com/golang/proposal/blob/master/design/go2dra...
Characterizing it as a "lack of vision" does not seem fair here--I started using Rust back in the days when boxed pointers had ~ on them, and it seemed like it took Rust a lot of iterations to get to the current design. Which is fine. I am also never quite sure what is going to get added to future versions of C#.
I am also not quite sure why Go gets so much hate on Hacker News--as far as I can tell, people have more or less given up on criticizing Java and C# (it's not like they've ossified), and C++ is enough of a dumpster fire that it seems gauche to point it out.
-
Go's Future v2 and Go's Versioning
There will almost certainly not be a Go 2 in that sense. There is a Go 2 transition doc which extensively discusses what "Go 2" means. The conclusion is
-
What's the status of the various "Go 2" proposals?
As it says on that page - those were not proposals. They were draft ideas to get feedback on. You can see the list of proposals in this repository: https://github.com/golang/proposal
go
-
Learning GO: Loops and Conditionals
Let's continue our journey into Go. Last time, we got Go set up in WSL and covered some fundamentals like values, variables, and constants. This time, we'll dive into for loops and conditional blocks, the building blocks of decision-making and iteration in Go. We're working our way through Go by Example if you want to follow along.
-
Solving Authentication Challenges with Azure Communication Services SMTP Relay
Related Go Issue
-
HTTP/3 is everywhere but nowhere
and http3 is being implemented https://github.com/golang/go/issues/70914
Since Go has strong backwards compatibility guarantees, they're unlikely to commit to APIs that may need to change in the standard library.
-
Which Go Web Backend Framework Is Right for Your Next Project? A Detailed Analysis of Features and Performance
Go, created by Google, has become a favorite in the backend world thanks to its simplicity, speed, and built-in concurrency through goroutines and channels. Its compiled nature allows for highly performant applications that often outperform interpreted languages, making it an excellent choice for robust backend systems.
-
Decoding JSON sum types in Go without panicking
[2]: https://github.com/golang/go/issues/71497
-
Learning GO: A new beginning
Learning things is fun so I've decided it's time to learn go and because I enjoy making these little series I thought I'd write about it too.
-
A 10x Faster TypeScript
It's not just system calls. E.g. reflection package uses unsafe too: https://github.com/golang/go/blob/master/src/reflect/value.g... .
-
How to distrust a CA without any certificate errors
Unfortunately, OS vendors like microsoft are quite incompetent at running root stores https://github.com/golang/go/issues/65085#issuecomment-25699...
-
The cost of Go's panic and recover
I don't think any reasonable member of the Go community would claim that any aspect of the language and its standard library is perfect. The many open issues on https://github.com/golang/go attest to that.
One example, if I may: the errors.As function is far from ergonomic. It would have been much better if generics had come to the language before that function was added to the standard library. Modern alternatives exist: https://pkg.go.dev/github.com/jub0bs/errutil
-
Tokio and Prctl = Nasty Bug
A similar issue in Go, that I've encountered in real code: https://github.com/golang/go/issues/27505#issuecomment-71370...
In a nutshell, if you want to use the death signal, which is very handy and useful, you also need to lock an OS thread so that it can't be destroyed. Fortunately I'm only spawning one process so I don't need to jump through hoops, I can just dedicate a thread to it, but it would be inconvenient to want to spawn lots of processes that way.
Speaking more generally, a lot of things that I learned in the 200xs apply to "processes", and things I just osmosed over the years as applying to "processes", were changed to apply to "threads" over the decades and a lot of people have not noticed that, even now. Even though I know this, my mental model of what is associated to a thread and what is associated to a process is quite weak, since I've not yet needed to acquire a deep understanding. In general I would suggest to people that if you are dealing with this sort of system programming that you at least keep this general idea in your head so that the thought pops up that if you're having trouble, it may be related to your internal beliefs that things related to "processes" are actually related to "threads" and in fact just because you did something like set a UID or something somewhere in your code doesn't necessarily mean that that UID will be in effect somewhere else.
What are some alternatives?
thiserror - derive(Error) for struct and enum error types
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
functional-go - This library is inspired by functional programming - Clojure
v - Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
go_chainable - With generics, allowing chainable .Map(func(...)).Reduce(func(...)) syntax in go
Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).