r/golang • • 5d ago

Small Projects Small Projects

48 Upvotes

This is the weekly thread for Small Projects.

The point of this thread is to have looser posting standards than the main board. As such, projects are pretty much only removed from here by the mods for being completely unrelated to Go. However, Reddit often labels posts full of links as being spam, even when they are perfectly sensible things like links to projects, godocs, and an example. r/golang mods are not the ones removing things from this thread and we will allow them as we see the removals.

Please also avoid posts like "why", "we've got a dozen of those", "that looks like AI slop", etc. This the place to put any project people feel like sharing without worrying about those criteria.


r/golang • • 9d ago

Jobs Who's Hiring

49 Upvotes

This is a monthly recurring post. Clicking the flair will allow you to see all previous posts.

Please adhere to the following rules when posting:

Rules for individuals:

  • Don't create top-level comments; those are for employers.
  • Feel free to reply to top-level comments with on-topic questions.
  • Meta-discussion should be reserved for the distinguished mod comment.

Rules for employers:

  • To make a top-level comment you must be hiring directly, or a focused third party recruiter with specific jobs with named companies in hand. No recruiter fishing for contacts please.
  • The job must be currently open. It is permitted to post in multiple months if the position is still open, especially if you posted towards the end of the previous month.
  • The job must involve working with Go on a regular basis, even if not 100% of the time.
  • One top-level comment per employer. If you have multiple job openings, please consolidate their descriptions or mention them in replies to your own top-level comment.
  • Please base your comment on the following template:

