Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

At least we have Rust...

Well, it's not really stable yet. But it is about the best candidate that I've heard of recently for this...

Since I'm not familiar with it, is it possible to write a library in Rust, and have it callable from C?

I've been doing a fair amount of golang programming recently, but calling Go from C is not possible right now (not sure if it will ever be).



Yes, it's certainly not production ready. I just mean that there is one contender that is coming that addresses this.

> is it possible to write a library in Rust, and have it callable from C?

Yup. The third production deployment of Rust is actually a Ruby extension, written in C, that is a thin wrapper over Rust. Ruby -> C -> Rust. The reason it was done this way is that Ruby's C interface is incredibly macro heavy, so it was easier to use them in a tiny C layer than to try to port them to Rust itself. For more: https://air.mozilla.org/sprocketnes-practical-systems-progra... (you'll have to scroll through to wycats' part.)


That's great. I've been meaning to learn a bit more about Rust, maybe now's the time.


I still think that now would be the ideal time to start working on a TLS/SSL implementation in Rust. First, it would mean that there would be less time between the release of Rust 1.0 and a usable library. It would also be a good project to give feedback to the Rust compiler writers.


  > is it possible to write a library in Rust, and have it 
  > callable from C?
Yes, you can generate a Rust library that exposes a C-compatible interface and then call that library from any language that can call C code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: