Languages ​​Directly Compatible C

Besides C ++, which non-toy languages ​​have direct or easy to use C compatibility? Like in "I can take the C library there and compile my code against it without to find, write or configure some kind of shell."

I know that many languages ​​are compatible with C through some external call or binding (I used bindings in Java, Ruby, Python, etc., so I know that this can be done). But you rely on someone (maybe you) to write and maintain a binding for all the libraries you want to use, and the binding should work on all platforms, etc.

More expressive languages ​​than C ++ have this feature?

Thanks to everyone for mentioning swig or related wrapper tools. I know that they exist, but I don’t think that they are really as simple as C-> C ++ integration ... but then integration with C may be the only one that is easier in C ++;))

+3
source share
7 answers

Objective-C, a child bastard of C and Smalltalk.

Objective-C is a direct superset of C (you cannot get more compatible than this), but there are languages ​​that compile in C. Some recent examples would be Vala and Lisaac .

C. Ada, Fortran, Pascal D. ; x86 cdecl.

+12

D C ABI. , C D. . .

+6

Fortran C- C. " ", , Fortran 2003 " ISO C", , , , . ISO C Fortran, gfortran ( >= 4.3), Intel ifort, Sun Fortran ..

"" C, .

+4

C - SWIG: http://www.swig.org/

Tcl, : Tcl, Python, Perl, Guile, Java, Ruby, Scheme, PHP, Ocaml, Pike, #, Modula-3, Lua, Common Lisp, R Octave.

- , , . C, , , . C .

+3

/, , C Fortran. .

+2

Python , ctypes, , , , .

+2

G'day,

Perl C, XS . perlXSTut CPAN.

XML:: LibXML XML:: LibXSLT.

Ada C, . , ++. COBOL FORTRAN BTW.

,

0

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


All Articles