FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
goffi: Zero-CGO Foreign Function Interface for Go — How We Call C Libraries Without a C Compiler
How-ToSystems

goffi: Zero-CGO Foreign Function Interface for Go — How We Call C Libraries Without a C Compiler

via Dev.toAndrey Kolkov21h ago

Every Go developer who has worked with C libraries knows the pain: CGO requires a C compiler, breaks cross-compilation, bloats binaries, and adds ~200ns overhead per call. For our WebGPU bindings and ML framework , calling wgpu-native through CGO was a non-starter — we needed to ship a single static binary across Windows, Linux, and macOS without requiring users to install gcc. So we built goffi — a pure Go FFI library that calls C functions through hand-written assembly, with zero C dependencies and zero per-call allocations. It now powers an entire ecosystem: go-webgpu/webgpu bindings, born-ml/born ML framework, and the GoGPU GPU computing platform with dual Rust and pure Go backends. This article explains the architecture, the hard problems we solved, how goffi compares to purego, and how you can use it in your own projects. The Problem Our stack looks like this: Go application (gogpu) └─ wgpu bindings (gogpu/wgpu) ← needs to call C functions └─ goffi ← this library └─ wgpu-native (

Continue reading on Dev.to

Opens in a new tab

Read Full Article
5 views

Related Articles

"Did You Mean…?" Building Fuzzy Suggestions using Postgres
How-To

"Did You Mean…?" Building Fuzzy Suggestions using Postgres

Medium Programming • 18h ago

How-To

Building a Quake PC

Lobsters • 19h ago

7 Simple Coding Tricks That Instantly Improved My Logic
How-To

7 Simple Coding Tricks That Instantly Improved My Logic

Medium Programming • 20h ago

RAG Showdown: Why Telling Your Agent Less Gets You More
How-To

RAG Showdown: Why Telling Your Agent Less Gets You More

Dev.to • 22h ago

The 2026 FBA Ads Playbook: How to Beat Fee Hikes with Dynamic Bidding
How-To

The 2026 FBA Ads Playbook: How to Beat Fee Hikes with Dynamic Bidding

Hackernoon • 23h ago

Discover More Articles