Once again, The Platonic Engineer gazes hatefully at the gronky, ugly and awkward things that make things work in real life, rub his hands together and says... "Burn it to the ground."
Removal of Unsafe in Java 9 – A disaster in the making
121–130 of 142 posts
Re: Removal of Unsafe in Java 9 – A disaster in the making
#122This is related and unrelated and maybe even meta to some degree: There are a couple of companies that are guilty of using their free software update mechanism to try and trick people into installing crap they don't want (and might even mess-up their systems): Sun and Adobe. I almost happened to me last night as I updated Flash on a test system and some bullshit anti-virus crap-ware was going to be installed because…
You understand of course that Sun has been out of business for a very long time right?
Re: Removal of Unsafe in Java 9 – A disaster in the making
#123This is related and unrelated and maybe even meta to some degree: There are a couple of companies that are guilty of using their free software update mechanism to try and trick people into installing crap they don't want (and might even mess-up their systems): Sun and Adobe. I almost happened to me last night as I updated Flash on a test system and some bullshit anti-virus crap-ware was going to be installed because…
java hasnt been bundled with crapware since oracle bought it
Re: Removal of Unsafe in Java 9 – A disaster in the making
#124Earlier quoted context omitted.
You forgot to explain what the "right thing" that they should be doing is? Even according to most articles on the topic there is very to any pleasant alternatives that are cross platform e.g. https://dzone.com/articles/understanding-sunmiscunsafe
jni, and don't tell me now that c isn't portable.
You cannot write it once and run it everywhere, each platform needs a bunch of macros and flags. Plus you'll now either be delivering it in binary form (which may or may not work due to bitness, OS incompatibilities, and so on) or you'll be delivering it as code (which may or may not work due to compiler incompatibilities, build system components available, and missing libraries).
C is only portable in the sense that "every platform ever made has a C compiler." But if you've ever written a C application which is just meant to run on Windows, OS X, and Linux you'll know that it is a painful experience (double that if they're meant to compile it themselves).
Re: Removal of Unsafe in Java 9 – A disaster in the making
#125Earlier quoted context omitted.
It's part of the OpenJDK/Oracle VM implementation, not an official part of the Java standard library. It allows for all sorts of fun stuff like native compare and swap operations (used for concurrent collections iirc), object allocation without calling the constructor, accessing blocks of memory directly without object references, and other things. The reason it's called unsafe is because it allows developers to bypa…
Why remove it though? What harm is being caused?
Just speculation, of course.
Re: Removal of Unsafe in Java 9 – A disaster in the making
#126Earlier quoted context omitted.
Oracle did a survey last year exactly as input for what to do.
Good, that seems like a smart move. It is of course possible for them to still ignore the results of that survey, or to game the results, or that a majority of respondents don't care or understand the issue anyhow. My point is that if this feature is important enough to people, they can take real action and don't have to kiss the ring and beg at the feet of power in order to achieve the result that they want.
Re: Removal of Unsafe in Java 9 – A disaster in the making
#127Earlier quoted context omitted.
jni, and don't tell me now that c isn't portable.
C isn't portable. You cannot write it once and run it everywhere, each platform needs a bunch of macros and flags. Plus you'll now either be delivering it in binary form (which may or may not work due to bitness, OS incompatibilities, and so on) or you'll be delivering it as code (which may or may not work due to compiler incompatibilities, build system components available, and missing libraries). C is only portable…
Re: Removal of Unsafe in Java 9 – A disaster in the making
#128Earlier quoted context omitted.
[deleted]
If you are using Unsafe in your code you have already decided that you know what jvm you are deploying to.
Re: Removal of Unsafe in Java 9 – A disaster in the making
#129Earlier quoted context omitted.
C isn't portable. You cannot write it once and run it everywhere, each platform needs a bunch of macros and flags. Plus you'll now either be delivering it in binary form (which may or may not work due to bitness, OS incompatibilities, and so on) or you'll be delivering it as code (which may or may not work due to compiler incompatibilities, build system components available, and missing libraries). C is only portable…
*bad C isn't portable. and you can pack as many platform as you wish in your binary distribution, so single download still works everywhere (everywhere you built beforehand).
In a C/C++ program, if you're careful, you can isolate the platform-independent parts so that you only have to write them once. VM languages abstract further by creating a new language for these platform-independent parts. However, the platform-dependent parts are still going to be written in C/C++, or assembly, or generated by a JIT compiler written in C/C++ (there are rare exceptions).
So if anything, I would say that C/C++ enables portability, simply because there aren't any other viable choices besides assembly when it comes to generating platform-specific machine code.
Re: Removal of Unsafe in Java 9 – A disaster in the making
#130Earlier quoted context omitted.
Oracle did a survey last year exactly as input for what to do.
Good, that seems like a smart move. It is of course possible for them to still ignore the results of that survey, or to game the results, or that a majority of respondents don't care or understand the issue anyhow. My point is that if this feature is important enough to people, they can take real action and don't have to kiss the ring and beg at the feet of power in order to achieve the result that they want.
"Safety Not Guaranteed: sun.misc.Unsafe and the Quest for Safe Alternatives"
https://www.parleys.com/tutorial/safety-not-guaranteed-sun-m...
Every Java developer worth its salt knows about Java ONE.