5 ms·
What exactly does the author mean by "C/C++ compatible"? Because my language[1] just got the ability to directly include .h files and access to the functions a
by AndyKelley 11y ago
What exactly does the author mean by "C/C++ compatible"?
Because my language[1] just got the ability to directly include .h files and access to the functions and symbols therein. Small snippet[2]:
c_import {
@c_include("GLFW/glfw3.h");
@c_include("stdlib.h");
@c_include("stdio.h");
}
I realize this probably comes across as trying to one-up another person's work but I just got this working a few minutes ago and I'm really excited to demo it!
[1]: https://github.com/andrewrk/zig https://github.com/andrewrk/zig
[2]: https://github.com/andrewrk/tetris/blob/aaf09e30a3a7b9ed8f344a136a094ce5ffb7e306/src/main.zig#L5 https://github.com/andrewrk/tetris/blob/aaf09e30a3a7b9ed8f34...
OK I think I understand what the author means by "C/C++ compatible". Check out this snippet[3]
> Note that there is no #include line in the source file. The ZL prelude includes some of the more common functions from the C standard library and ZL source files are not run through the C preprocessor by default.
The driver script zlc is meant to act as a drop drop in replacement for GCC. For example,
> zlc main.zl file1.cpp file2.zlp -o main
I think that zl compiles to C and also acts as a compiler driver.
[3]: http://zl-lang.org/doc/zlch2.html http://zl-lang.org/doc/zlch2.html