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

The C interoperability of Ada is very good, you can import/export functions and specify whether records (structs) and arrays must have a C convention. I use it often to access libc and Linux kernel functions/syscalls [1][2].

[1] https://github.com/onox/inotify-ada [2] https://github.com/onox/evdev-ada



Can attest to that. C++ is also OK. You still have to write the 'binding' but the compiler can generate a good part for you. Then you can 'hide' all the C-like things (like 'a pointer is an address', 'an enumerated type is an integer', 'you have to call our free() when you're done'...) behind opaque types, controlled types, etc.

As a simple example you can lookup what the compiler generates as a low-level binding [0] that is wrapped in a higher level API [1].

BTW you can also bind Ada to Java (although support is a bit limited I know places where it's in prod). Don't remember if it's a commercial product or oss.

And for the python people, my company financed a first version of ada-py-bind, inspired by the great pybind11. Still a lot of code to write (or generate) but it works fine.

Thanks onox for those two links!

[0] https://github.com/persan/zeromq-Ada/blob/651ca44cce831c2d71...

[1] https://github.com/persan/zeromq-Ada/blob/651ca44cce831c2d71...




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

Search: