bon
bon copied to clipboard
Add instruction/example how to do a call to a C function or lib
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).
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.