frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Show HN: Turn – A compiled systems language for agentic computation

1•askmuyukani•2m ago•0 comments

Gram: A Zed fork without AI Slop

https://gram.liten.app/
2•Muhammad523•2m ago•0 comments

Wāhiku - US ONLY

https://www.wahiku.com
1•fisenkodv•3m ago•0 comments

Geran-3 Drone Disassembly

https://war-sanctions.gur.gov.ua/en/page-geran-3
1•miohtama•3m ago•0 comments

Humans Persistently Devalue AI-Generated Creative Writing

https://psycnet.apa.org/fulltext/2027-12675-001.pdf?_sc=NjQ1ODg2NiM2Njk1NA%3D%3D
2•itherseed•5m ago•1 comments

Show HN: I turned Claude Code into a personal assistant

https://github.com/daxaur/openpaw
3•daxaur•7m ago•0 comments

Show HN: Free Browser-Based Tools Client Side Only, No Uploads, No Tracking

https://tools.geeksprep.com/
2•axyz7732•8m ago•0 comments

Warfare in Dune, Part I: Fighting Faufreluches

https://acoup.blog/2026/02/24/collections-warfare-in-dune-part-i-fighting-faufreluches/
3•me_smith•9m ago•0 comments

What 127.5M forms can tell you about the state of front-end input valida

https://amandastjerna.se/blog/127-million-forms/
1•todsacerdoti•9m ago•0 comments

As China's economy slows, some young people buy cheap apartments to 'retire'

https://apnews.com/article/china-cheap-housing-prices-4a2825765c974497ce5a8748302de285
1•ilamont•9m ago•0 comments

Packaging a Gleam app into a single executable

https://www.dhzdhd.dev/blog/gleam-executable
2•todsacerdoti•9m ago•0 comments

Show HN: A double-entry accounting tool that lives in the browser

https://acciqmvp3.vercel.app
1•auvira_systems•10m ago•1 comments

Ask HN: Are we putting pricing on things too quickly?

1•LeanVibe•10m ago•2 comments

AI Isn't Replacing SREs. It's Deskilling Them

https://newsletter.signoz.io/p/ai-isnt-replacing-sres-its-deskilling
3•elza_1111•10m ago•0 comments

Trump directs all federal agencies to cease use of Anthropic products

https://twitter.com/i/status/2028499953283117283
1•nthypes•10m ago•0 comments

The Qwen 3.5 Small Model Series

https://twitter.com/Alibaba_Qwen/status/2028460046510965160
3•armcat•11m ago•1 comments

Show HN: Local Hours – Time tracking that's just files (no accounts)

https://github.com/gogrinimish/LocalHours
1•stinger•12m ago•0 comments

Show HN: Ledge - Policy layer for AI agent payments (prevents unauthorized txns)

https://github.com/Devendra116/ledge
2•devendra116•12m ago•0 comments

MyFitnessPal has acquired Cal AI

https://techcrunch.com/2026/03/02/myfitnesspal-has-acquired-cal-ai-the-viral-calorie-app-built-by...
2•brandonb•12m ago•0 comments

Show HN: Browser-Based AI Watermark Remover – No Uploads, Client-Side Only

https://tools.geeksprep.com/ai-watermark-remover
2•axyz7732•12m ago•0 comments

App Update: I added a Resume Roaster because my 150 launch users disappeared

https://refine.tools
2•HarakiriGod•13m ago•1 comments

Enaga: ECS-first language with fixed-point math – try it in the browser

2•shimaenaga•13m ago•0 comments

Show HN: Free CLI Tools – Zero Dependencies, MIT Licensed

https://workspace-ivory-one.vercel.app/
2•a_m73110•13m ago•0 comments

Metabolic Engineering of Escherichia Coli for β-Carotene Biosynthesis

https://www.mdpi.com/1420-3049/31/4/611
1•PaulHoule•14m ago•0 comments

2025 State of Rust Survey Results

https://blog.rust-lang.org/2026/03/02/2025-State-Of-Rust-Survey-results/
1•todsacerdoti•15m ago•0 comments

