|
|
Log in / Subscribe / Register

DeVault: Announcing the Hare programming language

DeVault: Announcing the Hare programming language

Posted May 3, 2022 0:08 UTC (Tue) by 3541 (subscriber, #135498)
Parent article: DeVault: Announcing the Hare programming language

How's the support for linking to native C libraries?

Is this possible? If so, do I need to reproduce prototypes in Hare by manual transcription, or is there (or are there plans for) anything like Rust's bindgen? Of course, reading C headers is nontrivial, but _some_ degree of automation would be useful.


to post comments

DeVault: Announcing the Hare programming language

Posted May 3, 2022 6:40 UTC (Tue) by ddevault (subscriber, #99589) [Link]

Hare uses a superset of the C ABI, so linking with C programs is fairly straightforward. However, there is not currently any tooling around generating Hare modules from C headers - which is a non-trivial problem, especially with libraries that make generous use of macros. Making a C library feel intuitive/idiomatic to use from Hare is another problem. At least some help with generating forward declarations is likely to be written at some point.

There is a project to do the other way around (interacting from Hare with C), at least, which is the easier problem of the two:

https://git.sr.ht/~sebsite/hareconv

I do want to improve support for linking with C.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds