longino
|
 |
«
Posted
2012-07-16 00:05:43 » |
|
I know that this is discussed ever since Java was released, and every other week someone comes around with the brilliant idea: "What if Java had operator overloading?"
Well, I understand the reasons against it, but did people at Sun ever questioned them? I mean, at all? Because it seems odd that a bunch of smart people would simply accept such arbitrariness without saying anything.
Operator overloading is a must for mathematical code. I can totally understand why some wouldn't want to touch Java for games.
Was there ever a controversy about it?
|
|
|
|
sproingie
|
 |
«
Reply #1 - Posted
2012-07-16 00:15:50 » |
|
There was a controversy then, there is now, and long story short, whatever you think about it, Java's never going to have it.
I really don't see what operator overloading has to do with games. The usual objection there is the costs associated with a managed runtime.
|
|
|
|
longino
|
 |
«
Reply #2 - Posted
2012-07-16 00:19:22 » |
|
I really don't see what operator overloading has to do with games.
Everything, because you will use vectors and matrices a lot. This simple feature makes Java very shitty for this type of application.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
jonjava
|
 |
«
Reply #3 - Posted
2012-07-16 00:22:43 » |
|
I hate operator overloading with a passion. Screw you C++.
@longino Just use a method.
|
|
|
|
moogie
|
 |
«
Reply #4 - Posted
2012-07-16 00:40:08 » |
|
If you are keen then you can always create a pre-processor for your code that translates your custom operators into legitimate java syntax (i.e. method calls etc)
You can even make it a plugin into your IDE so that it does the pre-processing step automatically.
|
Java4k RIP 2014
|
|
|
longino
|
 |
«
Reply #5 - Posted
2012-07-16 00:46:18 » |
|
If you are keen then you can always create a pre-processor for your code that translates your custom operators into legitimate java syntax (i.e. method calls etc)
You can even make it a plugin into your IDE so that it does the pre-processing step automatically.
How about I don't do anything and just use a tool that does it for me, like, something other than Java?
|
|
|
|
moogie
|
 |
«
Reply #6 - Posted
2012-07-16 00:48:21 » |
|
What tool is that? I was not aware that one existed and that is why i suggested you make the tool your self... then others can benefit as well if they want operator overloading as well.
|
Java4k RIP 2014
|
|
|
longino
|
 |
«
Reply #7 - Posted
2012-07-16 00:48:45 » |
|
What tool is that? I was not aware that one existed and that is why i suggested you make the tool your self... then others can benefit as well if they want operator overloading as well.
Visual Studio and C++ or C#.
|
|
|
|
moogie
|
 |
«
Reply #8 - Posted
2012-07-16 00:53:00 » |
|
um but that is because those languages support operating overloading explicitly.... java does not. If you want to emulate operating overloading so you can... as i have suggested. If the underlying language does not support a feature there is no other way than to make your own tools (or create your own java-syntax based language that that compiles into bytecode that can run on a JVM)
|
Java4k RIP 2014
|
|
|
sproingie
|
 |
«
Reply #9 - Posted
2012-07-16 02:23:26 » |
|
Java's not going to get operator overloading and no amount of whinging is going to change that. Live with it or use Scala.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Evil[1]
|
 |
«
Reply #10 - Posted
2012-07-16 08:50:42 » |
|
Operator overloading is a must for mathematical code.
Nope, operator overloading is just convinience stuff. 90% of mathematical high performance code is written in Fortran without any operator overloading. And even in C++ it's just nice for prototyping, but for performance, you do something other. Working on SoA or AoS with unrolled loops and SSE optimizations.
|
|
|
|
Mads
|
 |
«
Reply #11 - Posted
2012-07-16 19:55:10 » |
|
Reading the thread till this point: Bye then! 
|
|
|
|
Roquen
|
 |
«
Reply #12 - Posted
2012-07-17 10:09:24 » |
|
@Evil[1]: So I guess that Cray, IBM and Sun know nothing about high performance computing then.
|
|
|
|
Evil[1]
|
 |
«
Reply #13 - Posted
2012-07-17 10:47:48 » |
|
You guessed correctly.
|
|
|
|
Evil[1]
|
 |
«
Reply #14 - Posted
2012-07-17 10:53:00 » |
|
Okay... jokes aside. Cray is Tesla these days. IBM is the strongest FORTRAN player in the field. And Sun, no Sun never knew a shit about performance. And those Hadoop solutions on Cray... you exchanged throughput and scalability with performance. And what the f**k has this all to do with operator overloading? I just said, that for the real performance you don't use operator overloading but tight SSE loops. Or so to say, if you do this, you are doing it wrong: 1
| for(int i = 0; i < count; i++) A[i] = B[i] + C[i]; |
|
|
|
|
Roquen
|
 |
