4 ms·
Does SPARK allow exposing C API/ABI, i.e. could you use SPARKNaCl as drop-in replacement for TweetNaCl in C programs?
by zokier 5y ago
Does SPARK allow exposing C API/ABI, i.e. could you use SPARKNaCl as drop-in replacement for TweetNaCl in C programs?
- Jtsummers 5y agoProbably, SPARK is a proper subset of Ada and you can call Ada procedures from C. Here's a demonstration of it: https://learn.adacore.com/courses/intro-to-ada/chapters/interfacing_with_c.html https://learn.adacore.com/courses/intro-to-ada/chapters/inte... (this goes in both directions, Ada calling C and C calling Ada).
- touisteur 5y agoYes, to the first, at least with GNAT. We expose some Ada code to C programs with (almost) no difficulty. I don't know if you can do it easily in this specific case.