I am ordering a Raspberry Pi, and I was wondering which language is best for programming games, because I want to program and cannot decide which programming language to use. I am thinking either Python or C++ but I cannot choose. Ideas?
I am ordering a Raspberry Pi, and I was wondering which language is best for programming games, because I want to program and cannot decide which programming language to use. I am thinking either Python or C++ but I cannot choose. Ideas?
Python is a great choice for starting out.
Depending on what your goals are, you might want to check out Scratch.
Python is a great choice for starting out.
Depending on what your goals are, you might want to check out Scratch.
I was thinking more along the lines of Minecraft or Legend of Zelda type games (the origionals). I have heard python is very easy to program in and I was wondering if the speed of C++ execution is worth the extra time in development. I can learn new languages quite well as I taught myself OpenGL and half taught myself JAVA.
Awesome, in my opinion, OpenGL will be the hardest part.
As a shameless plug, I'm writing a C++ tutorial.
C++ seems like a great language, but is it really as fast as people claim? (I am not going to use JAVA because I strongly dislike the garbage collection)
Because c++ is compiled to byte code and python is an intpreted language, c++ will be faster for a comparable program. Sometimes the difference can be dramatic, other times it isn't that big of a deal.
When it comes to performance, it is usually more about how you implement something rather than the language that you write it in. Usually, the best way to go about things is to get a working prototype and then worry about making it faster/better. So, I would concentrate on getting something that works how you want it to, and then find ways to improve it.
"concentrate on getting something that works how you want it to"
That really is the most important thing. I must though correct you on you terminology.
C++, on most platforms, is a compiled language that turns source code into machine code not byte code. Java is compiled to byte code for example. Machine code is specific to a single processor architecture (x86, ARM etc.), byte code is normally an abstract representation of machine code that could be executed on any cpu with the right runtime system. That said CPython, which is what is on the Pi, uses a "byte code virtual machine" meaning that it really is not an interpreted language in the traditional sense.
I am not going to use JAVA because I strongly dislike the garbage collection
Well jds123 then you won't like Python either as it also has a garbage collector. What are you writing that is so mission critical that you need to bother worrying about memory allocation manually?
Well in JAVA it removes unused variables quite inefficiently which causes lag. Also I think it would be good to learn how to deal with manual garbage collection, because it will allow me to make my programs more efficient for slower devices so it can run efficiently on slower devices such as the RasPI
Hi.
I bought Pi to return to machine-level programming: I'm not an E.E., so I don't care anytthing about the hardware.
I started out writing compliers and operating systems in the 60's: note: not USING compilers and operating systems, but writing them from scratch.
What language is supported by Pi that I could use to get back to basic machine-level programming? I don't really care if it's compiled or interpretive: simply what is an appropriate, supported language for Pi as of 3/1/2013? and where do I get it and information / documentation about how to learn and use it?
Thanks:
Bob McConnell
P.S. Remember Stretch?
Hi Bob,
Yes, remember Stretch and Harvest and compilers written in assembly language.
Are you wanting a recommendation for an assembly language, or for a high-level
language? There are lots of languages available. C is pretty low level if that's what
you're looking for. Python is a more modern interpreted language. Javascript is
interesting to learn for creating interactive web pages.
There is a list here:
http://elinux.org/RPi_Programming
Since you aren't interested in the hardware, you should also consider that a PC
would have the same languages available, but with better performing development
environments.
Robert McConnell wrote:
I bought Pi to return to machine-level programming: I'm not an E.E., so I don't care anytthing about the hardware.
I started out writing compliers and operating systems in the 60's: note: not USING compilers and operating systems, but writing them from scratch.
What language is supported by Pi that I could use to get back to basic machine-level programming? I don't really care if it's compiled or interpretive: simply what is an appropriate, supported language for Pi as of 3/1/2013? and where do I get it and information / documentation about how to learn and use it?
It sounds like ANSI C is your best bet, since C lets you work close to the machine while using high-level notations. The standard RasPi OS includes "gcc", the GNU C compiler. (Strictly speaking, GCC stands for GNU Compiler Collection, but I think the RasPi binary has only been configured for C and C++.) For learning C, there's good old Kernighan and Ritchie though others may have better suggestions. GCC documentation is available for free (as in liberty) at http://www.gnu.org/doc/doc.html
GCC includes an assembler "gas". I haven't use it myself, so I don't know how much it diverges from standard ARM assembly language. There are some good threads on ARM assembly language at raspberrypi.org. Search for "ARM assembly" in the Google search box on the front page. This thread has some good pointers to ARM assembly resources: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=2&t=2910