A robot arm with puppy dog eyes is just one of Lenovo's new desktop AI concepts

https://www.theverge.com/tech/885228/lenovo-ai-workmate-companion-work-concept-robot-arm-desktop-...
1•e2e4•16m ago•0 comments

Service Down? Your Notch Will Tell You

https://jsattler.github.io/Pulse/
2•jsattler•16m ago•0 comments

Our Design Docs Write Themselves

https://abnormalbuilders.substack.com/p/our-design-docs-write-themselves
1•sshh12•17m ago•0 comments

Show HN: Clean Express – a native NNTP/Usenet client for iOS/macOS/visionOS

https://testflight.apple.com/join/DmBXsPhU
2•jim180•17m ago•0 comments

Running Mainline Linux, U-Boot, and Mesa on Rockchip: A Year in Review

https://www.collabora.com/news-and-blog/blog/2026/03/02/running-mainline-linux-u-boot-and-mesa-on...
2•losgehts•17m ago•0 comments
Open in hackernews

Goffi – Pure Go FFI with hand-written assembly for System V, Win64, ARM64

https://github.com/go-webgpu/goffi
4•kolkov•1h ago

Comments

kolkov•1h ago
Hi HN! Author here.

Some of you may remember the purego discussion from 2023 (https://news.ycombinator.com/item?id=34763681, 268 points). It proved that calling C from Go without CGO is viable. We built on that foundation.

Why another FFI library?

We needed to call wgpu-native (WebGPU) from Go — thousands of FFI calls per frame. purego's reflect-based dispatch (RegisterFunc → reflect.MakeFunc → sync.Pool per call) was too much overhead for our use case. We also needed struct passing by value and callback float returns, which purego doesn't support.

So we took a libffi-style approach:

  cif := &types.CallInterface{}
  ffi.PrepareCallInterface(cif, types.DefaultCall, retType, argTypes)  // once
  ffi.CallFunction(cif, fnPtr, &result, args)                         // many times, zero alloc
Type classification is pre-computed at prepare time, not at call time. The call path is: Go → runtime.cgocall → hand-written asm → C function. The asm loads GP/FP registers per ABI from a flat argument buffer — no interpretation at call time.

The assembly:

Three hand-written stubs: System V AMD64 (RDI,RSI,RDX,RCX,R8,R9 + XMM0-7), Win64 (RCX,RDX,R8,R9 + XMM0-3, 32-byte shadow), AAPCS64 (X0-X7, D0-D7, HFA support). Each is ~100 lines of Plan 9 asm.

What goffi does that purego doesn't:

Struct passing by value (8B in RAX, 9-16B in RAX+RDX, >16B via sret pointer). Callback float returns via XMM0 — purego panics on float/double return from callbacks. Typed errors — 5 error types with errors.As() instead of generic errors. Context support for timeouts and cancellation.

What purego does better (being honest):

purego supports 8 GOARCHes and 20+ OS×ARCH combinations — we cover 6 targets (amd64×4 + arm64×2). purego auto-marshals strings, bools, and slices — we work with raw unsafe.Pointer. purego has a much simpler API — one line to bind a function. purego has full Darwin ARM64 variadic stack packing — we don't yet.

Related projects worth knowing:

JupiterRider/ffi (https://github.com/JupiterRider/ffi) — pure Go binding for native libffi via purego. Supports variadic and struct pass/return, but requires libffi.so at runtime. If you need variadic calls today, that's a good option.

Where we use it:

goffi powers gogpu (https://github.com/gogpu) — a pure Go GPU computing platform with WebGPU bindings, zero CGO. It's also used in Born (https://github.com/born-ml/born) — an ML framework for Go with PyTorch-like API, type-safe tensors, and automatic differentiation. Both projects ship as single binaries with no C toolchain required. 89% test coverage, CI on Linux/Windows/macOS, MIT license.

We wrote a deep dive on the architecture, assembly, and callback mechanism: https://dev.to/kolkov/goffi-zero-cgo-foreign-function-interf...

Happy to discuss FFI internals, ABI details, or the trade-offs between the different approaches!