frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Ask HN: Exposing C ABI from Rust library?

2•paulmooreparks•17h ago
I have a project called XferLang (https://github.com/paulmooreparks/Xfer) that is a data-transfer language with a few features that I like (and use) which aren't found in JSON. Right now, it's implemented in C#, and my first idea for porting it to other languages was just to rewrite it in those languages. Now, my idea is to reimplement the core library (elements, parser, and serializer/deserializer) in Rust, expose a C-like ABI, and then wrap that with other languages. That way I'm only managing one core library. Since I'm still quite new to Rust, is this a technique used in any other significant projects? Is it viable? Should I expect to be able to call into the library from essentially any language the way I would be able to call into a C library?

Comments

thesuperbigfrog•11h ago
Exposing a C ABI for a Rust library is perfectly viable and a nice way to make cross-language bindings.

cbindgen is the recommended crate to generate a C interface for your Rust library:

https://github.com/mozilla/cbindgen

Nebius emerged from Russia as one of Nvidia's top-performing investments

https://sherwood.news/tech/nebius-nvidia-gpus-ai-startup/
2•gmays•3m ago•0 comments

One Life

https://thisisyouronelife.com/
1•tasshin•3m ago•0 comments

Project West Ford: Cold War Plan to Solve Radio Problems with 480M Space Needles

https://multiverseemployeehandbook.com/blog/when-america-tried-to-gift-wrap-the-planet/
1•6forward•11m ago•0 comments

When Code Writes Itself: The Dawn of Just‑in‑Time Software

https://zergai.com/blog/when-code-writes-itself
2•idanb•12m ago•0 comments

Open source CLI to expose local services using Cloudflare Tunnel

https://github.com/stupside/moley
1•xonery•14m ago•1 comments

Reading Abundance from China

https://www.chinatalk.media/p/reading-abundance-from-china
1•zeroCalories•16m ago•0 comments

The War on the Walkman

https://newsletter.pessimistsarchive.org/p/the-forgotten-war-on-the-walkman
2•mfiguiere•18m ago•0 comments

Nightmares Linked to Faster Ageing and Premature Mortality

https://www.emjreviews.com/neurology/news/ean-2025-nightmares-linked-to-faster-ageing-and-premature-mortality/
1•gnabgib•19m ago•0 comments

OpenGOAL: Reviving the Language That Brought Us Jak and Daxter

https://opengoal.dev
2•oumua_don17•20m ago•0 comments

No representation without reservation; Gender quotas in India

https://voxdev.org/topic/institutions-political-economy/no-representation-without-reservation-long-term-limits-gender
2•neehao•24m ago•0 comments

Hetackling SAP supply chain pain. Got advice?

1•Njord01•26m ago•0 comments

Hey, If You Know Anything About SAP – I Need Your Brain for a SEC

1•Njord01•30m ago•0 comments

Cancel Culture in Academia

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4440242
3•KrisGulati•34m ago•2 comments

A "Living Web" Manifesto

https://owebp.net/lwd0.html
1•ppqqrr•34m ago•0 comments

Penguin turns up on beach in Rio de Janeiro, alone and far from home

https://www.washingtonpost.com/world/2025/07/02/penguin-brazil-rio-beach/
2•bookofjoe•38m ago•1 comments

Latest iteration of big, beautiful bill to limit gambling loss deductions to 90%

https://www.reviewjournal.com/business/casinos-gaming/how-trumps-big-beautiful-bill-could-impact-gamblers-3392020/
2•indigodaddy•39m ago•0 comments

'AI doesn't know what an orgasm sounds like': audiobook actors grapple with the

https://www.theguardian.com/books/2025/jul/03/audiobook-voice-actors-ai-robot-narrators
2•chrisjj•42m ago•0 comments

OpenAI says Robinhood's tokens aren't equity in the company

https://www.cnbc.com/2025/07/02/openai-robinhood-tokens.html
2•mfiguiere•42m ago•0 comments

RAG Developer Experience Survey

https://airtable.com/appPl2tfUvNB1dFG0/pagcXGG9uODGho9MF/form
1•rylan-talerico•43m ago•1 comments

Narrative Capture

https://unintendedconsequenc.es/narrative-capture/
1•paulorlando•44m ago•0 comments

Expose Ollama on the Network

https://github.com/ollama/ollama/releases/tag/v0.9.5
1•twapi•45m ago•0 comments

Tell HN: My fish died because of CoderPad

3•RomanPushkin•45m ago•0 comments

Red Teaming for Gen. AI, Report on a Copyright-Focused Exercise in Academic Med

https://arxiv.org/abs/2506.22523
1•jjwen•45m ago•0 comments

Using Playwright MCP with Claude Code

https://til.simonwillison.net/claude-code/playwright-mcp-claude-code
1•thunderbong•52m ago•0 comments

CASP protein structure prediction contest may be eliminated due to NIH cuts

https://www.science.org/content/article/exclusive-famed-protein-structure-competition-nears-end-nih-grant-money-runs-out
2•Metacelsus•54m ago•0 comments

I Don't Need Ozempic. But I Want It

https://www.thefp.com/p/i-dont-need-ozempic-but-i-want-it
1•haltingproblem•56m ago•0 comments

Wayback: Gluing together Wayland components to turn Xwayland into a full X

https://social.treehouse.systems/@ariadne/114763322251054485
2•mariuz•1h ago•0 comments

Show HN: Qrblox – AI Chat with QR Codes

https://qrblox.com
1•sarahoh•1h ago•0 comments

New evidence that some supernovae may be a "double detonation"

https://arstechnica.com/science/2025/07/new-evidence-that-some-supernovae-may-be-a-double-detonation/
2•raattgift•1h ago•0 comments

454 Hints That a Chatbot Wrote Part of a Biomedical Researcher's Paper

https://www.nytimes.com/2025/07/02/health/ai-chatgpt-research-papers.html
3•occamschainsaw•1h ago•0 comments