Phuong Le

1K posts

Phuong Le banner
Phuong Le

Phuong Le

@func25

Software Engineer @VictoriaMetrics, building VictoriaLogs

Katılım Ağustos 2014
122 Takip Edilen8.2K Takipçiler
Phuong Le
Phuong Le@func25·
Enums are good. I wish Go supported "real" enums. But union types are not, at least IMO. At the very least, I do not want union types in a TypeScript-ish form: func F(x int | string | []byte | io.Reader) { ... } This function accepts many unrelated shapes of input. Inside the function, you must figure out which one you got. It's never good to be too convenient. It loosens the language in a way that makes APIs harder to reason about. If Go somehow were to add union types, a more Go-ish version would be: type ParseResult[T] union { Ok(T) Err(error) } type Shape union { Circle(radius float64) Rect(width, height float64) } That is closer to an enum with payloads, or a sum type or tagged union or Rust-style enums. It keeps the set of cases closed and explicit. Go does not need "any value can be A or B or C" union types. Go would benefit from "this domain value has one of these known variants" sum types. You cannot pass values like in TypeScript: f(123) f("hello") You need to pass explicit variants instead, assuming Input is a tagged union: f(Input.Number(123)) f(Input.Text("hello")) More verbose but safer and stricter. See more at github.com/golang/go/issu… github.com/golang/go/issu…
Sean Roberts@sean_j_roberts

hot take: Go would be the greatest programming language on earth if it had enums and union types. they simplified their way into having to do really weird stuff just to represent reality. you should still probably use it though.

English
8
5
108
17K
Phuong Le retweetledi
Roman Khavronenko
Roman Khavronenko@hagen1778·
"We weren't gambling on a new technology — we were promoting one we'd already been operating in production against our own workload, and that consistently outperformed Loki in our side-by-side testing on the kinds of queries we and our users actually run."
Zerops@zeropsio

The dedicated logger service inside every Zerops project is now using VictoriaLogs. - 100x more log retention - 3x faster queries - VictoriaLogs UI embedded into Zerops - Already rolled out to every existing project Full story below.

English
0
1
7
1K
Phuong Le retweetledi
Cuong Le
Cuong Le@cuongleqq·
Something is seriously wrong with how people contribute to open source these days. People submit AI-generated code they clearly don't understand. When reviewers comment, they feed it back to the AI and submit again. The loop never ends. Low-effort PR requires extremely high effort to review. That math is never fair. You think this is how you build a reputation in open source? No, no, and no. You're just burning out maintainers. --- Use AI to understand the codebase instead. Ask it to explain things. Build your own judgment. It's ok to use AI as a tool for coding, but make sure you filter out any AI slop before submitting. You gain the skills. You gain the reputation. The project actually benefits. Is it that hard?
English
3
2
15
1.2K
Phuong Le
Phuong Le@func25·
Code is becoming cheaper than ever, but maintainability is becoming more expensive than ever.
English
6
9
117
4.9K
Phuong Le
Phuong Le@func25·
@HSVSphere @JustDeezGuy Because you don't need that level of concurrency abstraction most of the time. context, waitgroup, errgroup, clear ownership patterns cover many common cases well
English
1
0
10
346
HSVSphere
HSVSphere@HSVSphere·
@func25 @JustDeezGuy Sure. Why waste engineering time trying to (and eventually failing to) get cancellation and other primitives working? Languages can do this for you so you can focus on real issues
English
1
0
6
381
Phuong Le
Phuong Le@func25·
@raghavan_srini Agreed, though most backend systems people build aren't mission-critical at that level. Go ofc can, it just shifts responsibility to developers or to higher-level tooling
English
0
1
8
1.9K
Phuong Le
Phuong Le@func25·
Go is not bad at concurrency. A more factual take is Go is excellent at making concurrency cheap, explicit, and approachable (and approachable, and approachable), especially for common backend patterns. But Go gives you relatively low-level primitives, a lot of correctness around cancellation, task lifetimes, cleanup, error propagation, and backpressure is left to us, the programmer. So the fair comparison is not "Go vs JVM, who wins?" It is: Go optimizes for simple pragmatic concurrency, the modern JVM ecosystem has stronger tools for structured and resource-safe concurrency. Which one is better depends on how complex the concurrency problem is. This is just a "depends on the problem" discussion.
James Ward@JamesWard

