Golang

2434 readers
9 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 2 years ago
MODERATORS
126
127
 
 

Rust vs Go in 2023

Which is better, Rust or Go? Go or Rust? Which language should you choose for your next project in 2023, and why? How do the two compare in areas like performance, simplicity, safety, features, scale, and concurrency? What do they have in common, and where do they fundamentally differ? Let’s find out, in this friendly and even-handed comparison of Rust and Golang.

128
 
 

Is Go 1.21 already on your upgrade list? It should be!

In the tradition of Go, release 1.21 does not deliver loads of new language features but many improvements to the toolchain and the ecosystem.

129
 
 

Waiting for go1.21: Execution Tracing with < 1% Overhead

Learn about the upcoming go1.21 performance improvements that reduce the overhead of execution tracing from up to 20% to less than 1% for most applications.

130
131
 
 

Understanding Go 1.21 generics type inference

Breaking down the release notes, with concrete explanations and annotated examples

132
133
 
 

Definitely had some trouble parsing and understanding the meanings of the improvement list, though.

134
 
 

Iterators in Go

This article describes a proposed extension to the Go language: range over func. The proposal is evolving, and this tutorial is a work in progress, so don’t forget to check back later for the latest developments.

135
136
137
 
 

Now this right here, is one sexy looking shell! 😍 :bash:

That feeling you get when you're API server spins up and only logs the good messages to STDOUT...it makes me feel all warm and fuzzy 🙃

Oh, and I totally went with #golang for my server... @golang is one of my true loves, what can I say?! I'd be remiss to not say that @NixOS is moving on up my list too 😉 🤘 #server #programming #nixos

138
139
 
 

Hello Lemmy,

InvidTUI is a cross platform Invidious client, which can:

  • Browse, play and download YouTube audio and video
  • Create, save and open m3u8 playlists
  • Interactively switch between instances
  • Change video and album art resolutions
  • View and manage user feed, playlists and subscriptions

Among many other features.

In addition to the above, it also has a menu system, so that users need not remember all the keybindings, and instead select the required option from the menu to perform the desired operation.

This release contains the following new features:

  • A HJSON based configuration format, where you can define custom keybindings as well
  • Faster JSON parsing, thanks to jsoniter
  • Create new folders and rename items within the filebrowser
  • Automatically or manually configure the download directory from within the application
  • Change thumbnail quality

I hope you enjoy this release, and any feedback is appreciated.

140
 
 

The Go programming language has released its first Release Candidate (RC) for version 1.21, which is packed with new features, improvements, and performance enhancements. This article provides an overview of the notable changes and features in Go 1.21, along with some exciting additions to the standard library.

  • PGO
  • min, max functions
  • preview of loop capture change
  • new slog, slices, and map packages
  • WASI port
141
 
 

Today we published gonew, an experimental tool for instantiating new projects in Go from predefined templates.

$ go install golang.org/x/tools/cmd/gonew@latest

142
143
 
 

A few years ago I wrote pygit, a small Python program that’s just enough of a Git client to create a repository, add some commits, and push itself to GitHub.

I wanted to compare what it would look like in Go, to see if it was reasonable to write small scripts in Go – quick ’n’ dirty code where performance isn’t a big deal, and stack traces are all you need for error handling.

The result is gogit, a 400-line Go program that can initialise a repository, commit, and push to GitHub. It’s written in ordinary Go … except for error handling, which is just too verbose in idiomatic Go to work well for scripting (more on that below).

144
145
146
147
148
 
 

Our current inlining policy remains built on a foundation that is becoming increasingly strained as we add things like PGO, is increasingly anchored in past backend limitations, and it continues to use an overly simplistic cost model driven by an overly simplistic scheduler. Between unified IR and the untapped possibilities of PGO, I believe there’s now a significant opportunity to improve the inlining policy, resulting in significant performance improvements for Go applications, and reducing the effort and expertise needed to write highly efficient Go code.

149
 
 

Go programmers have the good fortune of excellent testing and benchmarking tooling built into the standard library - in the testing package. However, benchmarking is hard. This isn't Go specific; it's just one of those things experienced developers learn over time.

This post lists some common benchmarking pitfalls Go programmers run into. It assumes basic familiarity with writing Go benchmarks; consult the testing package documentation if needed. While these pitfalls are presented in Go, they exist in any programming language or environment, so the lessons learned here are widely applicable.

150
view more: ‹ prev next ›