@preslavrachev@mastodon.social avatar

preslavrachev

@preslavrachev@mastodon.social

I co-created https://mastodon.social/@murmel_social and https://mastodon.social/@feedle, because I believe in building tools that foster discourse on the open web.

Knowledge management is my second name. I am a software developer, turned entrepreneur, educator, and writer. Between #java (#quarkus) and #golang

This profile is from a federated server and may be incomplete. Browse more on the original instance.

vikkio, to rust

coding in vs coding in

preslavrachev,
@preslavrachev@mastodon.social avatar

@vikkio After what seems like the 20th time trying to do something meaningful in Rust, I go back to Go where I can just build my products and test them on the market before I grow a white beard.

I understand that Rust has serious advantages, and that Go is a sort of compromise, but it's that compromise I like about it - it lets me be productive without being (too) slow or (too) unsafe.

arne, to random
@arne@spezi.social avatar

📬 Arne's Weekly #104 is out, go check your inbox or read it online at https://arne.me/weekly/104

preslavrachev,
@preslavrachev@mastodon.social avatar

@arne Hope you’ve recovered. I was also sick on and off for what seems like the last two weeks. No COVID, but an equally heavy cold/flu. Immune system is down at the bottom rn

preslavrachev, (edited ) to programming
@preslavrachev@mastodon.social avatar

Raise a hand if you knew that fmt.PrintXXX (and log.PrintXXX) would cause any variable you pass as an argument (even a primitive one) to be allocated on the heap. 🙋‍♂️

preslavrachev,
@preslavrachev@mastodon.social avatar

@stv0g You can use the standard gcflags options during the building of your app:

go build -gcflags "-m" main.go  
preslavrachev,
@preslavrachev@mastodon.social avatar

@Merovius That’s very true. I just find it a little funny that this isn’t mentioned more often, given how much gets talked about avoiding heap allocation in Go. At the end , the only one who really knows what goes allocated where, is the Go compiler.

preslavrachev,
@preslavrachev@mastodon.social avatar

@vikkio yep, that’s me ;)

preslavrachev, to random
@preslavrachev@mastodon.social avatar

Let me show you something. If you use @ivory, you can make this filter I call “Bare Toots” - toots without any media, links, hashtags, or mentions. Just people’s real thoughts and feelings. It’s pretty nice, actually. I use it as my default timeline view.

preslavrachev,
@preslavrachev@mastodon.social avatar

@ivory the one things I still haven’t found out how to filter, are messages that are a part of a thread, i.e. when people reply to themselves. Apparently, Ivory doesn’t treat those as replies.

preslavrachev, (edited ) to programming
@preslavrachev@mastodon.social avatar

There are two types of Go developers: those who … and those who …

Which one are you?

#golang #programming #FediPoll

preslavrachev,
@preslavrachev@mastodon.social avatar

@shuLhan which is precisely what the garbage collector was created for - cleaning the heap memory. Tha stack sort of “cleans itself” once a function is no longer in scope - another one will reuse its part of stack memory.

preslavrachev,
@preslavrachev@mastodon.social avatar

@benjamineskola there is always a trade-off.

If you look at languages that hide the pointer semantic (Java, C#), you’ll see that they end blowing up the heap, simply because they put everything there by default. Python made a good choice with reference counting, but that ends up requiring a GIL (among other reasons), which is why concurrency there sucks. Rust kind of has the best of all worlds, but at the cost of compiler slowdowns and code reading comprehension.

It’s a really tough call.

preslavrachev,
@preslavrachev@mastodon.social avatar

@Crocmagnon do you care about consistency in your code? Do you decide which semantic to use on a case-by-case basis?

preslavrachev,
@preslavrachev@mastodon.social avatar

@klausman I was in that camp too, until I realized that over time, most structs tend to become big enough to either:

  • hold explicit pointer attributes
  • hold implicit ones (slices, maps, chans, funcs)

In either of those, copying the struct value would still carry those shared references around. How about an ugly suprise, if a part of your code touches on a map attribute, and all of a sudden, all copies end up having the new value?

preslavrachev,
@preslavrachev@mastodon.social avatar

@klausman An example of what I mean: https://go.dev/play/p/ruVt90VcCuM

preslavrachev,
@preslavrachev@mastodon.social avatar

@klausman Yeah, that's true as well. Unless you have something that's shared across your entire app (like an entity of some sort, or a shared service / db instance) you should be ok. I actually wrote about that a while ago: https://preslav.me/2023/02/06/golang-do-we-need-struct-pointers-everywhere/

preslavrachev,
@preslavrachev@mastodon.social avatar

@klausman True, Go shares Pythons’s “we are all grown-ups” mentality, when it comes to data access. If something was obviously not meant for mutation but you do it anyway, it’s your fault for you didn’t read the docs :)

