Zevic 0.1.0: C interop and interfaces
v0.1.0 is the version that earns the phrase “uses C as it is”.
Declare a C function with extern "C" and call it, or expose a Zevic function to C with export "C". --emit-header also writes the C header. .c, .cpp, .o and .a files build together, and -I, -D, -L and -l are passed straight on to the compiler and linker.
extern "C" {
fn puts(s: CString) -> CInt
}
fn Main() {
let r: CInt = puts("hello".ToC())
}
There are no implicit conversions between C types (CInt, CString, CLong and so on) and Zevic types. You write them out, as in x.ToCInt() or String.FromC(p).
On the language side, interface arrived: required methods, default methods, interface extension and dynamic calls, plus generic constraints (<T: Comparable + Hashable>). Map<K, V> (insertion ordered) and Set<T> joined the standard library, also written in Zevic.