News for hackers. Stuff that matters.
Re:Why Not Rust? (2020) by pjmlp on Sunday December 19, 2021 @05:53AM (#29612934)
Until Valhalla arrives, Unsafe package and JNI are options as well.

Or is it ok to use cgo to work around Go's shortcomings, but not JNI for Java's?

Re:Why Not Rust? (2020) by astrange on Sunday December 19, 2021 @08:58AM (#29613974)
Sure it's fine, but isn't that not writing in Java?

I don't remember how good the Java interfaces look though, eg if you worked around no constant data by defining your arrays in C and passing them back, would they be bounds checked arrays?

Re:Why Not Rust? (2020) by pjmlp on Sunday December 19, 2021 @09:04AM (#29614011)
Just like CGO is not Go, yet not a reason to throw everything away.

If one is dumb enough to use C style arrays instead of C++ bounded checked ones, yes that is a problem, again just like C arrays defined in CGO.

Re:Why Not Rust? (2020) by astrange on Sunday December 19, 2021 @09:31AM (#29614208)
> If one is dumb enough to use C style arrays instead of C++ bounded checked ones, yes that is a problem, again just like C arrays defined in CGO.

I'm talking about defining a 'const int[]' in C and having it appear as an 'int[]' in Java. I think that's even less likely to happen if you define a const std::vector.

Actually I've never even seen someone define constant data in C++ using a vector, but this fits my experience of C++ developers telling me I'm stupid when I do the only thing I've ever seen anyone actually write.

Re:Why Not Rust? (2020) by pjmlp on Sunday December 19, 2021 @02:14PM (#29617252)
What can I say, you hang around the wrong people.