preslavrachev,
@preslavrachev@mastodon.social avatar

@bmarinov @Crocmagnon both of you have valid points. I am glad that there are other people out there who don't care about stack-heap prematurely.

Just wanted to point out that there is a third category of pointer usage, which has its place: what I call "long-living service objects": https://preslav.me/2023/02/06/golang-do-we-need-struct-pointers-everywhere/#why-use-struct-pointer-types-then Think of a DB connection or a 3rd-part API client. You generally want one single instance of each across the entire app, even though you won't ever mutate it. Thus, the pointer usage.

spinscale, to random

Can someone explain the strategy of sending a message in a slack thread telling others to cross post this in another slack channel to me? Couldn't you have done it yourself? There is no time or work saved this way, or am I missing something?

preslavrachev,
@preslavrachev@mastodon.social avatar

@spinscale permissions/ lack of access to channel? Idk

preslavrachev, to random
@preslavrachev@mastodon.social avatar

But has he actually LIVED life? What’s the fun in collecting for collecting’s sake, if you don’t get to enjoy the small joys?

preslavrachev, to ai
@preslavrachev@mastodon.social avatar

“OpenAI says it could ‘cease operating’ in the EU if it can’t comply with future regulation / The EU is finalizing new AI regulations, but OpenAI CEO Sam Altman says he has ‘many concerns’ about the law. The EU AI Act would require the company to disclose details of its training methods and data sources.” https://www.theverge.com/2023/5/25/23737116/openai-ai-regulation-eu-ai-act-cease-operating

I propose that they then drop Open from the name. OpenAI is to open source and transparency, as McDonald’s is to healthy food.

#AI #OpenAI #Europe #EU

preslavrachev, to fediverse
@preslavrachev@mastodon.social avatar

Wrote down a few of my thoughts about bringing @murmel_social to @Mastodon and the #fediverse and why I think it’s going to be something that both casual and avid #mastodon users may find useful enough to pay for: https://preslav.me/2023/05/24/bringing-murmel-to-the-fediverse/

preslavrachev, to random
@preslavrachev@mastodon.social avatar

"Already the early days of blogging are being forgotten, and the ability of the web to quietly erase history as sites fail and go offline means that those incredible, exciting, experimental days are being lost. But we shouldn’t forget those who forged the future of digital media, and Heather Armstrong was one of them. Let’s remember that — and her."

https://onemanandhisblog.com/2023/05/rip-dooce by @adders, found via @feedle #blogging #dooce

golab, to random Italian

🗒️ It's time to start planning your Go conference experience! 🤩
🐦 Early bird tickets for #GoLab are now available.
Register now and secure your spot!
👉 https://golab.io/tickets

#GoLab2023 #GoLang

preslavrachev,
@preslavrachev@mastodon.social avatar

@golab I’ve been wanting to ask - do you guys cover any of the costs for selected speakers, e.g. ticket price, accommodation, etc?

preslavrachev,
@preslavrachev@mastodon.social avatar

@golab Great! Just submitted my proposal idea. Hope you like it 🤞

preslavrachev, to programming
@preslavrachev@mastodon.social avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • ngwrru68w68
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • Durango
  • ethstaker
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • DreamBathrooms
  • Leos
  • osvaldo12
  • tacticalgear
  • cubers
  • cisconetworking
  • anitta
  • provamag3
  • modclub
  • mdbf
  • GTA5RPClips
  • tester
  • megavids
  • normalnudes
  • lostlight
  • All magazines