Hi Loic,

the short answer is yes, you definitely can.
However, I would not consider it a beginner's exercise :)
Clean can call external libraries by means of a special "ccall"
instruction in Clean's intermediate code (ABC code).
There is a utility tool to support creating bindings called h2clean
bundled with Clean which has an explanation in the document
CallingCFromClean.html that is in the documentation folder of a standard
clean release.
Personally I prefer to just write the bindings directly. To give you an
example, the System.Environment module (the windows version) is a small
library that calls the windows API to get environment variables.
https://svn.cs.ru.nl/repos/clean-platform/trunk/src/libraries/OS-Windows/System/Environment.icl

If you want to know more details, I'd be happy to help you out.

best,
Bas

On 7/3/14, 10:29 PM, Loïc Maury wrote:
>
> Hello,
>
> I'am new to the Clean, and I have a question about FFI and Clean.
>
> Is it possible with Clean to use FFI with C code ?
>
> For example if I want to create a FFI with opengl library ?
>
> Thank you
>
> Loic
>
>
> _______________________________________________
> clean-list mailing list
> [email protected]
> http://mailman.science.ru.nl/mailman/listinfo/clean-list

_______________________________________________
clean-list mailing list
[email protected]
http://mailman.science.ru.nl/mailman/listinfo/clean-list

Reply via email to