Go programming language discussion

1382 readers
1 users here now

founded 6 years ago
MODERATORS
26
15
Writing an OS in Go: The Bootloader (totallygamerjet.hashnode.dev)
submitted 2 years ago by whou@lemmy.ml to c/golang@lemmy.ml
 
 

How you could write an operating system with pure Go code (including no CGO!)

27
 
 

Also available via SSH:

ssh playnetris.com

Source code:

https://code.rocket9labs.com/tslocum/netris

28
29
12
submitted 2 years ago* (last edited 2 years ago) by whou@lemmy.ml to c/golang@lemmy.ml
30
31
6
submitted 2 years ago* (last edited 2 years ago) by sbinet@lemmy.ml to c/golang@lemmy.ml
 
 

Your weekly appointment with the latest news about accepted/declined proposals.

32
 
 

A major Go language change proposal was published earlier this week: add range over int, range over func, and there's a good chance this change will make it into a future Go release. In this post I will discuss the motivation for this proposal, how it's going to work, and provide some examples of how Go code using it would look.

33
3
Go 1.22 inlining overhaul (docs.google.com)
submitted 2 years ago* (last edited 2 years ago) by sbinet@lemmy.ml to c/golang@lemmy.ml
 
 

The Go compiler’s inliner has never been particularly good. It wasn’t until Go 1.12, released in 2019, that the Go compiler supported inlining more than leaf functions, and we’ve slowly chipped away at more limitations of the inliner over the years (it started inlining functions with for loops in early 2021!). Go 1.20, released in February 2023, added support for basic profile-guided inlining, the most significant change to Go’s inlining policy since 1.12.

[...]

The rest of this document lays out a set of considerations for a redesign of Go’s inlining policy.

https://docs.google.com/document/d/1a6p7-nbk5PVyM1S2tmccFrrIuGzCyzclstBtaciHxVw/edit

34
 
 

Hey all, I just wrote this up after migrating a metric ton of Go projects hosted on a Forgejo (Gitea) instance to a new domain by adding just a couple of lines to my Caddyfile. I thought the process would be much more involved, but the snippet I found and modified managed to handle everything without any tedious path rewriting or other vanity URL setup.

I hope it's helpful for someone else who needs to migrate to a new domain. I got an email from my registrar recently warning about a 60% price increase for .space TLDs. Careful readers may make a connection between this event and this blog post.

35
 
 

Your weekly appointment with the latest news about accepted/declined proposals.

Noteworthy accepted proposal:

36
 
 

I really like seeing people's interesting projects. Even if they are generic or were started just to learn something.

And on top of that, I consider Go to be one of those languages that you can find projects on a pretty diverse range of topics.

So, is there any interesting (or not too) personal Go projects that is in the making, or is already finished?

37
3
Coroutines for Go (research.swtch.com)
submitted 2 years ago by sbinet@lemmy.ml to c/golang@lemmy.ml
 
 

Why we need coroutines for Go, and what they might look like.

Another great post from Russ Cox, in his series on iterators and coroutines.

https://research.swtch.com/coro

38
2
Storing Data in Control Flow (research.swtch.com)
submitted 2 years ago* (last edited 2 years ago) by sbinet@lemmy.ml to c/golang@lemmy.ml
 
 

Write programs, not simulations of programs.

A great post from Russ Cox, setting the scene for his work on iterators and coroutines.

https://research.swtch.com/pcdata

39
40
 
 
41
 
 

tl;dr: Looking forward future Pinner.Pin performance improvements.

The upcoming Go version 1.21, scheduled for release next month, is currently available for download as Go 1.21rc2 in the "Unstable version" section here. Go 1.21 introduces a new runtime type, Pinner.

ccgo/v4, the next, also not yet released version of the C to Go transpiler, uses pinning to "freeze" addresses of local Go variables, addresses of which are passed around in the original C code. ccgo produces Go code where any C pointer points to memory not managed by the Go runtime. So ccgo simply puts such "escaping" variables in the memory not visible to the garbage collector, with stable, immovable addresses. Those are provided by the modernc.org/memory package. Otherwise a goroutine stack resizing can change the address of a local variable.

42
 
 

Your weekly appointment with the latest news about accepted/declined proposals.

43
 
 

A very simple-minded CommonMark to SPIP converter.

SPIP is a rather popular french CMS, with its own wiki-like syntax to author documents.

44
 
 

Your weekly appointment with the latest news about accepted/declined proposals.

45
 
 

Your weekly appointment with the latest news about accepted/declined proposals.

46
8
Golang generics (hackthedeveloper.com)
submitted 2 years ago by green_dot@le.fduck.net to c/golang@lemmy.ml
47
 
 

cross-posted from: https://infosec.pub/post/249829

Basicgopot is a basic honeypot I have been developing. It is an HTTP honeypot that logs and saves all file uploads, optionally checking the uploaded file against VirusTotal. Additionally, the user can easily extend the functionality of the honeypot by configuring API webhooks. I plan on adding more features and possibly broadening the project's scope to include deploying deceptions for other protocols.

I would appreciate any feedback and contributions are always welcome.

48
49
3
submitted 2 years ago* (last edited 2 years ago) by morgen to c/golang@lemmy.ml
 
 

This is a linter I wrote for Go that ensures all slice and array bound accesses are validated. Right now, it ensures that all accesses are enclosed within an if-statement that calls cap or len.

Any and all contributions and feature requests are welcome.

50
view more: ‹ prev next ›