3 ms·
You could say this is P/Invoke for Java, which .NET had for more than a decade now. Better late than never I guess.
by sanxiyn 5y ago
You could say this is P/Invoke for Java, which .NET had for more than a decade now. Better late than never I guess.
- royjacobs 5y agoHas P/Invoke been cross-platform for a decade? Additionally, does it parse C headers to create native type wrappers automatically? Last I checked (a long time ago), P/Invoke required you to annotate manually written prototypes?
- sanxiyn 5y agoYes, P/Invoke has been working cross-platform for a decade with Mono. Have you heard of this thing called Gtk#? P/Invoke does not parse C headers, but neither does this proposal.
- royjacobs 5y agoAh right, Mono. I keep forgetting that was a thing. This proposal will pave the way for jextract, though. I would argue this series of JEPs is much closer in spirit to something like Rust's cxx than P/Invoke is.
- pjmlp 5y agoJava had it first actually, because P/Invoke was one of the extensions Microsoft added to J++.
- pie_flavor 5y agoActually, what Java had was J/Direct. P/Invoke was created specifically for C#.
- pjmlp 5y agoThey are the same thing, replace Java annotations with .NET attributes and call it something else due to the lawsuit. /** @dll.import("USER32", entrypoint="GetSysColor") */ static native int getSysColor(int nIndex); versus [DllImport("USER32", EntryPoint = "GetSysColor")] static extern int GetSysColor(int nIndex);