oleg_log
oof, 2022-03-03 is calling 😢 I'm always curious why someone is using outdated Go? I mean, I understand it's hard to migrate DB because of data but from my exp Go update is mostly bumping 1 line in CI config. Yeah, there were rough edges but mostly everything…
also, DRAFT Go 1.26 release notes
> The Green Tea garbage collector, previously available as an experiment in Go 1.25, is now enabled by default after incorporating feedback.
> The baseline runtime overhead of cgo calls has been reduced by ~30%.
> The compiler can now allocate the backing store for slices on the stack in more situations, which improves performance
sexy
https://tip.golang.org/doc/go1.26
> The Green Tea garbage collector, previously available as an experiment in Go 1.25, is now enabled by default after incorporating feedback.
> The baseline runtime overhead of cgo calls has been reduced by ~30%.
> The compiler can now allocate the backing store for slices on the stack in more situations, which improves performance
sexy
https://tip.golang.org/doc/go1.26
tip.golang.org
Go 1.26 Release Notes - The Go Programming Language
Go gamedev moment. Iskander has released his long-awaited game NebuLeet!
Upvote pls https://www.reddit.com/r/indiegames/comments/1pe7tyf/nebuleet_released_a_tactical_rpg_with_ingame_unit/
Steam https://store.steampowered.com/app/3024370/NebuLeet
Carefully crafted Go packages for gamedev in Go (mostly for Ebiten):
github.com/ebitenui/ebitenui
github.com/hajimehoshi/ebiten/v2
github.com/quasilyte/bitsweetfont
github.com/quasilyte/ebitengine-graphics
github.com/quasilyte/ebitengine-input
github.com/quasilyte/ebitengine-resource
github.com/quasilyte/ebitengine-sound
github.com/quasilyte/gdata/v2
github.com/quasilyte/genum
github.com/quasilyte/glang
github.com/quasilyte/gmath
github.com/quasilyte/gscene
github.com/quasilyte/gsignal
github.com/quasilyte/xm
Upvote pls https://www.reddit.com/r/indiegames/comments/1pe7tyf/nebuleet_released_a_tactical_rpg_with_ingame_unit/
Steam https://store.steampowered.com/app/3024370/NebuLeet
Carefully crafted Go packages for gamedev in Go (mostly for Ebiten):
github.com/ebitenui/ebitenui
github.com/hajimehoshi/ebiten/v2
github.com/quasilyte/bitsweetfont
github.com/quasilyte/ebitengine-graphics
github.com/quasilyte/ebitengine-input
github.com/quasilyte/ebitengine-resource
github.com/quasilyte/ebitengine-sound
github.com/quasilyte/gdata/v2
github.com/quasilyte/genum
github.com/quasilyte/glang
github.com/quasilyte/gmath
github.com/quasilyte/gscene
github.com/quasilyte/gsignal
github.com/quasilyte/xm
Reddit
From the indiegames community on Reddit: NebuLeet released: a tactical RPG with in-game unit programming
Explore this post and more from the indiegames community
Damn, VSCode becomes more and more overwhelmed with features.
Now the new auto-suggestions in the terminal. Afair there is no AI in termainal yet.
Time to move to VSCodium?
Now the new auto-suggestions in the terminal. Afair there is no AI in termainal yet.
Time to move to VSCodium?
Any jj (jujutsu, new git, kinda) fans here? Do you really enjoy switching to the alternative?
Curious to hear any team/company improvements (if any lol)
Curious to hear any team/company improvements (if any lol)
> Gin is a very bad software library
And you know what? This is true. Like a bunch of other stuff.
https://eblog.fly.dev/ginbad.html
And you know what? This is true. Like a bunch of other stuff.
https://eblog.fly.dev/ginbad.html
I might be wrong, but doing an incident review a month later feels way too late.
Sure, you note everything during the incident, so it’s all documented (lol) but c’mon.
You lose the context, you miss the ideas. It’s like looking at a picture full of dots with no lines connecting them.
I just don’t get it. It’s like performing an autopsy after the burial way too late, goddammit.
Sure, you note everything during the incident, so it’s all documented (lol) but c’mon.
You lose the context, you miss the ideas. It’s like looking at a picture full of dots with no lines connecting them.
I just don’t get it. It’s like performing an autopsy after the burial way too late, goddammit.
I think I can confidently say that the following pattern is wrong in all cases. B ut it works… until it doesn’t.
Not convinced? Let's rewrite with
Even if this still doesn't convince you, this issue is documented in
https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/waitgroup
The problem is that
The runtime may schedule the goroutine later, so the counter might not be incremented yet.
Voila, now you've to debug why you missing data that was consumed but not processed!
And the fix is quite simple: any goroutine management should happen before the goroutine start:
{
...
for {
go process(...)
}
// some logic around atomicCounter waiting for a zero
}
func process(...) {
atomicCounter.Add(1)
defer atomicCounter.Add(-1)
}
Not convinced? Let's rewrite with
sync.WaitGroup:{
...
for {
go process(...)
}
// some logic around sync.WaitGroup.Wait()
}
func process(...) {
wg.Add(1)
defer wg.Done()
}
Even if this still doesn't convince you, this issue is documented in
go vet:https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/waitgroup
The problem is that
atomicCounter is updated inside a goroutine that happens instantly but there is no real guarantee that this will happen instantly.The runtime may schedule the goroutine later, so the counter might not be incremented yet.
Voila, now you've to debug why you missing data that was consumed but not processed!
And the fix is quite simple: any goroutine management should happen before the goroutine start:
{
...
for {
wg.Add(1)
go process(...)
}
// some logic around sync.WaitGroup.Wait()
}
func process(...) {
defer wg.Done()
}pkg.go.dev
waitgroup package - golang.org/x/tools/go/analysis/passes/waitgroup - Go Packages
Package waitgroup defines an Analyzer that detects simple misuses of sync.WaitGroup.
I made smth (tbh, I just open-sourced 1 internal pkg), 3 funcs but used dozens of times across the codebase.
https://github.com/cristalhq/ordx
Fuzz and race tests are always welcome.
https://github.com/cristalhq/ordx
cmp := ordx.RankCmp([]string{"low", "medium", "high"})
fmt.Println(cmp("low", "high"))
fmt.Println(cmp("high", "low"))
fmt.Println(cmp("medium", "medium"))
// Output:
// -1
// 1
// 0
Fuzz and race tests are always welcome.
GitHub
GitHub - cristalhq/ordx: Comparison helpers in Go
Comparison helpers in Go. Contribute to cristalhq/ordx development by creating an account on GitHub.
Any good
(links to blogs are also appreciated)
cloud-init configs for a small server for pet projects? Thanks in advance.(links to blogs are also appreciated)
oleg_log
I freaking love Google's open source. Just a pure engineering beauty, ass always. project $ scc . ─────────────────────── Language Code ─────────────────────── Go 46_539 Not great, not terrible. Go.mod/sum is also small as possible:…
Took more time to polish than I expected but at least binary went from 36Mb to 16Mb, yay.
https://github.com/cristalhq/fcm
(there are few things to add but nothing critical)
https://github.com/cristalhq/fcm
(there are few things to add but nothing critical)
GitHub
GitHub - cristalhq/fcm: Firebase Cloud Messaging client in Go
Firebase Cloud Messaging client in Go. Contribute to cristalhq/fcm development by creating an account on GitHub.
∏ρ؃uñçτØρ Øπτµç∑ | 👁🗨››››
Photo
Telegram
oleg_log
Если скучно, почитайте историю сооснователя Cloudflare. Талантливый был человек.
the resident genius, the guy who could focus for hours, code pouring from his fingertips while death metal blasted in his headphones. He was the master architect whose vision…
the resident genius, the guy who could focus for hours, code pouring from his fingertips while death metal blasted in his headphones. He was the master architect whose vision…
Good one. Have literally the same feedback. Cool tech but mostly useless.
https://johnjames.blog/posts/graphql-the-enterprise-honeymoon-is-over
https://johnjames.blog/posts/graphql-the-enterprise-honeymoon-is-over
johnjames.blog
GraphQL: the enterprise honeymoon is over
A production-tested take on GraphQL in enterprise systems, why the honeymoon phase fades, and when its complexity outweighs the benefits.