Hacker News new | past | comments | ask | show | jobs | submit login

Yes, you can expose C symbols from a Rust library:

  #[no_mangle]
  pub extern fn rustlib_increment(x: i32) -> i32 { x + 1 }
#10350 covers actually printing a .h file from Rust code. https://github.com/rust-lang/rust/issues/10530



Awesome. I think the ability to write a nice .h file, in particular, will really be the killer feature for Rust as "better systems language". Exporting headers and symbols for higher level languages in a format that's universally understood.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: