About languages ​​that let you call C functions directly

I came across Julia (a programming language) and was especially interested in its ability to call C functions without a shell. Actually, it looks more like an instant C shell:

 path = ccall( (:getenv, "libc"), Ptr{Uint8}, (Ptr{Uint8},), "SHELL")

 time = ccall( (:clock, "libc"), Int32, ())

So, I have a few questions:

  • Is there a drawback to using this function using the formal wrapping API?
  • If this type should not be used

PS: It would be nice to have other languages ​​that can do the same thing as easily listed.

+4
source share
1 answer

C. (Haskell, #) .

. , , python lua. , .

, , , C interop. , , . FFI, , .

+4

Source: https://habr.com/ru/post/1568461/


All Articles