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

> It's the lingua franca for describing libraries, and tooling (such as Rust's bindgen, or Python's cffi) can consume them to do the setup/create the information necessary to call functions from other languages.

Hence the "not necessarily" in my comment. The parent seemed to be painting this as extra unnecessary work; I was saying that a header file is _not_ necessary except for binding to C/C++.

If you want to write a C API that will be called from many languages; you should have a header file so that bindgen tools can consume it. If you want an API that will only be called by Python .... not so necessary, you may want a header file anyway but it depends on the situation.

> Or... C?

Sure, goes without saying :)



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

Search: