News for hackers. Stuff that matters.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by _old_dude_ on Monday May 10, 2021 @03:21AM (#27103533)
yes, Java is adding jextract [1] as a replacement for JNI (Java Native Interface) which directly consumes header files using clang and produces a jar wrapping the native calls.

It's not bolted in the compiler so less nice than Zig but the jar produced by jextract is not ABI dependent so more portable. The ABI dependent code is generated by the JIT using the the Foreign Linker API (the equivalent of C# DllImport) at runtime.

[1] https://inside.java/2020/10/06/jextract/

Re:Adding ANSI C11 C compiler to D so it can import and comp... by pjmlp on Monday May 10, 2021 @04:16AM (#27103787)
Actually the equivalent of @dll.import from J++, funny how things turn out.

https://docs.microsoft.com/en-us/previous-versions/visualstu...

Re:Adding ANSI C11 C compiler to D so it can import and comp... by MrBuddyCasino on Monday May 10, 2021 @05:15AM (#27104123)
That code also contains a nice C parser that is handy, backed by LLVM. I recently switched from JNA to Panama for a project, and so far no regrets, other than having to mess with the Java module system.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by pjmlp on Monday May 10, 2021 @07:41AM (#27104836)
It is already stable enough?
Re:Adding ANSI C11 C compiler to D so it can import and comp... by MrBuddyCasino on Tuesday May 11, 2021 @03:10AM (#27115128)
Too early to tell. It clearly has received more care & attention so far than all the alternatives, so I’m not too worried about it being in „incubator“ status. The project lead knows his shit.