> Especially, after Google got so heavily sued for using Java in
> Android, I presume Java and the JVM itself are off limits due to legal
> issues.
So, to avoid legal issues, Sony decided to put their balls into
Microsoft's hands? Brilliant!
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
fabrizio...@tidalwave.it
http://tidalwave.it - http://fabriziogiudici.it
Probably more to ride on the popularity of XNA.
And I could be wrong, but I think the JVM takes a beating on most of
these platforms for lack of easy access to such items as unsigned
primitives and stack allocations. Waiting on a JIT is not an option
for most game developers.
So, is the main reason the fact that C# also does AOT?
On Mon, Jan 16, 2012 at 8:17 PM, clay <clayt...@gmail.com> wrote:
> C still outperforms both the JVM/CLI class of runtimes when it comes
> to extremely performance sensitive applications and tight memory
> constraints.
>
> I really don't believe there is a performance problem with Java/JVM vs
> Mono.
>
> When you cite Mono as having big performance advantages and cite the
> stack allocation feature:
Apologies, I wasn't trying to say for sure that Mono has a definite
performance advantage. So, first let me reiterate what I think was
the main draw, the large base of developers already doing game
development in C# with the XNA tools.
That said, I just saw the hacker news floating of the old jgit versus
cgit email* recently and it reminded me of some of the crazy crap that
game developers do. In particular, tricks such as "doing a copy from
an inflated tree into a struct object." Now, I could be wrong, but I
thought in C# it was possible to do tricks such as this with an
"unsafe" region. (In case it isn't clear, I'm not an experienced C#
programmer. So, if I'm wrong, let me know. :) )
I could be wrong, but JNI doesn't really act as a good "unsafe"
replacement. I tried searching quickly, but couldn't find any good
links. Essentially, I'm lead to believe that JNI calls can actually
be rather expensive. And, especially with some of the insane tricks
I've seen to quickly take a byte of data from a network packet and
turn it into a struct (yeah yeah, I know this is old hat for c
coding...), I think these add up heavily in common code for game
development.
> playing and game development brands like Xbox/XNA/XBLA/DirectX/C# are
> very popular. Anything related to Java is not. And most people view
> terms like "Scala" or "Haskell" as just foreign jibberish. With this
> type of crowd, most people have zero or very limited development
> experience, and it's more perception and brand preference than deep
> technical issues.
>
> But even for the Microsoft fans: the Sony PlayStation Suite doesn't
> give them the full XNA and XBLA tool chain. Microsoft's Xbox and
> Sony's PlayStation platforms are similar but intensely competitive
> rivals, and the fans are strongly divided as well. Much of the
> Microsoft fanbase will choose to develop for Xbox Live and/or Windows
> Mobile rather than a PlayStation/Android SDK. If there's anywhere for
> a viable tool chain alternative to MIcrosoft, this is it.
I think you are dismissing the amount of example code out there in C#
for doing game development.
So, lets turn this around. Why would you have picked a different
platform? Why do you feel that the stuff Microsoft has created is a
bad choice?
I'm very disappointed to see Sony also
promote an all Microsoft and Microsoft only development ecosystem.
Obviously, Sony and Microsoft own the two big video game platforms in
the video game space. Obviously, the Microsoft end of things is based
on an all Microsoft toolset. I'm very disappointed to see Sony also
promote an all Microsoft and Microsoft only development ecosystem. I'm
also disappointed that no other alternative was able to win over Sony,
given that Sony and Microsoft are complete arch rivals in that space.
What would be a game good development platform language/runtime
combination that could beat both C/C++ and C#/Mono and support high
performance, low overhead console-type games?
They said it at the JavaOne strategy keynote, but I believe I heard it
before. Can't recall where though.
I haven't tried C# unsafe, but it definitely looks better than JNI. In
fact, Oracle has openly admitted that JNI was intentionally designed
to be hard to use in order to push people to write pure Java.
One thing you need to be careful with on these benchmarks is memory
usage. Especially targeting the ps3, memory is not exactly free.
Same for throughput of data if you require anything off of the disc.
So, how long does it take to read a meg off the disk and process it as
program data?
In other words, these benchmarks are likely completely irrelevant.
Also, you keep looking at stack allocation and unsigned types. I
think the more important "unsafe" trick is the ability to memcpy into
a struct. The unsigned part is one thing, but actually being able to
say the next "5k bytes from the disc is an array of this struct" is
huge. Well.... I say that. It sounds huge. I could definitely be
wrong. :)
I am willing to bet dollars to donuts that your laptop is a bit more
capable than the machines that are targeted here.
And, again, read what you wrote. You read massive arrays of
*primitives* into memory. Now... what if that primitive was an image
and you'd like to treat it as such? In java, you're hosed. It is
getting copied to the heap. In C#, it appears, you can avoid this
copy and just treat the data as what you know it is. Or, do you think
the answer to writing high performance sections of code is that
everything has to be a primitive throughout your app? (Remember, as
soon as you make it an object in java, it is copied to the heap.) Not
to mention in C# it is just a lot easier to interface with C/C++ code
directly.
> It seems like there is a decided lack of enthusiasm about Java and the
> JVM ecosystem. People are just searching for reasons why it isn't
> good. Does anyone want to see it improve and broaden it's usefulness?
>
I don't know what to tell you. Game developers by and large avoid
Java. I think if you honestly want a good answer as to why, ask them.
It seems rather clear that none of us are game developers. I've
given my overall opinions, but they can only go so far.
And, as much as I used to fear all things Microsoft, I still maintain
this was not a ploy to attract Microsoft developers. This was
acknowledging that toolsets such as Unity3D already exist and have a
C# API. Why not leverage the hobby groups that currently exist?
Also, it isn't like anyone here dismisses the JVM. We just can't
offer any compelling reason why game developers should choose it over
alternatives.
The most important missing feature is having easy to use, embeddable,
micro-VMs. Microsoft .NET doesn't have this, but the Mono guys made
their own implementation of the CLR with this as a primary concern.
There are no legal or technical obstacles stopping this from happening
on the JVM side, it's just no one has done it.
What else do we want from Java: the super IDEs and the build tools. As
I explained earlier, the Java build tools are really at the leading
edge of the industry. And almost every dev I know that has used it
would pick IntelliJ any day over Visual Studio.
"But yes, at least unsigned integer math is coming in Java 8, afaik."
Where did you hear this? Do you have a link? I can't find this on
google.
I think the most promising candidate is the forthcoming Kotlin. It definitely
one ups Java/C# and doesn't require paradigm shifts and I'm hoping it
won't have the compilation speed penalty and runtime speed penalty
that Scala seems to have.
[...]
- Kotlin is a better, more exciting, and more elegant language than C#.
Ceylon:
All languages have two things in common:
Would be nice to get some other _constructive_ criticism instead about believing everything language creators say...
Bye,
Simon
Kotlin:
Very immature, but the browser applet/JavaScript thing is interesting.
- Winner in the category "compiler crashes" with 3 crashes in 20 minutes.
- Syntax-wise almost identical to Scala and getting closer.
- No mailing lists, not open source yet.
- As far as I have understood, it targeted to be "just a language", reusing the Java standard library.
As for Ceylon, it's an Alpha at best. How about giving these languages a couple of years before trying to judge them? After all, Java has a 17 year head start and Scala about eight.
Your constant negativity toward anything that might compete with Scala is quite puzzling. Be more open-minded.
> And, again, read what you wrote. You read massive arrays of
> *primitives* into memory. Now... what if that primitive was an image
> and you'd like to treat it as such? In java, you're hosed. It is
> getting copied to the heap.
Perhaps I didn't understand the point, but in Java you can used memory
mapped I/O and have it accessible outside of the heap.
Honestly I have also other questions. I only had a short experience with
gaming (from the programming point of view) between 1992-1995, across my
primary graduation, when I was writing for fun a flight simulator. It was
DOS time, accessing memory beyond 640K was already a problem and I started
with a drawLine() getting up to the (gamish) simulation of a US
supercarrier getting attacked by a USSR Tupolef Bear. I did all the
primitives by myself, also trying alternate ways than the state of the
art, and I had things that other games of the time didn't have, such as
full 3D cockpits and Doppler effect on digital audio (of course, the
application had never been polished enough for being commercialized, since
it was just fun). So, I have an idea of what pulling the CPU power from
any bit means. But is it today still the same thing? I understand that
games are much more complex, but we have specialized hardware for graphics
and sound... Are really technical the reasons for preferring C# to Java?
Or maybe the reason game developers prefer C# is simply the fact that
Microsoft has created since many years a gaming business segment, and Sun
just didn't?
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
fabrizio...@tidalwave.it
http://tidalwave.it - http://fabriziogiudici.it
On Thu, 19 Jan 2012 04:09:06 +0100, Josh Berry <tae...@gmail.com> wrote:Perhaps I didn't understand the point, but in Java you can used memory mapped I/O and have it accessible outside of the heap.
And, again, read what you wrote. You read massive arrays of
*primitives* into memory. Now... what if that primitive was an image
and you'd like to treat it as such? In java, you're hosed. It is
getting copied to the heap.
Honestly I have also other questions. I only had a short experience with gaming (from the programming point of view) between 1992-1995, across my primary graduation, when I was writing for fun a flight simulator. It was DOS time, accessing memory beyond 640K was already a problem and I started with a drawLine() getting up to the (gamish) simulation of a US supercarrier getting attacked by a USSR Tupolef Bear. I did all the primitives by myself, also trying alternate ways than the state of the art, and I had things that other games of the time didn't have, such as full 3D cockpits and Doppler effect on digital audio (of course, the application had never been polished enough for being commercialized, since it was just fun). So, I have an idea of what pulling the CPU power from any bit means. But is it today still the same thing? I understand that games are much more complex, but we have specialized hardware for graphics and sound... Are really technical the reasons for preferring C# to Java? Or maybe the reason game developers prefer C# is simply the fact that Microsoft has created since many years a gaming business segment, and Sun just didn't?
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
fabrizio...@tidalwave.it
http://tidalwave.it - http://fabriziogiudici.it
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
My impression was that you can do this, but as soon as you pull that
something out of the bytebuffer, it is now on the heap. There are
tricks, of course, you can provide a wrapper around a bytebuffer,
evidently, and always just use getters and setters on the bytes that
you want wrapped. However.... to offer this as some sort of valid
replacement for just being able to define a struct is.... well, a bit
laughable. I mean, Java already gets a reputation for being verbose.
Bean style classes with getters on top of a bytebuffer takes that to a
new level.
> Honestly I have also other questions. I only had a short experience with
> gaming (from the programming point of view) between 1992-1995, across my
> primary graduation, when I was writing for fun a flight simulator. It was
> DOS time, accessing memory beyond 640K was already a problem and I started
> with a drawLine() getting up to the (gamish) simulation of a US supercarrier
> getting attacked by a USSR Tupolef Bear. I did all the primitives by myself,
> also trying alternate ways than the state of the art, and I had things that
> other games of the time didn't have, such as full 3D cockpits and Doppler
> effect on digital audio (of course, the application had never been polished
> enough for being commercialized, since it was just fun). So, I have an idea
> of what pulling the CPU power from any bit means. But is it today still the
> same thing? I understand that games are much more complex, but we have
> specialized hardware for graphics and sound... Are really technical the
> reasons for preferring C# to Java? Or maybe the reason game developers
> prefer C# is simply the fact that Microsoft has created since many years a
> gaming business segment, and Sun just didn't?
Again, just posing the question here is to do so rhetorically. The
reasons are almost certainly partially technical, but not necessarily
because Sun ignored the ball and Microsoft created an environment.
Similarly, there is a reason there were few java applet games compared
to flash. Hell, I struggle to remember any applets of note. There is
certainly no reason java could not have done better there, either.
(There are reasons, but they did not have to be.)
That said, games are much much more complicated than they ever were.
And I'm behind on games. Just really played the first Uncharted game
recently, and even that is enough to convince me that things are
complicated.
> Compared to .NET Java has less predictable performance. For example, I
> wrote a date chooser and my code used quite a lot of anonymous inner
> classes. The first time the user used that part of the application there
> was a noticeable delay due to classloading, that I moved to application
> startup time just so that the user wouldn't see a delay.
>
> It was actually a pretty small delay, less than a second, but in the
> context of an app that normally responds instantly it was visibly slow.
>
> As I understand it, .NET loads an assembly at a time, not a class at a
> time.
I know the problem, but isn't this something that can be fixed with a
customized classloader that does preloading and mimics the behaviour of
.NET?
> My impression was that you can do this, but as soon as you pull that
> something out of the bytebuffer, it is now on the heap.
Correct, but why should you put something out of the bytebuffer? As Kevin
said, a bytebyffer can map e.g. to fast memory such as the video card and
operate there.
> There are
> tricks, of course, you can provide a wrapper around a bytebuffer,
> evidently, and always just use getters and setters on the bytes that
> you want wrapped. However.... to offer this as some sort of valid
> replacement for just being able to define a struct is.... well, a bit
It seems we're shifting the point. I agree that mimicking a struct in Java
is probably laughable, but why should I mimick a struct?
> laughable. I mean, Java already gets a reputation for being verbose.
Verbosity is a different matter than byte code limitations. Here we're
mostly talking about Java-the-VM and not the language.
> Again, just posing the question here is to do so rhetorically. The
> reasons are almost certainly partially technical, but not necessarily
> because Sun ignored the ball and Microsoft created an environment.
> Similarly, there is a reason there were few java applet games compared
> to flash. Hell, I struggle to remember any applets of note. There is
> certainly no reason java could not have done better there, either.
> (There are reasons, but they did not have to be.)
Applets have deployment problems on the internet, but (honestly, I must
admit I've never seen a gaming console) I suppose games are installed as
desktop applications, and there are no problems with that. I'm not saying
that the Sun lack of interest in the segment is the exclusive problem,
but, hell, if you don't push a technology in a segment and your competitor
does, figure out what happens? BTW, for Sony the C# choice couldn't be to
make easier the life for developers that have already large codebases in
C# and want to port to their new consoles?
> I am jumping the gun on Kotlin. For my game dev dream stack, it's
> critical to have a flagship language that is accessible yet provides
> significant incremental improvement and excitement upon Java and C#.
> Kotlin is a credible candidate but obviously, it's not proven at all.
> Scala is definitely a masterpiece from a language design persepctive,
> but I'm not sure it is a great fit for game development.
Talking just on the basis of my limited and previously cited experience
with gaming, Scala would be great, indeed (hell, listen who's saying
this!).
I remember that when I had to implement the controllers for many
subsystems (e.g. missiles, but specifically the behaviour of simulated
pilots) I ended up writing a higher level language (too bad I have lost my
original sources, I don't recall the details). At the time it was done
with yacc etc..., which to me is not specifically fun. Today I'd
appreciate the embedded-DSL capability of Scala, because a) I remember I
needed multiple languages (one for each automated weapon, one for pilots,
etc...), and some "plumbing" to map actions of the language to specific
C++ calls. With Scala I could easily embed multiple languages and there
would no need for plumbing, as I coull call original methods. I'm pretty
sure that if I should rewrite that game today, even though I don't like
Scala in general and I'd rather use Java, I'd study Scala at least for the
DSL stuff.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
> Scala has one critical disadvantage here, it's hosted on the Java
> platform
> and so has to use Java UI implementations.
> This can lead to a lot of nasty frustrating things, try dealing with
> horizontal mouse scroll in Swing for example. It's really no surprise
> that
> Android went and built their own UI layer.
>
There's the new JavaFX 2.0, which I suppose Scala can use without problems.
> "Scala has one critical disadvantage here, it's hosted on the Java
> platform and so has to use Java UI implementations."
>
> Regardless of language, any decent console/smartphone game dev stack
> is going to go straight to OpenGL or something similar. Scala can do
> this, as can just about any language.
>
> Swing, JavaFX, and WPF/Silverlight are mainly for component
> applications made of checkboxes, text boxes, buttons, and grid
> controls... No game developer would ever use these things. The JavaFX
> team is delusional if they think game devs will code to a scene graph
> made for business apps rather than a low level OpenGL context.
I don't expect the core of a game to be made in JavaFX, but what about
menus, configurations, etc?
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
I remember reading a JavaFX team member saying that if
you still want to make your game in OpenGL and not use the FX scene
graph, then they have failed in their goals
> few people are are making or using those type of workstation desktop
> apps any more: GUIs today are almost always either web or mobile.
... guys making web or mobile apps are making web or mobile apps. Guys
making industrial apps are mostly making desktop apps. I think that JavaFX
2.0 is for this, and - apart my previous question - I didn't think it
could be used by core game programmers.
If people could write an OpenGL game in Java/Scala/Kotlin
and deploy to Win/Mac/Linux users *without* the end user having to
install/maintain a system level Java runtime and port the same
codebase into something that can run on Android and iOS and, in a
dream world, PlayStation Vita or Google Native Client, that would be
*huge*. It would take the industry by storm.
You wouldn't believe the horrorshow of doing this via JNI, using javah
to generate header files, add these to the projects build path, write
wrapper in C/C++, write wrapper in Java using System.loadLibrary(). In
other words, while the JVM/Java is about *platform interoperability*,
the CLR/C# is about *code interoperability*. As someone who lives in a
heterogeneous world, recognizing that some tools/languages are better
than others for a given task, I rather like code interoperability.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
Hasn't writing a function in language X and using it in language Y been a reality on the Java platform for a while now?
Just pasting your examples into a new NetBeans project and a new
MonoDevelop project, I can't reproduce your results. I ran this on
Windows, and I think MonoDevelop might be using .NET runtime rather
than the Mono runtime (I don't know - I also had to convert StopWatch
to DateTime to get it to compile):
I'm less interested in debating with C# fanatics. Two others in this
thread are insisting that Java runtime performance is a big
showstopper. After looking at benchmarks, Java is actually running
faster than C#, but I don't really want to debate that, I'm more
interested in promoting a major improvement to client Java.