«
Reply #15 - Posted
2012-07-17 11:19:23 » |
|
I meant: chapel = cray, X10 = ibm, fortress = sun. Pretty much all attempts at a FORTRAN replacement include operator overloading.
Now, you're the one the brought up SoA vs. AoS. Pretty much dead issue today isn't it? Load is computation chain dependent SIMD ops have been adding horizontal ops. Load is data intensive, then massively parallel processors. Of course a non-issue here since we don't have structures, concrete arrays nor SIMD access. Our only option is going to the gpu.
Now while it's true that algebraic operator overloading is pure sugar, many useful features are pure sugar and often separates useful languages from the, well, not so useful.
|
|
|
|
sproingie
|
 |
«
Reply #16 - Posted
2012-07-17 18:30:34 » |
|
Hell, Fortress has unicode operators.
HPC isn't really concerned with syntax. They stuck with fortran all that time after all.
|
|
|
|
Roquen
|
 |
«
Reply #17 - Posted
2012-07-17 19:19:55 » |
|
WRT: Fortress. I haven't looked at it in ages, but it seemed like "a" goal was to allow code that pretty much looked like LaTeX output. Being a very long time Mathematica user, I have to say being able to write that code that looks like the equation is pretty awesome. Many, many operators is very useful in a fair number of mathematical fields.
WRT: HPC not caring about syntax. If you mean the non-programmers using existing libraries...then OK. But how many programmers that know more than a few languages and have a few years of experience don't care about syntax or cringe at glaring holes in their set of languages?
|
|
|
|
ags1
|
 |
«
Reply #18 - Posted
2012-07-17 22:16:19 » |
|
I meant: chapel = cray, X10 = ibm, fortress = sun. Pretty much all attempts at a FORTRAN replacement include operator overloading.
Now, you're the one the brought up SoA vs. AoS. Pretty much dead issue today isn't it? Load is computation chain dependent SIMD ops have been adding horizontal ops. Load is data intensive, then massively parallel processors. Of course a non-issue here since we don't have structures, concrete arrays nor SIMD access. Our only option is going to the gpu.
Now while it's true that algebraic operator overloading is pure sugar, many useful features are pure sugar and often separates useful languages from the, well, not so useful.
Everything that is not assembly is sugar :-)
|
|
|
|
Riven
|
 |
«
Reply #19 - Posted
2012-07-17 23:05:30 » |
|
Everything that is not assembly is sugar :-)
assembly is sugar for a hex editor / binary
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
ra4king
|
 |
«
Reply #20 - Posted
2012-07-18 03:34:37 » |
|
A hex editor/binary is sugar for hardware on/off switches.
|
|
|
|
sproingie
|
 |
«
Reply #21 - Posted
2012-07-18 03:55:13 » |
|
Hardware on/off switches is sugar for a soldering iron.
|
|
|
|
ra4king
|
 |
«
Reply #22 - Posted
2012-07-18 03:59:30 » |
|
Soldering iron is sugar for your mom.
|
|
|
|
sproingie
|
 |
«
Reply #23 - Posted
2012-07-18 04:09:38 » |
|
Your mom is sweet sweet sugar.
|
|
|
|
Jimmt
|
 |
«
Reply #24 - Posted
2012-07-18 10:21:12 » |
|
And once again, we stray off topic. But you guys are hilarious.
|
|
|
|
Evil[1]
|
 |
«
Reply #25 - Posted
2012-07-18 11:02:43 » |
|
Sweet as sugar? Depends on the mom being MILF or not, me thinks...
|
|
|
|
Mads
|
 |
«
Reply #26 - Posted
2012-07-18 13:49:35 » |
|
Sweet as sugar? Depends on the mom being MILF or not, me thinks...
I'm a mother, and I'm offended. 
|
|
|
|
ra4king
|
 |
«
Reply #27 - Posted
2012-07-18 18:47:45 » |
|
BS, everyone knows there are no women on the internet  I mean, who would be so stupid as to put a computer that close to the kitchen sink?
|
|
|
|
Sublixt
Senior Newbie 
|
 |
«
Reply #28 - Posted
2012-07-18 18:53:33 » |
|
Well that escalated quickly.
|
|
|
|
Mads
|
 |
«
Reply #29 - Posted
2012-07-18 19:10:24 » |
|
BS, everyone knows there are no women on the internet  I mean, who would be so stupid as to put a computer that close to the kitchen sink? You're right! It was too easy to figure out. I'll have to revise my methods.
|
|
|
|
|