Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
In response to a question about examples of Java usages, I bumped across some articles where NASA used Java for ground control in a mission to Mars but I couldn't find out if it has ever been used outside of Earth. Do you know of any such instances?
Here you will find a paper discussing the current state of using Java in space applications:
REAL-TIME JAVA IN SPACE: POTENTIAL BENEFITS AND OPEN CHALLENGES
They say:
In short time, it is unlikely that
with current Java implementations the
whole spacecraft on-board software
could be written in Java. However,
Java could be used as an isolation
platform for software that has not
been assigned the highest criticality,
while the critical code would still be
written in Ada or C.
Here one of the same authors reports on a successful test flight of an unmanned aerial vehicle (UAV) that uses Ovm (open source RTSJ (Real Time Specification for Java) implementation):
A Real-time Java Virtual Machine for Avionics
One fact often overlooked is that most space probes use older processors. They simply cannot run current commercial software. They are not fast enough or powerful enough. IC chips in space are exposed to high levels of cosmic rays. They energetic particles can destroy the small nanometer components on modern CPUs and other IC chips. To work reliably in space you either need specially designed ICs with redundant components, spend a lot on heavy shielding, or use older IC chips which have larger components that can take a hit from a cosmic ray without being destroyed.
Most of these older CPUs will run with a RTOS such as VxWorks and are either programed in assembler or using a language like C and still get decent performance.
Probably on the documentation laptops they take up there on the Shuttle, at the very least.
Java is also mentioned here, which implies that there is at least Java code that can talk to some spacecraft, if not actually run on them: http://www.dtnrg.org/wiki/Code
According to this article, the Ground Operations Center uses it for 3D Mapping and Planning. A comment on this forum claims the Mars Lander runs VxWorks.
Edit: Confirmed by Wind River, the Spirit and Opportunity run VxWorks RTOS. No other references where Java has been explicitly used in Space.
I think I read a few years ago that some probe or satellite used Java as part of their analyzation equipment but I doubt that mission critical software will be developed in Java today.
However: With all the applications used by astronauts on their Laptops I wouldn't be surprised if there were applications written in Java. Maybe some locally installed webapp that is used as a bugtracker.
I cannot speak with any authority with respect to the software onboard spacecraft, but I can say definitively that Java is used by NASA (or its affiliates) to handle the data from the various missions. I recently worked at a laboratory for space physics, which handled data and telemetry for in-orbit spacecraft, and the development team (of which I was a part) worked almost exclusively in Java.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I know that similar questions have been asked before, but...
We want to develop (at least hope) an indie game but still a game with high quality graphics with hundreds if not thousends of moving objects on the screen so we expect very high number of polygons and requirements for hittest and perhaps some AI.
I know the basic problem with java is garbage collection. But it's not an issue, we plan to allocate all of the required memory before the game starts and for transient objects we will use pooling (so in the game loop the new keyword will never be written). And we plan to use every possible techique mentioned here (Google I/O 2009 - Writing Real-Time Games for Android).
The main reason we insist on Java is deployment and we only want to develop for Android (for now at least)
So can the same performance in a game be achived with Java (even if that means ugly/not idiomatic code) as if we did it with c++. If not, what are the specifics? Or perhaps if it's possible but very-very unpractical what are these reasons?
(For example I read something about java Buffers and OpenGL are not the best pairing but don't remember the specifics - maybe some expert)
You're going to be paying a fixed additional cost per call to use OpenGL from Java source code. Android provides Java-language wrappers around the calls. For example, if you call glDrawArrays, you're calling a native method declared in GLES20.java, which is defined in android_opengl_GLES20.cpp. You can see from the code that it's just forwarding the call with minimal overhead.
Nosing around in the file, you can see other calls that perform additional checks and hence are slightly more expensive.
The bottom line as far as unavoidable costs goes is that the price of making lots of GLES calls is higher with Java source than native source. (While looking at the performance of Android Breakout with systrace I noticed that there was a lot of CPU overhead in the driver because I was doing a lot of redundant state updates. The cost of doing so from native code would have been lower, but the cost of doing zero work is less than the cost of doing less work.)
The deeper question has to do with whether you need to write your code so differently (e.g. to avoid allocations) that you simply can't get the same level of performance. You do have to work with direct ByteBuffer objects rather than simple arrays, which may require a bit more management on your side. But aside from the current speed differences between compute-intensive native and Java code on Android, I'm not aware of anything that fundamentally prevents good performance from strictly-Java implementations.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am looking for an answer to a question relating to programming and robots..
I have been learning java over the past 2 years, and just recently started working with and Arduino microcontroller for a robot that is near completion(2 servos, 1 ultrasonic sensor, 2 parallax servo-controllers, 12v battery, all in a toy car that i ripped apart).
I was hoping to build a much more complex machine that would do all of the following:
Control 4 servos that would move treads
Powers a few cameras, possibly relaying several feeds to a monitor or pc wirelessly to help with user-controlled movement
Control a pan-tilt servo system for a top mounted camera or paintball/airsoft gun or some such similar device
Maybe a gps system, so that having it can return to the user when low battery, or when the user is done controlling it( NOTE: Not a necessary component, but would be very nice)
My Question is this: What microcontroller or controller do you know of that could be used to control all of that effectively, and not be maxed out(Also hoping that the suggested could control multiple systems at once)? What programming language would effectively be able to control all of the above robot effectively(or is great for this type of system in general)? Does the programming language that must be used change depending on the microcontroller?
There may be more to that, but currently, the base at minimum must be built before I can go anywhere else. My budget is not large, and would prefer to keep this cheaper than $1000-$1500 excluding the mounted tool on top.
I'd say you should take a look at the Raspberry PI for the time being. It cannot do it all alone, you will have to combine it with a real micro controller as io expansion.
The raspi is cheap, and got a strong community, easy to get help when you are stuck.
For micro controller I would chose an ATmega328 from Atmel (~$4 on ebay). with that one you can stay Arduino compatible, which again has a super strong community.
I know the newer BeagleBoneBlack will be able to handle both tasks in one unit, but the product seems to be a little less mature right now, and the community is nowhere close to raspi or arduino!
Over at LetsMakeRobots we are building robots too, some even as advanced as your project, you might find some inspiration. And there are definitely some motor driver geeks there!
You're looking for an Arduino with an Adafruit motor shield to start with. I won't post a link to either due to the commercial nature but that will put you in the right direction. I'm not sure Stackoverflow is the right place to ask this question though. You may have much better luck elsewhere.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
This is more of a general programming questions about a GIANT performance issue I have seen..
Basically I'll use two common programs for an example - Eclipse IDE & Newsbin (usenet client)
On my Windows 7 Machine, Eclipse is so sluggish it's almost painful to use and this is built on the java platform right?
Whilst Newsbin, on the same machine, can handle hundreds of thousands of header information and literally NEVER lags.. It's one of the most responsive programmed I have ever used..
So, is there any chance someone could shed some light on which language/platform Newsbin is built upon? I'm curious because I want to expand my skills into desktop applications and there seems to be such a massive difference in performance.
Apologies if this type of question shouldn't be posted here, but it is 'linked' with programming and I would very much like some feedback/answers.
Thanks.
There are many reason the performance could be different. It is most likely a tuning problem or you hardware doesn't suit the application. I use IntelliJ CE (another IDE like Eclipse) and it caches a lot of information about the Java classes it uses. It does this to provide rich refactoring/search capabilities. This can result in enormous amounts of disk activity if you don't have lots of free memory (to cache the disk data). I use a machine with 48 GB of memory and it almost never lags (at least not when I am the only one using it)
My guess is that newsbin of keeps the most essential information about each post and avoids having to cache lots of information about each article. i.e. its has a completely different use and usage pattern.
The performance between the two is most likely not the platform but the fact that the two are very different application.
Second, two version of the same program can be vastly different. You can create a slower Newsbin type application in the same platform that your Newsbin's application uses.
You're comparing apples to oranges: these two programs do completely different things and the performance difference probably has nothing to do with the underlying platform or language.
Also, keep in mind that Eclipse can be fast by itself, but you can ad plugins to it, and poorly written plugins can slow it down horrendously.
Remember: no matter what language you're using, you can always find a way to write code that is poor enough to make a program feel slow and unresponsive.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I just got myself an android phone and I'm dying to start coding on it !
However I'm not a big java fan, although I can live with that, I would like to know if there're reasonable alternatives for the android virtual machine.
I've done a medium sized project using clojure, however from the reviews I read, it's very slow when running on android. How about scala ? I read that some people did experiments with it in android, is it "fast enough" ? How big is the learning curve ?
Cheers,
Ze Maria
There's the NDK which allows you to write parts of your program in C or C++.
There's ASE that allows you to write scripts in python and maybe other languages. There's no python compiler despite you might hear otherwise.
I have read something about scala but since I wasn't really interested I did not pay attention.
There's definitely quite a few people doing Android development in Scala. Of particular notice, there's even a plugin for SBT, the prefered builder for Scala projects, with Android-specific targets.
As for learning curve, I can't speak for Android development itself, as I haven't done that. As for Scala, you can be productive very quick, but learning all the particularities of the language takes time. You don't need to learn all the particularities -- I have seen people write non-toy programs with barely any experience -- but some people can't stand not knowing something about the language they are using.
Also, a lot of Scala code out there is very declarative. If you look at the SBT build files, for example, they are mostly declarative. Some people get very upset by that, for some reason.
I'm guessing what I'm trying to say is that it depends mostly on you how well you'll take to Scala.
As for speed, Scala code can be as fast as Java code, though that may call for avoiding the more high level abstractions in exchange for uglier, but fast, code. It depends a lot of what kind of computation you are doing, though.
Android 2.2 adds jit to the VM which is supposed to make loading Clojure programs much more efficient. Clojure produces a lot of small classes which take a while to load when the android program starts up. this should be alleviated with the enw android though its not intolerable now.
Just noticed that some Scala examples can be found in trunk: http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/docs/android-examples.
I haven't tried myself but it's encouraging.
There's a port of JRuby to Android, as well, which I've played with and seems interesting. http://ruboto.org/
"fast enough" - you are running applications on a mobile phone that question relative to what you expect it to do.
Also java's performance has been increased through the years. But also run you are just coding in java. Google has created a tool that take java byte code and converts it to .dex (Dalvik Executables). Dalvik the VM implementation that java used is optimized for this platform. Which mean you can program in a high level language like java which provides many helper classes which means you will be more productive.
They do have a NDK but I believe you have to still have a java front end and have your java code call the NDK code when necessary. You pretty much only want to write the native code when you really need to optimization. Alot of java classes like java nio and the opengl classes are just wrappers to low lever calls that use hardware resources directly.
I probably over answered you question a little.
There is also Lua, which you can use with the Corona SDK.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I was reading item #6.10 on http://www.cafeaulait.org/javafaq.html and I began wondering how the big players go about creating their own implementation of a JVM. Would an experimental something or another be possible (and feasible) for one guy?
technically, all the information people need to create a new JVM is in the public specifications for the language and the targetted platform. A JVM would need to behave differently depending on whether it is meant to run on a desktop computer or a mobile phone, even if the bytecode interpretation would be largely identical.
A few places to start looking for information:
http://en.wikipedia.org/wiki/List_of_Java_virtual_machines
Reading The "Java Virtual Machine Specification" by Tim Lindholm
http://www.jcp.org/en/jsr/detail?id=30
From what I have seen of JVM implementations by Sun, IBM or smaller companies like Esmertec, writing a simple JVM is a several man-months project but adding JSR after JSR to support more functionality can take years afterwards.
Now, if all you need is a simple bytecode interpreter, it's not that bad, but it's still quite a bit of code to write.
A handmade JVM would be a great way to learn about virtual machines in general, the issues of program language design (through the JVM spec), and the nitty gritty of parsing and so forth.
If you choose to take it in that direction, you could also explore optimizations, which is where it can get interesting, and you can take research papers and implement their algorithms.
That being said, if you're less interested in the long and arduous task of creating a VM from scratch, you might want to modify an existing open source VM like Kaffe. It will show you what a virtual machine does, but not necessarily how Java code works in Sun's JVM:
Kaffe is a clean room implementation of the Java virtual machine, plus the associated class libraries needed to provide a Java runtime environment.
This way, you could study the details, but dive in to implementing more interesting features.
I understand that, currently, the big players license the Java library from Sun. They then add their own refinements. The main difference between implementations is the bytecode->machine code compiler.
For one thing, you may want to have a look at Apache Harmony They have come a long way, so their project history may actually give you a good idea on the effort required. I myself would not bet on it being feasible for one guy