19. Rob Pike - What We Got Right, What We Got Wrong | GopherConAU 2023

  Переглядів 79,026

GopherConAU

GopherConAU

День тому

Fourteen years after the launch of Go, there is much to think about. With the benefit of hindsight, this talk explores some of the lessons learned from Go's progress so far: not just the things that went well but also the things that could have been done better.
Slides: docs.google.com/presentation/...
Blog Post: commandcenter.blogspot.com/20...
About Rob Pike: Rob is a co-creator of the Go language (with Ken Thompson and Robert Greisemer). At Bell Labs he was involved in the creation of the Plan 9 from Bell Labs and Inferno operating systems, as well as the Limbo programming language. He is also the co-author (with Brian Kernighan) of The Practice of Programming and The Unix Programming Environment. He is co-creator (with Ken Thompson) of UTF-8.

КОМЕНТАРІ: 131
@gopherconau
@gopherconau 2 місяці тому
Folks, we love that you comment, but as a reminder, please keep your comments civil, and always aim to add to the discussion. If you have nothing to add to the discussion, please refrain from commenting. Otherwise it takes a lot of effort to moderate the comments.
@StefanoTorresi
@StefanoTorresi 2 місяці тому
So I went on Wikipedia to refresh my knowledge of all the amazing things this man did for the software industry, and I realized he looks two decades younger than he actually is. Way to efffin go, Rob!
@esra_erimez
@esra_erimez 3 місяці тому
After my firm moved a not so trivial sized code base from C++ to Go, I can say that in my very humble opinion Go got a whole more right than wrong. the team that created Go (including, but not limited to, Rob Pike and Ken Thompson) are the giants that we stand on the shoulders of. When designing the language, it appears to me that they made design decisions based on first principles. Taking influences from C and Modula-2 was (again, in my very humble opinion) as opposed to object oriented languages created a language that didn't have the baggage that comes along with it.
@Placeholderhandle1
@Placeholderhandle1 6 днів тому
Love listening to Rob.
@Zamicol
@Zamicol 3 місяці тому
Great talk. Thank you Rob.
@gabrielochsenhofer7872
@gabrielochsenhofer7872 3 місяці тому
For me, the major bloopers are allowing naked returns and weak enums. Had my share of bugs mostly due to those two things.
@nexovec
@nexovec 3 місяці тому
33:26 Rob Pike describes telemetry of google chrome.
@programmer1356
@programmer1356 2 місяці тому
take a look at mobile phone keyboards - shock horror
@ismaelgrahms
@ismaelgrahms 3 місяці тому
Great talk, 14 years of progress
@ajstarks
@ajstarks 2 місяці тому
Nice to see a shout out on the gofmt slide
@oleksandrgaiovskyi
@oleksandrgaiovskyi 3 місяці тому
In the concurrency example at 13:20 if timeout happens, goroutines that didn't complete will be stuck, as writing to the channel will be blocked forever.
@YuriyNasretdinov
@YuriyNasretdinov 3 місяці тому
Yeah good point, should've been a channel of capacity 3. I think this example is flawed in more ways than one, e.g. it doesn't use contexts, so the other queries aren't cancelled after a timeout, etc.
@voidvector
@voidvector 3 місяці тому
Lack of generics early on has created a lot of undesirable legacy code in the Go projects I encountered: * Excessive `reflect` package with `any` * Using text template to generate Go code * Using AST to generate Go code All of these should be rewritten with generics, but there are 50,000 lines of them.
@nas337
@nas337 3 місяці тому
If it works, it works. Generics in my opinion was one step forward to all feature bloat we see in other programming languages. I wish the Go team won’t introduce to many features in syntax like Rust team did. So the language hasn’t had at least 3 ways to do one thing.
@voidvector
@voidvector 3 місяці тому
@@nas337 I just described 3-4 ways of doing the same thing though. Witty engineers are going to abuse the lack of features by using outside tools (e.g. codegen, preprocessor), just as they do in misusing language features if the language has a bloat of features.
@RicardoSilvaTripcall
@RicardoSilvaTripcall 3 місяці тому
Why rewrite something that would work exactly the same as before? Just for the sake of it?
@voidvector
@voidvector 3 місяці тому
​@@RicardoSilvaTripcall There are a bunch of reasons * codegen is not available for linter / code search / bug analysis tools / test coverage analysis * codegen is difficult to understand and difficult for devs to update going forward. Rewrite would have to be weighted against other priorities, of course. So except for mission critical code, would likely not be done at most shops.
@sealoftime
@sealoftime 3 місяці тому
@@voidvector in what way is codegen not available for source code analysis?
@tomthebomb930
@tomthebomb930 Місяць тому
Great Talk
@RonJohn63
@RonJohn63 3 місяці тому
When seeing "Gopher" and and greybeard like "Rob Pike" in the title, I thought of the old Minnesota link-hierarchy server.
@nodidog
@nodidog 2 місяці тому
I want the wallpaper from the beginning!
@nickandrievsky5705
@nickandrievsky5705 3 місяці тому
Thank you!
@onsearchfocus
@onsearchfocus 3 місяці тому
Nice to see Rob being honest but I expected this talk to be about the Go type system. It's less than optimal. It misses Enums built-in.
@johnnm3207
@johnnm3207 3 місяці тому
if you initialize a memory arena aren't you supposed to clean it up yourself instead of GC?
@ismaelgrahms
@ismaelgrahms 3 місяці тому
In Go the GC cleans it for you. What you do is say I’m not using the arena anymore. But the GC will do the cleanup
@Alberto_Cavalcante
@Alberto_Cavalcante 3 місяці тому
I'm glad he mentioned "Go 2" is no longer going to exist.
@Mglunafh
@Mglunafh 3 місяці тому
Go 2 considered harmful
@EbonySeraphim
@EbonySeraphim 3 місяці тому
If they admit Go2 is an eventuality or even a remote possibility, Go dies. No one will want to build knowing theirs a time bound on the future of their platform, unless they agree to a huge future migration effort.
@Alex-lu4po
@Alex-lu4po 2 місяці тому
@@EbonySeraphimYou mean like every other language?
@EbonySeraphim
@EbonySeraphim 2 місяці тому
@@Alex-lu4po yes, just like every other language that isn’t being discussed now.
@Alex-lu4po
@Alex-lu4po 2 місяці тому
@@EbonySeraphim but where should they migrate to then?
@EL-gz3sh
@EL-gz3sh 3 місяці тому
Is there any plan to fix what they got wrong?
@madlep
@madlep 3 місяці тому
Would be interested to hear more about introducing sum type (ie Rust style enum, or Haskell style data declarations). Especially around error handling using Option/Result sum types to handle nil/error values, along with some syntax to “bubble up” errors out of a function like Rust ? operator. I die a little bit every time I see any non trivial go code, and > 50% of the line count is `if err != nil { return err }` “But you should be explicitly handling errors!” Is the usual go community apology. Sure, if you actually handle them. If you’re just returning them for calling code to do something with them (probably just check for nil and return them again), that’s not “handling” them. And having nil at all is just a massive footgun that could have been eliminated. Then go doubles down on nil by having typed nils, so there are a bunch of edge cases where nil != nil. It’s like they heard nil was a billion dollar mistake, and said “You know what? Let’s aim for a TRILLION dollars!”
@alurma
@alurma 3 місяці тому
The interaction with interfaces is tricky. There is an open issue on sum types.
@doBobro
@doBobro 3 місяці тому
BTW rust/haskell Option is awful from composing and keep interfaces stable perspective. Most code keeps defensive stance and makes function arguments and results Optional to keep compatibility in case of requirement changes. You can't add or remove optionality later without code breaking especially for libraries. Zig at least allows to keep stability on T -> Optional argument refactoring.
@tinusgraglin2079
@tinusgraglin2079 3 місяці тому
@@doBobro I don't know any Zig, so if the argument T turns to Optional and receives "Nothing", will the function return error? Or simply panics? Maybe somehow Zig will pick a default value?
@tinusgraglin2079
@tinusgraglin2079 3 місяці тому
@@doBobro Oh, you are saying that all the call sites of the function don't have to change, so it's kind of like "Type *" (i.e. pointers) in C, but the function receiving an "Type *" has to deal with it probably being NULL?
@tinusgraglin2079
@tinusgraglin2079 3 місяці тому
@@doBobro But what about u64 -> Optional? Before, the caller just passes any u64, so the raw value of an Optional will be just that u64, than how can we distinguish Nothing and Something(value)? Will the Zig compiler automatically transform all u64 at the call sites into e.g. (true, u64_val)?
@rmhartman
@rmhartman Місяць тому
the overly strong dependence on git has been the bane of my existence
@kuhluhOG
@kuhluhOG 3 місяці тому
8:50 While Go is great, I would argue that there another language which is even better at it: Zig But then again, it's considerably younger.
@YuriyNasretdinov
@YuriyNasretdinov 3 місяці тому
Yeah the way Zig implements cross compilation is super neat. However Go's cross-compilation also works well unless you use cgo.
@kuhluhOG
@kuhluhOG 3 місяці тому
@@YuriyNasretdinov except for your non-GO dependencies Zig can crosscompile well even C and C++ stuff for you (you can just use it as a C/C++ compiler dropin) because of that one company has a contract with the Zig foundation to keep this well maintained for their Go dependencies
@alurma
@alurma 3 місяці тому
Funny comment!
@tombyrer1808
@tombyrer1808 2 місяці тому
** Strobe light warning ** (editor: some of us need this warning)
@techaido
@techaido 3 місяці тому
if err != nil go 🎊
@metaltyphoon
@metaltyphoon 3 місяці тому
Seriously. Passed and amazing opportunity for o ask some “trivial” questions
@RootsterAnon
@RootsterAnon 3 місяці тому
I am shocked, what kind of audience was that? Bunch of students apparently with no exp. They can't even form a question for this man. Arenas was a good question, i would ask that since I think they are cool, but as he mentions, very dangerous if not done correctly.
@koalakakes
@koalakakes 2 місяці тому
Honestly some of the go docs are still awful. Not as bad as a lot of the package documentation for a lot of packages like the AWS SDK for Go but that's not the Go teams fault
@chrimony
@chrimony 3 місяці тому
Go's biggest sin is being only moderately better than Java. It's no wonder C++ still plays a big role at Google, because Java already took over where C++ would have otherwise been used. The remaining cases where C++ is still used would not be written in Go for the same reasons it wouldn't be written in Java. I do have to say that Go is quite a pleasant language to use when it comes to working with binary formats. Just the right amount of succinctness and type checking.
@vladlazar94
@vladlazar94 3 місяці тому
At the present moment (early 2024) Java is arguably in a better shape than Go. With the introduction of virtual threads in OpenJDK 21, there’s one less reason to adopt Go.
@vladlazar94
@vladlazar94 3 місяці тому
I’m saying this as someone who’s allergic to Java and who’s been rooting for Go for a long time. It might be a lost cause by this point unfortunately.
@danvilela
@danvilela 3 місяці тому
Java uses too much ram. Go is better. People hate java. People love go. Wtf are you talking about?
@chrimony
@chrimony 3 місяці тому
@@danvilela Go has a garbage collector -- which means it uses extra RAM just like Java does. Go introduced "goroutines", a threaded implementation of co-routines, but didn't solve the underlying problem of concurrency bugs. The only real benefit to Java users would have been the type system, but even there they didn't have generics until over 10 years later. As such, despite the initial excitement around Go, interest has petered out. It was never going to replace C++ because of garbage collection, and it didn't do enough to replace Java. It's a quirky language with a moderate following, and that's all it will ever be.
@ooijaz6063
@ooijaz6063 3 місяці тому
​@@chrimony [speaking from web dev point of view] In real world scenarios java memory usage is much higher than go. In go you can really easy optimize memory usage, by using object pooling, which is not possible in java due to lack of out parameters (in libs / frameworks / std api). In java most of the frameworks doesn't care about object allocation, and you end up with massive memory usage. While I agree that java and go are simillar in the use cases, and java is more performant, in many ways, than go, the fact is that go ecosystem focuses on the performance, while java ecosystem focuses on the developer productivity (which leads to the configuration driven development) and often doesn't care about optimization, which leads to bloated software from the beginning. Java ecosystem lead to the generation of the developers, which doesn't understand anything about web dev, they just know how to configure framework of the choice.
@haliszekeriyaozkok4851
@haliszekeriyaozkok4851 3 місяці тому
26:54 Indeed, go's module system is it's one of the worst sides of it. It's way more better how node.js and rust handles that, when i struggle to understand go's module system i've experienced very big frustration.
@jimxu1963
@jimxu1963 3 місяці тому
I LOVE GO!
@clementdato6328
@clementdato6328 3 місяці тому
The existence of a design choice is the result of a lack of specification for the problem.
@Edwin-nl3qu
@Edwin-nl3qu 3 місяці тому
The thing is, "we are boring on purpose" gets really old after a decade. Now it looks more like an excuse for intellectual masturbation or just laziness.. I really don't think it has much to do with backwards compatibility either, a lot of cool things can be done while still maintaining backwards compatibility. Theres been so much innovation in the languages world over the past decade. I'll even agree that most are bad ideas or not compatible with go but there are a few good ideas there and even some that a compatible with go.. if not copying, they should at least inspire some action or innovation..
@AJewFR0
@AJewFR0 2 місяці тому
What innovations?
@jabuci
@jabuci 2 місяці тому
@@AJewFR0 Just look at Swift. But to mention just one: optional parameters.
@ttng_
@ttng_ 2 місяці тому
​@@jabuciI find swift to be incredibly hard to read, with too many features. Anyways, optional parameters can be implemented with pointers and a bit of godocs on top of the function to make sure people know what the params serves.
@marcusaurelius6607
@marcusaurelius6607 3 місяці тому
audience is so dead and clueless. god, there are so many questions, why making and working with dynamic libraries is so broken (still, 7? 8? years and counting), why not let people use the syntax that stdlib is using (for example creating a custom map type mymap[type]type that implements an rb-tree inside), what was the reasoning behind not allowing operator overloading and so on and so forth
@natea.2926
@natea.2926 3 місяці тому
Maybe you can clarify your question about dynamic libraries, I'm not sure what you mean. As far as the map syntax, you can use myMap[type, type] since 1.18, which most people would consider just as good (I actually think they should allow map[keyType, valueType] with the built-in map implementation, but that's another discussion.) I personally have never seen operator overloading used in a way that was clearer than named methods. Now to understand what >> does, for example, I need to figure out what types its operands are, then find the correct overload definition, when a well-named method just lets me read the LOC without digging into all of that. For a language whose design was largely driven by the principal of readability over tenseness, operator overloads seem to me like an illogical addition.
@JamesHenstridge
@JamesHenstridge 3 місяці тому
maps and slices are not stdlib features: they're part of the language itself. He mentions this during the talk as a bit of a wart, and something that might have been done differently if generics had been part of the original language design. If it does ever happen, it'll probably be in the form of mapping some of that special language syntax to something a regular Go type can implement, and moving those container types to the stdlib.
@gopherconau
@gopherconau 3 місяці тому
We highly welcome you to come to the next GopherConAU. We also provide travel assistance to speakers, so if you would so incline, you could put in a talk when the CFP opens. CFPs have a 4% acceptance rate so it's pretty high.
@codenamelambda
@codenamelambda 3 місяці тому
​​@@natea.2926For things like linear algebra as an example, operator overloading makes things MUCH more readable IMHO. Especially if you're in a higher level language anyway. I think the problem is when operator overloading doesn't come with guarantees (for the most part) as seen in ie C++ or Python. But in Haskell, if you see a
@pikzel
@pikzel 3 місяці тому
@@gopherconau That snarky comment is so representful of the go community.
@foljs5858
@foljs5858 3 місяці тому
I don't think that the person mainly responsible for most of what Go got wrong is in position to objectively say what it got right and wrong
@blain20_
@blain20_ 3 місяці тому
Silly take.
@foljs5858
@foljs5858 3 місяці тому
@@blain20_ Silly, but true
@blain20_
@blain20_ 3 місяці тому
@@foljs5858 Nah. The designer of the language knows best what he should've and could've done.
@Whateverworksism
@Whateverworksism 2 місяці тому
You should look "retrospection" up in a dictionary.. This is a very healthy exercise and what you say is absolutely true, which is why one needs to be aware of it when making such an analysis. I find it quite incredible, that your only contribution to a 40+ min video, is your take without any nuance. Also, I mean you are incredible as in not-credible.
@PRIMARYATIAS
@PRIMARYATIAS 2 місяці тому
Odin > Go 🔥🔥🔥
@gopherconau
@gopherconau 2 місяці тому
This adds nothing to the discussion.
@jabuci
@jabuci 2 місяці тому
@@gopherconau That's an arrow. From Odin to Go.
@johnmigcruz2323
@johnmigcruz2323 2 місяці тому
I just don't like the language named Go. It's not even unique. Go? Why is it called Go? Is it because it's fast? So unusual. What a name! 😅
@manit77
@manit77 3 місяці тому
Please add try catch
@BarakaAndrew
@BarakaAndrew 2 місяці тому
Hell no
@jasonstewart_ky
@jasonstewart_ky 3 місяці тому
No disrespect to Go or Rob Pike, but try running the race condition checker on many popular Go projects. Ousterhout is still right.
@jasonstewart_ky
@jasonstewart_ky 3 місяці тому
@@linearz names withheld to protect the guilty
@Y-JA
@Y-JA 3 місяці тому
Could you elaborate on that? Why is that? Do you think that golang is more race-condition prone than other languages and why? Also, would that be a problem in all languages that implement stackful coroutines with green threads or is it specific to go?
@jasonstewart_ky
@jasonstewart_ky 3 місяці тому
@@Y-JA Ousterhout wrote that threads are--not always, but *usually*--a bad idea. Rob thinks he has refuted John's paper in some way with goroutines and channels. From what I have seen in popular projects, goroutines, channels, green threads, etc have only served to strengthen John's argument, not weaken it. This is not specific to Go, but any "easy concurrency" language where people dash off threads without thinking carefully.
@madlep
@madlep 3 місяці тому
If Go had avoided accessing shared state from a different go routine, and forced all coordination via channels it would have gone a long way towards concurrent safety. As it is, you can do whatever thread-unsafe access to any data at anytime from anywhere, and you’re back in the same mess of having to hope mutexes and things are being used correctly (spoiler - they’re not being used correctly)
@krumbergify
@krumbergify 3 місяці тому
@@jasonstewart_kyYes, you can cause data races in Go, but the race detector is fast and easy to use in both unit tests and in e2e application tests. I do find races in my own code once in a while, but they are rare.
Rob Pike: What Golang Got Right & Wrong
29:23
ThePrimeTime
Переглядів 109 тис.
Concurrency is not Parallelism by Rob Pike
31:22
gnbitcom
Переглядів 115 тис.
dotGo 2015 - Rob Pike - Simplicity is Complicated
23:12
dotconferences
Переглядів 150 тис.
Ken Thompson interviewed by Brian Kernighan at VCF East 2019
1:03:51
Vintage Computer Federation
Переглядів 314 тис.
Golang's Mocking Techniques - Kyle Yost | hatchpad Huddle
41:20
hatchpad
Переглядів 34 тис.
Beginners Should Think Differently When Writing Golang
11:35
Anthony GG
Переглядів 83 тис.
Why Some Designs Are Impossible to Improve: Quintessence
33:03
Design Theory
Переглядів 64 тис.
The Go Programming Language and Environment
41:54
UNSW Computing
Переглядів 20 тис.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Переглядів 872 тис.
NodeJS 22 Just Dropped, Here's Why I'm Hyped
14:31
Theo - t3․gg
Переглядів 27 тис.
Comparing 10 programming languages. I built the same app in all of them.
21:33
Go Testing By Example (GopherCon Australia 2023)
38:45
Russ Cox
Переглядів 11 тис.
NOTHING PHONE 2A - НЕОБЫЧЕН ВО ВСЕМ!
30:39
DimaViper
Переглядів 52 тис.
Cách sửa này được không các bạn?
1:00
Cơ Khí Toàn Nghĩa
Переглядів 802 тис.
Iphone yoki samsung
0:13
rishton_vines😇
Переглядів 9 млн