Subject:
|
Why Java for Robots (was NXT and bluetooth enabled phones)
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 17 Jan 2006 14:58:22 GMT
|
Original-From:
|
PeterBalch <peterbalch@^Spamless^compuserve.com>
|
Viewed:
|
1707 times
|
| |
| |
> Juergen Stuber wrote:
> > it has no garbage collector, e.g.,
> That is the top item on my list to add to Lejos,
> and on NXT it is possible :-)
Why? Full Java requires it but you're not trying to make a full Java
implementation. Why can't all your data be statically allocated by the
compiler (not allocated at run-time)? Sure, you'd have to tweak the
language a little but so what? You're never aiming to run the code
cross-platform.
Forget JVM.
> No, there would have to be a JSR for a tiny real time Java first.
Let's hope it comes Real Soon.
> But you need to be a better more disciplined programmer for C
> than for Java, as it is much easier to mess things up.
Examples please. Java is better than C but how much better?
Anyone who does pointer arithmetic should be shot. If the compiler forces
you to do it for "efficiency" then the compiler-writer should be shot.
Bounds checking should be done at compile-time. If the language doesn't
allow that then the language-designer should be shot. (Is that an extreme
view? How many person-years have been wasted by programmers hunting for
loose pointers? Thousands? Hundreds of thousands? If seventy person years
equals one life then how many lives have been wasted?)
What is a robot sitting on Mars to do if it gets an "out of memory" or
"illegal pointer value" or "array bounds exceeded" error? The first two
should never ever happen in a robot. The last should have been caught by
the compiler.
Counter arguments please ...
Peter
|
|
Message has 2 Replies: | | Re: Why Java for Robots
|
| Hi Peter, (...) there are plenty of other languages, many in research, that sit on top of a Java VM, and the interesting ones need garbage collection (I've been explicitly asked this for Curry :-) ). Also, other kinds of VMs are popular with Lisp (...) (19 years ago, 17-Jan-06, to lugnet.robotics)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|