bon icon indicating copy to clipboard operation
bon copied to clipboard

Add instruction/example how to do a call to a C function or lib

Open eterps opened this issue 6 years ago • 1 comments

Add an instruction/example how to do a call to a C function or lib (it doesn't really matter if it is a bit hardcoded for now).

eterps avatar Jan 25 '19 14:01 eterps

I'll get some documentation on this up in the next few days. In the meantime, there are some examples of importing c functions here. e.g.

cdef sin(x:float) -> float

Keep in mind this is only very preliminary, with poor support for c types. Right now there are only double (corresponding to float in Bon), int64_t (int in Bon), and char* (string in Bon). This will all change in the near future, but it's still useful in the short term.

daniel-p-gonzalez avatar Jan 26 '19 02:01 daniel-p-gonzalez