Blog
Tech blog on web, security & embedded
c
Select allIoTadvanced-UIsalgorithmsautomotivecc++data-compressiondata-engineeringdevelopmentdevopseducationembeddedenergygointeropirmajavajavascriptkotlinluameet-the-teammeetupmemory-safetymicroservicesntpd-rsopen-dataopen-sourcependulumprivacypythonreactresearchrustsecuritystatimestm32technologytimingtoolstypescriptweb-developmentwhy-rust
March 11, 2025
Translating bzip2 with c2rust
Over the past couple of months we've been hard at work on libbzip2-rs, a 100% Rust drop-in compatible implementation the bzip2 compression and decompression functionality.
For this project, we used c2rust
for the initial translation from the C code to a Rust implementation. The generated Rust code has now been cleaned up and made safe where possible. This post describes our experiences using c2rust for this project.
July 15, 2024
Mix in C with Rust: A taste of C in your Rust
Can't wait to learn how to call C code from your Rust project after reading my previous posts about Rust interop in general and calling Rust from C? Good! If you haven't read those yet, please do, because I'm going to assume you have in this article. We've seen the basics of Rust's FFI, and have experimented with calling Rust from C. Going the other way around, you'll walk into much the same challenges.
The other day I came across Diplomat, an opinionated tool that makes a lot of choices for you. If you've read my previous post in this series, you'll have seen that that can be quite valuable. If you haven't read the previous article yet, do so before continuing to read this one, as it'll help you appreciate the concepts in this post, and it introduces the example as well.
June 7, 2024
Mix in Rust with C
So, you've just read my previous post on Rust interoperability in general, and now you're curious about how to actually apply the concepts to your situation. You've come to the right place, because in this post and the two that follow, I'll demonstrate how to make Rust and C talk to each other.