AlArenal
Posts: 141
Joined: Sun Feb 26, 2012 6:58 pm
Location: Germany
Contact: Website

Re: Rasberry Pi + Java

Sat Apr 07, 2012 11:09 pm

Java is a great language. I learned a lot about design patterns and OOP while professionally working with it. Things I did not understand while playing around with C++, which contains so much bloat. Yes, Java can be efficient and it can perform great, but the standard SDKs and JREs are not supposed to perform great on a rather lightweight platform as we have with the Pi (no pun intended).

Java is – to a certain extend – a beautiful OOP language, but it is not the holy grail of computer languages. When it was designed and implemented some shortcuts have been taken. There's primitive data types that are not classes themselves. Convenient if you look at it from a C perspective, but not a pure OOP approach.

Smalltalk, which served as role model for Java, did not make such compromises. Everything in ST is a class, can be extended at runtime, there are no private classes or variables.

Objective-C shares a lot of the OOP purity with Smalltalk and yet it is a fully K&R compatible breed of C. NeXT took some great design decisions with NeXTStep, the grandfather of Mac OS X and iOS and I'm glad it survived.

I therefore don't comply to SN's aversion to languages that don't compile to machine code. Technically every programming language somehow translates to machine code, they just have different approaches.

I'm glad the Foundation chose to go with Python as 'official' language. It usually is not compiled to machine code (but it can), but the Python devs take pride in designing a rather pure OOP language, not sharing the bloat mentality of others who for ages have been dragging all the old APIs and language features with them for years for compatibility's sake.

Python is good for teaching and learning. It may not be that good in teaching low level programming and concepts. That's the domain of C and Assembler and I can hear (and understand) the critics, that say that all the higher languages have too many abstractions from hardware and therefore make it hard to use graduates as developers in mission critical software, let's say for rockets, satellites, airplanes, cars, … But Python is a good starting point for devs.

Java is widely used, but not so powerful per line of code as Python or Ruby and it's rather hard to teach Java to newcomers, having to introduce lines of code that are necessary to get your program compiled, but are rather unnecessary to learn about programming. The best IDEs like Netbeans and Eclipse are very powerful, but hungry for ressources, especially RAM.

I don't think it's necessary for the Pi to be a good host for Java development. There's better alternatives to teach different programming and language concepts and no, you don't have to bring everything under the dictate of the market. The Pi's aim is to make people fitter, not to create another generation of bots that know nothing of what happens under the hood.

andri
Posts: 51
Joined: Fri Jan 27, 2012 5:05 pm

Re: Rasberry Pi + Java

Sun Apr 08, 2012 5:49 am


Python is good for teaching and learning. It may not be that good in teaching low level programming and concepts. That"s the domain of C and Assembler and I can hear (and understand) the critics, that say that all the higher languages have too many abstractions from hardware and therefore make it hard to use graduates as developers in mission critical software, let"s say for rockets, satellites, airplanes, cars, … But Python is a good starting point for devs.



Java is widely used, but not so powerful per line of code as Python or Ruby and it"s rather hard to teach Java to newcomers, having to introduce lines of code that are necessary to get your program compiled, but are rather unnecessary to learn about programming. The best IDEs like Netbeans and Eclipse are very powerful, but hungry for ressources, especially RAM.

I don"t think it"s necessary for the Pi to be a good host for Java development. There"s better alternatives to teach different programming and language concepts and no, you don"t have to bring everything under the dictate of the market. The Pi"s aim is to make people fitter, not to create another generation of bots that know nothing of what happens under the hood.


+1

Ville
Posts: 8
Joined: Sun Apr 01, 2012 5:55 am

Re: Rasberry Pi + Java

Thu Apr 19, 2012 2:56 pm

I looked at /proc/cpuinfo on my RPi and amongst other things there it displays processor features: swp half thumb fastmult vfp edsp java tls

Does this mean that the SoC has some native support for Java?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26343
Joined: Sat Jul 30, 2011 7:41 pm

Re: Rasberry Pi + Java

Thu Apr 19, 2012 3:11 pm

The CPU support Jazelle I believe, but that doesn't mean that the Java installed will use it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

AlexPT
Posts: 47
Joined: Mon Mar 05, 2012 11:51 am

Re: Rasberry Pi + Java

Thu Apr 19, 2012 4:01 pm

I do hope to program Java on it, at last in the console.

But in a programs like notepad++ or even better eclipse, its more productive.

rmm200
Posts: 259
Joined: Sat Mar 03, 2012 10:25 pm

Re: Rasberry Pi + Java

Thu Apr 19, 2012 5:27 pm

JamesH said:


The CPU support Jazelle I believe, but that doesn't mean that the Java installed will use it.



Never heard of Jazelle before - cool reference. Native execution on ARM processors of Java bytecode!

clunetta
Posts: 1
Joined: Sat Apr 21, 2012 1:59 am

Re: Rasberry Pi + Java

Sat Apr 21, 2012 3:18 am

I teach high school Advanced Placement computer science in the USA. I hope to use RPi to teach Java, where every student leaves class with their own RPi. Java is the language in which students will be tested, so it makes sense to teach using that language. I am currently using Eclipse, but that is overkill for our purposes. The biggest program students need to run is on the order of GridWorld.

rmm200
Posts: 259
Joined: Sat Mar 03, 2012 10:25 pm

Re: Rasberry Pi + Java

Sat Apr 21, 2012 4:15 am

I am delighted to see the AP test based on Java!

I am sure the Pi would do well executing Java programs - although I have not seen that confirmed. That bit about Jazelle might mean performance is great!

I am somewhat less optimistic about using the Pi as a Java development station - although I am hopeful.  Please keep us posted with your progress!

Give extra points for good Javadocs.  A program does not really exist unless it is maintainable, and clean documented code is a big part of that.

And I really hope Oracle does not screw up Java by Ellison monetizing it...

Return to “General discussion”