Generally developers think of Go as being great for concurrency. Its not. JVM approaches are vastly superior. And even some of the best in the whole industry when you include virtual threads, structured concurrency & Effects.

English
11
42
544
76.2K
Phuong Le
Phuong Le@func25·
@turbofish_pk I'm waiting right along with you :) It's currently going through an audit but I'm expecting it to be out sometime this month
English
1
0
10
2.4K
turbofish
turbofish@turbofish_pk·
@func25 I was looking forward to reading your take. When approximately will the completed version of "Anatomy of Go" be made available to us who bought the earlier version?
English
1
0
5
3K
RAHUL YADAV
RAHUL YADAV@rahulyadavsep92·
@func25 @sanskarpan Thanks @func25 for a very insightful book. Can you also give us timeline of when we can expect this? It's been a month since I am waiting for final chapter in my account.
English
1
0
1
40
Phuong Le
Phuong Le@func25·
Go is simple, so I ended up writing an 865-page book about how it works internally, just to see how it maintains that simplicity 😇
Phuong Le tweet media
English
49
164
2.2K
91K
RAHUL YADAV
RAHUL YADAV@rahulyadavsep92·
@func25 @sanskarpan Adding to my previous post, last chapter I can see in my account email: rahulyadavsep92@gmail.com is "Chapter 5 Garbage Collection"
English
1
0
1
48
Phuong Le
Phuong Le@func25·
@nowgoo I will try to push it in a couple of weeks
English
0
0
0
12
Nowgoo
Nowgoo@nowgoo·
@func25 just purchased. but chapter 8 is still not available on bytesizego download page.
English
1
0
1
24
Phuong Le
Phuong Le@func25·
Chapter 8 of The Anatomy of Go is ready for review. It goes into concurrency, the Go scheduler, threads, the system monitor thread, goroutine preemption, what happens at startup, how channels work, how the select statement works, and how timers work behind the scenes, a lot and a lot, with visual explanations. This is the final chapter, it is near the end of the journey.
Phuong Le tweet media
English
7
27
449
15.9K
Phuong Le retweetledi
Georgios Konstantopoulos
Who's the biggest Victoria-stack bull in my feed that wants to say why they love it? I'm yolo porting from Prom/Loki etc in a project because I saw some nice numbers in the past and want to try it out but want to hear some people that are excited by it geuinely
English
6
1
19
7K
Karan Sharma
Karan Sharma@mrkaran_·
Yes, in fact that’s the direction I'm working towards. I’m actively refactoring Logchef to support multiple backends, and I’m currently experimenting with VictoriaLogs (from @VictoriaMetrics) as one of them. DuckDB/Parquet is also something I want to support, especially for small deployments, local-first setups, and single-node use cases. I wouldn’t promise a timeline yet, but it’s definitely on the roadmap as part of making Logchef - so you get auth/rbac/alerts etc out of box!
English
2
0
3
95
stuckinforloop
stuckinforloop@stuckinforloop·
@func25 fam I bought it but not able to access it. I’ve DMed you the details
English
2
0
1
477
Sri
Sri@Srishailam_D·
@func25 I bought this earlier. Will I have access to the latest copy or do I need to purchase again?
English
1
0
1
797
Elliot Anderson
Elliot Anderson@0xELL10T·
@func25 @sanskarpan I love how you go into detail on the assembly generated by different functions Also there’s a small typo/error on page 82 where you just swapped which side is the go assembly and which is the go code
English
1
0
1
327
DevDiary
DevDiary@devdiary0x·
@func25 Sigh, I dont even use Go but I bookmarked it anyways because writing an 800+ page book diving into the internals of a language requires dedication and sheer fucking will
English
1
1
27
4.5K
Phuong Le
Phuong Le@func25·
@skrik222 No, I have AI fix the dirty grammar as I'm a non-native English speaker, the explanation is 100% mine
English
2
0
26
2.3K
k2
k2@skrik222·
@func25 865-pages 100% human?
English
1
0
2
2.6K