HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
ebitengine
purego
Assembly2023–2026
ebitengine / purego

purego

A library for calling C functions from Go without Cgo

12Distinct people
16Mentions
0Explicit recommenders
4.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A library for calling C functions from Go without Cgo

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year16 dated mentions

Observed mentions: 2023-02-12 15:46:01 UTC to 2026-07-07 17:12:38 UTC.

02462023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC514
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC615
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC312

What Hacker News says

16 sources
There are undoubtedly still some optimizations lying around, but the biggest source of Go's FFI overhead is goroutines. There's only two "easy" solutions I can see: switch to N:N threading model or make the C code goroutine-aware. The former would speed up C calls at the expense of slowing down lots of ordinary Go code. Personally, I can still see some scenarios where that's beneficial, but it's pretty niche. The latter would greatly complicate the use of cgo, and defeat one of its core purposes, namely having access to large hard-to-translate C codebases without requiring extensive modifications of them. A lot of people compare Go's FFI overhead to that of other natively compiled languages, like Zig or Rust, or to managed runtime languages like Java (JVM) or C# (.NET), but those alternatives don't use green threads (the general concept b
Read the rest
ehind goroutines) as extensively. If you really want to compare apples-to-apples, you should compare against Erlang (BEAM). As far as I can tell, Erlang NIFs [1] are broadly similar to purego [2] calls, and their runtime performance [3] has more or less the same issues as CGo [4]. [1]: https://www.erlang.org/doc/system/nif.html [2]: https://pkg.go.dev/github.com/ebitengine/purego [3]: https://erlang.org/documentation/doc-10.1/doc/efficiency_gui... [4]: https://www.reddit.com/r/golang/comments/12nt2le/when_dealin...
In Full Unicode Search at 50× ICU Speed with AVX‑512
That is a nice approach. I'll have to give that a try with rclone. I tried lots of things in the past but not using Alpine which is a great idea Another alternative is https://github.com/ebitengine/purego You can use this to dynamic load shared objects / DLLs so in the OP example they could disable systemd support if the systemd shared object did not load. This technique is used in the cgofuse library ( https://github.com/winfsp/cgofuse ) rclone uses which means rclone can run even if you don't have libfuse/winfsp installed. However the rclone mount subcommand won't work. The purego lib generalizes this idea. I haven't got round to trying this yet but it looks very promising.
In Go is portable, until it isn't
Thank you author for your kind words about my Go SQLite driver. That said, purego solves a build infrastructure issue, not a perfomance issue. You're still using the same underlying mechanisms to call into C, and the same performance is expected. I'm not the one saying this, read the authors: https://github.com/ebitengine/purego/issues/202 wazero uses a different mechanism, the one used to call Go assembly, but adds its own overhead (trampolines, adapting calling conventions, and the inherent Wasm sandbox overhead, e.g. the guest can't read the host's memory, there's bounds checks, etc). Also “Cgo is fast” and “Cgo is slow” is not the correct framing; rather it depends, for various reasons: - Cgo is a moving target (it mostly improves with time, but can regress) - it's different to just call C from Go, or then callback Go from C - there's
Read the rest
not just call overhead to consider, but also scheduler overhead which is much harder to measure consistently
In Calling Rust from Cursed Go
https://ebitengine.org/en/documents/install.html For anything other than windows: > Installing a C compiler > A C compiler is required as Ebitengine uses not only Go but also C. I mean, even on platforms without cgo, it's it working magically? No; it's using https://github.com/ebitengine/purego, which is: > A library for calling C functions from Go without Cgo. Like... I mean.... okaaaay, it's not cgo, but it's basically cgo? ...but it's not cgo so you can say 'no cgo' on your banner page? If you're calling c functions, it's not pure go. If calls some C library, and it doesn't work on any other platform, its like 'pure go, single platform'. hmm. Seems kind of like... this is maybe not the right hammer for gamedev; or, perhaps, maybe not quite mature yet... Certainly for someone in the 'solo dev pick your tools carefully' team, like the OP
Read the rest
, I don't think this would be a good pick for people; even if they were deeply familiar with go.
In Go is my hammer, and everything is a nail
In the malware reverse engineering scene, there are a lot of forks of the upstream "debug" go library, because it allows loading, parsing, compiling and executing libraries from disk (rather than in-kernel or in-userspace) because it is independent of dlopen. And there's also "purego" as an implementation that directly generates shellcode. Maybe those will help you, too? I am just mentioning these because for my use cases those approaches worked perfectly, CGO free. [1] https://github.com/Binject/debug [2] https://github.com/ebitengine/purego
In The simplicity of single-file Golang deployments
I thought I had a piece of dust on my screen, but as I scrolled the dust scrolled: what do these 0xB7 characters do in the identifiers? Are they just "name mangling" to keep them from being exported or something? https://github.com/ebitengine/purego/blob/v0.2.0-alpha/sys_d... I noticed another 0xB7 character in a comment, and sure enough it seems to be part of the identifiers: https://github.com/ebitengine/purego/search?q=runtime%C2%B7c...
In Purego – A library for calling C functions from Go without Cgo

Showing the 15 most recent of 16 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.