Hacker News new | ask | show | jobs
by likeabbas 1203 days ago
> I usually find myself wishing I could have some macro where I just write in C and have it exposed as an unsafe back in Rust.

There’s a macro for doing this with Assembly, I can imagine one could be made for C. But why wouldn’t you just write unsafe rust at that point?

2 comments

Perhaps because you want to import something you don’t want to rewrite? There’s a lot of tested C code out there.
That's a good point.
Colocation, and avoiding the ceremony of standing up all the extern types (and integrating a separate C compiler, etc)