---
title: "A compile-time function evaluation experiment"
publication: "Go Weekly"
issue: 525
published_at: "2024-10-01"
canonical_url: "https://golangweekly.com/issues/525"
---

Plus Go's great garbage collection guide, a dependency visualizer, and a Go-powered hex editor. |        

#​525 — October 1, 2024 

[Unsub](https://golangweekly.com/leave/*|UID|*)|[Web Version](https://golangweekly.com/issues/525)  

Together with [![WarpStream\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,e_trim,w_480,h_100/e_make_transparent/co_white,e_outline:7/lgfmvw76y3fcgqb6ayfo.png)](https://www.warpstream.com/learn-more?utm_source=golang_weekly&utm_medium=email&utm_campaign=october_1_2024_primary_golang_weekly)   

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/ddqhwfrp2yqdesudtvvs.jpg)](https://github.com/pijng/prep)  

[Prep: Compile-Time Function Evaluation for Go](https://github.com/pijng/prep) — _“By using `prep.Comptime`, you can evaluate functions at build time, replacing them with their computed results. Just like `comptime` from Zig. Except it’s not.”_ It admits it’s _“pure blasphemy”_, but you can’t deny it’s an _interesting_ idea, though it has limitations and [`toolexec` was not intended](https://github.com/golang/go/issues/35204#issuecomment-547168404) to support arbtirary source rewriting. 

Mark / pijng   

[Some Go Web Dev Notes](https://jvns.ca/blog/2024/09/27/some-go-web-dev-notes/) — We’re always fans of Julia’s earnest and helpful but no-nonsense posts and this quick grab bag of thoughts, tips and observations is another good one. She always opens our eyes to something new. 

Julia Evans   [![\](https://copm.s3.amazonaws.com/7d5b2fcc.png)](https://www.warpstream.com/learn-more?utm_source=golang_weekly&utm_medium=email&utm_campaign=october_1_2024_primary_golang_weekly) 

[Reduce Your Data Streaming and Kafka Costs by 80+%](https://www.warpstream.com/learn-more?utm_source=golang_weekly&utm_medium=email&utm_campaign=october_1_2024_primary_golang_weekly) — Learn how WarpStream's zero disk, stateless architecture and BYOC model not only reduce Kafka costs by 80% or more, but makes data streaming easier and more secure. Sign up for a free WarpStream account and get $400 in credits that never expire. 

WarpStream sponsor   

📉 [A Guide to the Go Garbage Collector](https://tip.golang.org/doc/gc-guide) — Not a new page – it dates back to Go 1.19 – but one I’d somehow not encountered before and acts as a living document explaining how Go’s garbage collection system works, complete with helpful interactive diagrams. 

Go Documentation   

[Joining Errors in Go](https://tpaschalis.me/golang-multierr/) — A helpful look at two approaches: using multiple `%w`s, and `errors.Join` (as introduced in Go 1.20). 

Paschalis Tsilias   

[Distributed Metrics in PHP with Go and Gob](https://tqdev.com/2024-distributed-metrics-in-php-using-go-and-gob) — [Gob](https://go.dev/blog/gob) is a Go package for efficiently encoding and decoding values between Go apps. 

Maurits van der Schee   

📄 [Writing Raw SQL Easier with pgx and sqlc in Go](https://remvn.dev/posts/writing-raw-sql-easier-with-pgx-and-sqlc-in-go/) remvn 

📄 [6 Tips for Using Strings in Go](https://www.calhoun.io/6-tips-for-using-strings-in-go/) – Certainly a golden oldie. Jon Calhoun 

📄 [Using a Separate Go Module for Your `tools.go`](https://www.jvt.me/posts/2024/09/30/go-tools-module/) Jamie Tanna 

📄 [Interfaces in Go](https://www.bytesizego.com/blog/golang-interfaces) – A simple primer/reminder. Matt Boyle  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/x6kjg56rdv8nx5gquysh.jpg)](https://github.com/bayraktugrul/modview)  

[Modview: Go Project Dependency Graph Visualizer](https://github.com/bayraktugrul/modview) — A simple way to visualize dependencies in Go projects in a clean, graphical way. 

Tuğrul Bayrak   

[htmgo: Build Simple, Scalable Systems with Go and htmx](https://htmgo.dev/) — It’s a brand new ‘alpha’ project, but provides an interesting way to combine the simplicity of both Go and [htmx](https://htmx.org/) to quickly build interactive webapps. 

maddalax      

📰 Classifieds   

❓Did you know you can [build Fine-Grained Authorization with Go and Open Source?](http://authzed.com/spicedb?utm_campaign=Golang%20Newsletter&utm_source=email&utm_medium=newsletter&utm_term=golang&utm_content=spicedb) SpiceDB is the most scalable, consistent permissions system inspired by Google Zanzibar. 

--- 

🪝 [Hookdeck:](https://hookdeck.com/discover/goweekly?ref=goweekly-525) A serverless queue to reliably send, receive, transform, filter, and route events across your event-driven apps.      

[Ebitengine v2.8.0: The Go 2D Game Engine](https://ebitengine.org/en/blog/v2.8.0.html) — Long one of our favorite Go ecosystem projects, Ebitengine takes another gentle step forward with support for 32 bit float format audio and shader customization improvements. 

Hajime Hoshi   

[gqlgen: A `go generate`-Based GraphQL Server Library](https://gqlgen.com/) — Check out the [getting started guide](https://gqlgen.com/getting-started/) for a feel for the project. [GitHub repo.](https://github.com/99designs/gqlgen) 

99designs   

[Gowitness: A Web Screenshot Utility using Chrome Headless](https://github.com/sensepost/gowitness) — A website screenshot utility written in Go, that uses Chrome Headless to generate screenshots of web interfaces using the command line. 

SensePost   

[Olric: Distributed Cache and Key/Value Store](https://github.com/buraksezer/olric) — It can be used both as an embedded Go library and as a language-independent service. 

Burak Sezer   

[anthropic-claude-golang-sdk: Go Library for Anthropic's Claude API](https://github.com/aitrailblazer/anthropic-claude-golang-sdk) — Send structured messages and handle responses from Anthropic’s conversational AI models within Go apps. 

AI Trailblazer   

- [Sloc Cloc and Code (scc) 3.4](https://github.com/boyter/scc) – Fast and accurate code counter with complexity calculations and COCOMO calculations.
- [dae 0.7.4](https://github.com/daeuniverse/dae) – High-perf transparent proxy based on eBPF.
- [Buf 1.43](https://github.com/bufbuild/buf) – CLI tool for working with Protocol Buffers.
- [Git Town 16.3](https://github.com/git-town/git-town/releases/tag/v16.3.0) – Git branch management tool.
- [GoBGP 3.30](https://github.com/osrg/gobgp) – BGP implementation in Go.  

🎁 And one extra for fun.. 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/oixalrheq0jhfxgjiakq.jpg)](https://github.com/itchyny/bed)  

[bed: A Binary/Hex Editor Written in Go](https://github.com/itchyny/bed) — A Go-powered binary editor with a Vim-like user interface that runs in terminals, is portable, fast and has a window splitting feature. 

Itchyny         

Curated by Peter Cooper and [Glenn Goodrich](https://twitter.com/ruprict). 

[Change your email](https://golangweekly.com/edit_subscription/*|UID|*)
[Stop getting this newsletter](https://golangweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