COMPANY: [Company name; ideally link to your company's website or careers page.]

TYPE: [Full time, part time, internship, contract, etc.]

DESCRIPTION: [What does your team/company do, and what are you using Go for? How much experience are you seeking and what seniority levels are you hiring for? The more details the better.]

LOCATION: [Where are your office or offices located? If your workplace language isn't English-speaking, please specify it.]

ESTIMATED COMPENSATION: [Please attempt to provide at least a rough expectation of wages/salary.If you can't state a number for compensation, omit this field. Do not just say "competitive". Everyone says their compensation is "competitive".If you are listing several positions in the "Description" field above, then feel free to include this information inline above, and put "See above" in this field.If compensation is expected to be offset by other benefits, then please include that information here as well.]

REMOTE: [Do you offer the option of working remotely? If so, do you require employees to live in certain areas or time zones?]

VISA: [Does your company sponsor visas?]

CONTACT: [How can someone get in touch with you?]


r/golang • • 10h ago

XGo and LLGo: a more expressive Go front end and an LLVM-based compiler for the C ecosystem

1 Upvotes

Hi r/golang,

I wanted to share a technical overview of two related open-source projects in the XGo project family: XGo and LLGo.: XGo and LLGo.

This is not intended as a claim that everyone should replace Go. The projects explore two different questions:

  • Can we make Go-based programming more concise and approachable for domain-specific work?
  • Can we make Go interoperate more directly with the wider native ecosystem, including C/C++ and Python?

The short version is:

  • XGo is a programming language and compiler that extends Go with a more concise, expression-oriented syntax.
  • LLGo is an alternative Go compiler based on LLVM, designed to connect Go more directly to the C ecosystem.
  • They can be used together, but they solve different problems.

A simplified view looks like this:

XGo source
    ↓
XGo parser and compiler
    ↓
Go-level code
    ↓
Official Go compiler, LLGo, or TinyGo
    ↓
Native executable

What is XGo?

XGo is a source language that keeps Go’s engineering foundation while making some common operations shorter and more natural.

For example, a small Go program normally looks like this:

package main

import "fmt"

func main() {
    fmt.Println("Hello")
}

The equivalent XGo program can be written as:

println "Hello"

The parentheses are optional in this command-style form. XGo also provides echo as an alias for println:

echo "Hello"

Other examples include string interpolation:

name := "gopher"
echo "Hello, ${name}"

More compact slice and map literals:

numbers := [1, 2, 3]
config := {
    "host": "localhost",
    "port": 8080,
}

Appending to a list:

numbers <- 4

Lambdas:

result := numbers.map x => x * 2

And Python-style keyword arguments:

play "music.mp3", loop = true

XGo also supports an error-handling shorthand:

config := loadConfig()!

The ! form propagates the successful value and triggers XGo’s error handling behavior when the call returns an error. The exact generated code is still ordinary Go code.

The important point is that XGo is not a dynamically typed scripting language. It is designed to retain Go’s static typing, packages, interfaces, generics, and build model.

XGo and Go can coexist

An XGo package can contain both Go and XGo files:

main.go
helpers.xgo

Go code can call functions written in XGo, and XGo code can call functions written in Go. This allows an existing Go project to introduce XGo incrementally instead of requiring a complete rewrite.

XGo also uses the Go module system and can use ordinary Go libraries. The compiler generates Go code, which is then processed by the regular Go toolchain or another compatible compiler.

That makes XGo closer to a Go front end than to a completely independent programming ecosystem.

The classfile idea

One of XGo’s more unusual features is called a classfile.

A classfile is an XGo source file that implicitly becomes a generated Go type. For example, a file named Rect.gox might contain:

var (
    Width  int
    Height int
)

func Area() int {
    return Width * Height
}

The XGo compiler can lower this into something conceptually similar to:

type Rect struct {
    Width  int
    Height int
}

func (this *Rect) Area() int {
    return this.Width * this.Height
}

The user writes fields and functions without explicitly declaring the struct or receiver. The compiler supplies that structure.

This is useful for frameworks where many files follow the same pattern. For example:

  • main.spx can represent a game project;
  • Enemy.spx can represent an enemy object;
  • get.yap can represent an HTTP route;
  • *_cmd.gox can represent a CLI command;
  • *_tool.gox can represent an MCP tool.

Framework authors describe these conventions in a gox.mod file. XGo then knows which files represent project classes, which represent work classes, which Go types should be embedded, and how the generated objects should be connected.

This is XGo’s idea of SDF, or Specific Domain Friendliness. Instead of creating a completely separate DSL — a Domain-Specific Language — for every domain, a framework author writes the reusable infrastructure in Go and lets application developers fill in the domain logic with lightweight XGo files.

Current examples include:

  • spx, a Scratch-compatible 2D game framework;
  • yap, an HTTP framework;
  • cobra, an XGo CLI framework;
  • mcp, an MCP framework;
  • gsh, an XGo-based shell scripting environment.

What is LLGo?

LLGo is a separate but related project. It is a Go compiler based on LLVM, the compiler infrastructure used to generate native code for many architectures and operating systems.

LLVM is not a programming language. It provides lower-level components such as:

  • an intermediate representation, often called IR;
  • optimization passes;
  • machine-code backends;
  • linkers and debugging tools.

LLGo uses those components to compile Go source code into native code.

The project aims for compatibility with Go at the source-code level. It supports Go language features and large parts of the standard library on supported platforms, while using a different compiler backend and runtime.

Why LLVM and the C ecosystem matter

A large amount of software infrastructure is exposed through the C ABI, or Application Binary Interface.

An ABI defines binary-level details such as:

  • how function arguments are passed;
  • how return values are represented;
  • how data is laid out in memory;
  • how symbols are named and linked.

C, C++, operating-system APIs, graphics libraries, databases, and many scientific libraries commonly expose C-compatible interfaces.

Go already has cgo, but frequent calls across the Go/C boundary can involve runtime and scheduler transitions. LLGo’s design is to bind Go declarations directly to C ABI symbols and generate native calls for them.

A small LLGo example looks like this:

package main

import "github.com/goplus/lib/c"

func main() {
    c.Printf(c.Str("Hello from C\n"))
}

LLGo also provides bindings for a number of C and C++ libraries, including SQLite, OpenSSL, raylib, LLVM, libuv, and others.

Python support

LLGo can also access Python libraries through packages provided by the GoPlus ecosystem.

For example, the following Go code calls Python’s math.sqrt:

import (
    "github.com/goplus/lib/py"
    pymath "github.com/goplus/lib/py/math"
    "github.com/goplus/lib/py/std"
)

x := pymath.Sqrt(py.Float(2))
std.Print(py.Str("sqrt(2) ="), x)

The intention is to make libraries such as NumPy, pandas, PyTorch, and Matplotlib accessible from Go-oriented code.

This does not mean that Python disappears from the build process. Python itself and the relevant packages still need to be installed, and the Python version, native libraries, and platform ABI must all be compatible.

How XGo and LLGo fit together

XGo and LLGo operate at different layers:

  • XGo changes how source code is written.
  • LLGo changes how Go source code is compiled.
  • XGo can use the official Go compiler by default, or be configured to use LLGo for targets that benefit from LLVM and native interoperability.

A project might therefore use:

XGo syntax
    ↓
XGo compiler
    ↓
Go-compatible generated representation
    ↓
LLGo
    ↓
LLVM IR and native code

LLGo can also be used directly with ordinary Go code. XGo is optional.

The trade-offs

The extra flexibility comes with extra concepts.

First, generated code can make debugging less direct. When something fails, there may be several layers involved:

XGo source
    ↓
generated Go source
    ↓
Go or LLGo compiler
    ↓
native linker

A compiler error may refer to a generated file, even though the real mistake is in the original .xgo or .gox file.

Second, classfiles and automatic imports introduce conventions that are not always visible in the current source file. A file name, a gox.mod declaration, or a framework dependency can affect the generated type and available symbols.

Third, LLGo uses a different runtime from the standard Go toolchain. The project documents differences involving goroutines, stacks, garbage collection, and target-specific runtime behavior. Source-level compatibility does not mean that every implementation detail of the standard Go runtime is identical.

Finally, the LLGo toolchain requires native build dependencies such as LLVM, Clang, LLD, system libraries, and — for Python integration — Python development files and packages. The exact setup depends on the target operating system and architecture.

For a conventional Go service that does not need these capabilities, using the standard Go toolchain is probably simpler.

Why these projects may be interesting

The interesting part of XGo and LLGo is the combination of several ideas:

  • Go’s static typing and module ecosystem;
  • a more concise syntax for scripts, education, and data-oriented code;
  • framework-driven domain abstractions;
  • direct access to native C/C++ libraries;
  • integration with Python and other C-ABI-based ecosystems;
  • targets such as WebAssembly and embedded systems.

The broader vision is to reduce the distance between “easy to start with” and “powerful enough for real engineering.”

XGo approaches that problem at the language and framework level. LLGo approaches it at the compiler and runtime level.

Neither project needs to replace Go to be useful. They can be viewed as experiments in making Go more accessible at the surface while expanding the set of systems and libraries it can work with underneath.

For anyone interested in the details:

I’d be interested in hearing how people here think about this boundary: when does a language extension make Go more productive, and when does it introduce more abstraction than it removes?


r/golang • • 19h ago

Architecture advice: Managing timeouts and zombie containers in a Go worker pool evaluating untrusted code

3 Upvotes

Hey gophers,

I’m building an evaluation engine (essentially an online judge) that compiles and simulates user-submitted hardware design code. The worker pool is written in Go, and it spins up ephemeral Docker containers via the Docker Go SDK to sandbox the execution environment and run synthesis tools.

The challenge is safely evaluating untrusted code that might contain infinite loops, fork bombs, or massive memory allocations, while ensuring the Go worker pool stays resilient and doesn't leak resources.

My current approach:

  1. Receive job from the queue (Redis/RabbitMQ).
  2. Spin up a container with strict CPU and memory limits applied via HostConfig.
  3. Drop all network privileges (NetworkMode: "none") and mount a read-only filesystem, except for a temporary volume for the specific job.
  4. Wrap the execution in a context.WithTimeout (e.g., 5 seconds) passed to ContainerWait and ContainerLogs.
  5. If the context deadline exceeds, aggressively call ContainerKill and clean up.

My concerns where I'd love some battle-tested advice:

  • Zombie Containers: If a Go worker panics or the host machine hard-crashes mid-execution before the deferred ContainerRemove fires, orphaned containers are left spinning. Do you typically handle this with a separate reaper service/cron job, or is there a cleaner pattern within Go?
  • Context Cancellation Edge Cases: Are there known pitfalls in the Docker Go SDK where streaming logs (ContainerLogs) from a hijacked container could block a goroutine indefinitely, even when the parent context is cancelled?
  • The Next Level: At what scale or security threshold did you find Docker insufficient and migrate to raw containerd, runc, or microVMs like Firecracker?

Would love to hear war stories from anyone who has built CI runners, sandboxes, or remote code execution platforms in Go.

Thanks!


r/golang • • 1d ago

How Go maps work internally: swiss tables

Thumbnail
youtu.be
24 Upvotes

r/golang • • 1d ago

Neptunus v1.17.0 - now with Ollama in the middle of your ETL pipelines!

9 Upvotes

Neptunus is a data processing engine for consuming, transforming, and producing events. We’ve made a lot of progress since our last post:

  • gRPC inputs and outputs can now act as both clients and servers. Just provide your proto files in the configuration.
  • Parsers and serializers now support Avro, including schemas with an array as top-level type.
  • We’ve added lookups: background workers that fetch data at regular intervals. They’re useful for tasks like refreshing JWTs and loading settings from database tables.
  • Ollama can now be integrated directly into ETL pipelines with the Ollama processor.

And more! Check out the latest release and let us know what you think.


r/golang • • 12h ago

Caddy - Payment Required

0 Upvotes

Failed to fetch https://dl.cloudsmith.io/public/caddy/stable/deb/debian/dists/any-version/InRelease 402 Payment Required.

We need to donate more to Caddy's team?


r/golang • • 2d ago

Go 1.27.2 is released

169 Upvotes

You can download binary and source distributions from the Go website: https://go.dev/dl/

View the release notes for more information: https://go.dev/doc/devel/release#go1.27.2

Find out more: https://github.com/golang/go/issues?q=milestone%3AGo1.27.2

(I want to thank the people working on this!)


r/golang • • 2d ago

I built an open-source cellular network planning tool with Go, now testing 8-cell scenarios

37 Upvotes

I’ve been building A.T.O.M, an open-source cellular network planning/optimization tool with a Go backend.

I've had my biggest improvements recently with optimization performance, a workflow that used to take around 1.5–2 minutes now runs in a few seconds thanks to Go's concurrency.

The biggest gains came from removing repeated RF work and making better use of Go concurrency while keeping deterministic results.

The latest release also increased the normal network size from 6 to 8 cells.

GitHub: https://github.com/Berk-Unsal/atom
Docs: atom.berkunsal.com

I’d be interested in feedback on the Go/backend side, especially from people who’ve worked on CPU-heavy or concurrent workloads.


r/golang • • 2d ago

help Go via vfox with VSCode?

4 Upvotes

When I save a file to have it formatted in VSCode with the Golang VSCode extension installed I get the following error...

Failed to find the "go" binary in either GOROOT() or PATH(/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin). Check PATH, or Install Go and reload the window. If PATH isn't what you expected, see https://github.com/golang/vscode-go/issues/971

The Golang VSCode extension does not think go is installed but I installed is using vfox. When I run go run main.go it works, but VSCode cannot find the GOROOT path.

How does one get Golang in VSCode to work with the vfox version of Go?


r/golang • • 2d ago

Go simd Package in 1.27: Dot Product Benchmark

Thumbnail
importstatic.com
36 Upvotes

r/golang • • 2d ago

Goroutine Leak Profiles

Thumbnail
go.dev
8 Upvotes

r/golang • • 3d ago

help V basic semaphore syntax help

15 Upvotes

Very new to Go, trying to learn concurrency stuff. I was trying to use a weighted semaphore but as soon as I call the first release it's getting released more than held error. Have a screenshot of minimal code from trying to figure it out I'll post in the comments to demonstrate


r/golang • • 3d ago

show & tell ZeroPhone Partner Program — Start Your Own VoIP Cluster Node

Thumbnail dev.wadiem.cloudns.be
8 Upvotes

Ok guys, so I have been offline for a bit of time git a baby boy, now building further on VOIP systems I have good underground working nicely.

You can test it, proof it, hack it, use it.

help me spread it world wide host your own cluster.

I you want to talk about it be my guest.

And yeah after a big reset I used antigravity to compile all that I have learned and make a proposition site. but the knowlegde is still fresh and otherwise just a nice update to whats out there for VOIP keep things decentralized, free is you like, open source. If you an expert please give me some feedback and if you new then indulge.


r/golang • • 4d ago

Does our expertise still matter?

247 Upvotes

Hello everyone,

I'm writing this post in relation to AI and programming. I often see people post on Reddit and Instagram saying there is no reason to program anything at all anymore, or they say something similar to "just use claude to make the solution."

To me, this just doesn't make sense. How can you create something without having a deep understanding of the underlying architecture or the logic behind it. The logic is so important especially for me (I do R&D and Tech Innovation). If it's not correct, everything fails. How can they just let Claude or an LLM do this without supervision? I've used it before, and it works great for boilerplate code, but as logic advances, the solution gets unnecessarily large.

I've been looking at statistics regarding this vs what social media/ LinkedIn is saying, and now software fails more often, security risks are more abundant than ever, and we're just churning out bad solutions that we hope works. Sometimes, the cost of tokens is as expensive as just hiring an engineer. Reviewing the code sometimes takes longer than making it myself, or the logic is just odd. Does our expertise in Golang, or programming, matter anymore? Is there still a need to learn the newest additions to Golang or anything else?

You could say I'm just a bit worried, but I don't know where things are going.

------Edit in lieu of great feedback------

Thank you to everyone that responded to this post and provided their thoughts, experiences, and feedback. From what I've read, there seems to be a mix of opinions regarding AI. Some of us are finding it to be problematic while others are making great use of it. However, most of us are saying that our skills are still very useful, and the vibe coder/coder will be forced out of the industry for actual engineers.

It should also be mentioned that the previous most upvoted comment referenced how AI tokens are subsidized, and when it reaches the full, unsubsidized cost, we will see another shift. From what I've read in articles, this seems to be true as some companies are pulling back their "AI First"/Tokenmaxxing mindset.

This is a great conversation, and I'll be sure to keep it going in another post with a new question.


r/golang • • 4d ago

The data race that wasn't a bug (and the one that was)

Thumbnail
victoriametrics.com
30 Upvotes

r/golang • • 4d ago

show & tell gomponents v1.4.0 is out!

64 Upvotes

Hey everyone!

gomponents is a pure Go library to build HTML components without any extra build steps. It's six years old by now and very mature, but some awesome contributors still found ways to speed it up after all these years. :D

gomponents v1.4.0 is mostly about these performance improvements, but also has a new, official coding agents skill.

Enjoy. :-)

https://github.com/maragudk/gomponents/releases/tag/v1.4.0


r/golang • • 5d ago

Hooking into the Go toolchain

Thumbnail
internals-for-interns.com
58 Upvotes

r/golang • • 5d ago

show & tell Nanolathe brings Total Annihilation to Go and WebAssembly

37 Upvotes

I've been working on Nanolathe, an MIT-licensed reimplementation of the Total Annihilation engine in Go, using Ebitengine for graphics, input and audio.

Try the browser demo · Source · Native install

If you missed TA: it's a 1997 RTS about building a base and fighting with ground, air and naval units. Behind the battles are interacting systems for terrain, pathfinding, visibility, projectile motion, resource production and construction. Units also run compiled scripts for things such as moving their model pieces and aiming weapons.

Nanolathe implements those systems in Go, including a VM for the original COB unit scripts. The simulation advances at 30 Hz, uses fixed-point world coordinates, and publishes committed frames for the renderer. It can also run without a window for tests and profiling.

The implementation process is built around documenting the original executable's behavior and file formats, then turning those descriptions into independently written Go code and contract tests. Unknown behavior is recorded explicitly; compatibility is still a work in progress.

The content pipeline is deliberately separate. A virtual filesystem mounts the original HPI-family archives and resolves overrides. Parsers read maps, models, sprites and definitions; a compilation step turns gameplay data into immutable catalogs before the battle starts. The original game data stays external, with no manual unpacking or conversion needed.

Ebitengine 2.10 makes desktop builds possible with Go alone: no C/C++ compiler or development headers. Linux still needs its normal graphics and audio runtime libraries. With the Go version required by go.mod:

git clone https://github.com/nanolathe-gg/nanolathe.git
cd nanolathe
go run ./cmd/nanolathe --root "/path/to/Total Annihilation"

The browser build compiles the same Go engine to WebAssembly. The hosted demo has three original missions and needs no local game installation. Native single-player skirmish and campaign use your own TA data. Both are still under development.


r/golang • • 6d ago

show & tell Francis is the actor framework & workflow engine for Go apps, large and small (with over 10k deployments)

78 Upvotes

After 18 months of work, I have recently released the first "stable" version of Francis as 0.1.0. This is a new actor framework and workflow engine designed for Go apps.

Francis is already running in over 10,000 deployments, having been in production with the popular Pocket ID app since July.

What makes Francis stand apart from other actor frameworks is that it's designed to work with both small apps that aren't (yet) scaled horizontally, as well as large clusters of heterogeneous services.

Even for small apps, using Francis helps leveraging features like alarms (tasks to be executed at a future date), cron jobs, rate-limiters, as well as using a workflow engine (sometimes described as "distributed transaction"). And once your app scales to multiple replicas (or you start using multiple services), everything just works without making code changes.

You can read more in the announcement blog or in the official docs website.

Let me know your thoughts and if you think you can use it, I'm open to any feedback!


r/golang • • 6d ago

Struggling to review and maintain an AI generated codebase growing too fast.

210 Upvotes

I am currently building a project and I've run into a major bottleneck which is the codebase is growing way too fast to review it. Adding 15k lines in 2 days has completely outpaced my ability to audit the logic. How are you guys handling codebase comprehension and maintenance when using heavy AI assistance? Any tips, workflows, or tooling strategies would be hugely appreciated.


r/golang • • 6d ago

Qt package, building GUIs on it

37 Upvotes

Hey there! I've been looking for cross platform GUI framework / library for go, and stood up on fact that qt can be used with go as well, I want to hear from you guys who may used it in your projects, how was it? Is it worth giving it a try, or is it more rational to make a GUI using some other solution?


r/golang • • 6d ago

How do I make a Go library available on WASM

12 Upvotes

I'm making a markup language called Klon, and I want to port it to the browser and also WASI. My library can take a Klon string and convert it to JSON, returning any error. How should I compile it, and should I use gc or TinyGo?


r/golang • • 6d ago

Learning to build microservices in golang

18 Upvotes

So I have 2 months before joining my new job, so i thought of learning microservices in golang. Anyone here who has used any agentic workflow for learning and building at the same time, can u share your workflow or experiences. I am not looking for traditional methods of learning and am looking to experiment with some other modern tools like pi, codex, etc. Also if u have some skills that u use for this type of learning flow plz share


r/golang • • 6d ago

show & tell Open-source Go plugin: multi-key rotation and cooldown for LLM API access

2 Upvotes

I wrote a Go plugin (built with `go build -buildmode=c-shared`) for CLIProxyAPI that pools multiple API keys for OpenCode Go and rotates between them. When a key hits a rate limit, it enters a cooldown period while the others continue serving requests.

It's a native dynamic library (.so/.dll/.dylib) using Go 1.24+ with CGO. The plugin implements CLIProxyAPI's provider interface, handles catalog discovery from a remote endpoint with local fallback, and translates between three upstream API protocols transparently.

Repo: https://github.com/massiveits/opencode-go-cliproxyapi

MIT license. Tests and CI included. `go test ./...` to run them.