[clean-list] Interfacing Clean with C code (or other
languages)
John van Groningen
johnvg at cs.ru.nl
Fri Sep 14 18:00:57 MEST 2007
Chris Khoo wrote:
>
>I'm looking to evaluate Clean as a language for a long term project. I was wondering whether it has some sort of foreign function interface so it can interface with C code (and possibly other languages for that matter).
Yes, C functions can be called from Clean. The tool htoclean can
generate a Clean interface using prototypes of C functions (see
Help/CallingCFromClean.html).
Clean functions (with the right type) can be called from C using foreign export.
On windows, functions in a dll can be called using the C or WinAPi calling
convention. A dll with Clean code can be generated, and functions in this
dll that are exported using foreign export can be called using the C or WinAPI
calling convention.
Kind regards,
John van Groningen
More information about the clean-list
mailing list