Language Conundrum

Member
Posts: 43
Joined: 2009.02
Post: #1
I always get stuck in these little pickles. But this time I'm serious.

I need help. What language should I pick up? I know Ruby, and have been working with it on and off, and I know the basics to do a hello-world in C/Cpp. I also know a bit of ObjC, Lua, Lisp.

I would like something a --LITTLE-- lower level than Ruby, something that can utilize OpenGL and/or SDL easily. Something thats faster than Ruby, and something that is cross-platform.

I do not want to use C++ or C. I mean, I guess if I had to. But please no! =D

Any help?
Quote this message in a reply
Member
Posts: 254
Joined: 2005.10
Post: #2
Why not use ruby with objective-c on mac os x? Anything that's too expensive to do you can switch to doing in objective-c really easily. Anything that's a bit slow in objective-c can use c. That way you trade expressiveness for performance. Using the profiling tools will help you figure out what needs fine tuning.
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #3
Keep working with ObjC if you want to stay with the Mac/iPhone its a good place to be.

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #4
TimMcD Wrote:I always get stuck in these little pickles. But this time I'm serious.

I need help. What language should I pick up? I know Ruby, and have been working with it on and off, and I know the basics to do a hello-world in C/Cpp. I also know a bit of ObjC, Lua, Lisp.

I would like something a --LITTLE-- lower level than Ruby, something that can utilize OpenGL and/or SDL easily. Something thats faster than Ruby, and something that is cross-platform.

I do not want to use C++ or C. I mean, I guess if I had to. But please no! =D

Any help?
I think you are on a very good track. Just like the page by OneSadCookie wrote (http://blog.onesadcookie.com/search/label/languages), you are questioning your tools and try new ones. Try everything! OK, we only have that much time, but you can at least try a good handful other options, the most promising ones.

If you are perfectly happy with C++, nobody is forcing you, but do you really know why you like it, do you know that it is the best for you? But when you are not happy with it you definitely should look at alternatives. Even if the conclusion is C/C++, you will know why you are there. For games, how about Lingo? (If you have the $$$.) GameMaker?

I know many languages, some I havn't used in many years though: Basic, Z80 assembly, DIL, 6809 assembly, 68000 assembly, Pascal, Simula, LISP, C, C++, Cobol, Fortran, Modula-2, FORTH, Oberon, Lingo, Java, VHDL, GLSL... and then some. And I also know some ObjC, Ada, Algol, PHP, HTML and even a little MHEG. I can't really say I know Python, but I like its indentation based syntax. I don't know Ruby at all. I skipped Ruby and Python since they had poor performance. I will learn them the day I have a good reason, but I think it is more in my line to learn C# and D, and deepen my Ada and ObjC knowledge.

Some of these are useful, some I wouldn't touch today. Assembly language is not productive. Basic is not so bad, can be useful if you find a good implementation, but AFAIK it isn't well standardized. Pascal, Simula, C and many others are all Algol ripoffs, which makes much of those languages easily ported to each other. We all use Algol without knowing it. Smile But it is pretty close to impossible to use the real Algol today.

I wrote most of my early games in Basic and assembly. I learned the basics of Pascal, but they only taught the old-style Pascal so it was close to useless. I went to Modula-2 and it was pretty nice. People said C was the "right" choice so I went for that for serious programming for quite some time. Then a friend had a fun Pascal program (a role-playing tool) that we thought could be fun to compile for the Mac. I was amazed with how much faster I coded Wow, the bugs almost fixed themselves (since Pascal is a much safer language). So I went to Pascal and used that for quite some time, wrote SAT and many games with it.

But Pascal was fading out, for one single reason: Lack of portability (back then that is). The big players (Adobe etc) wanted their programs to be portable, they wanted Photoshop for WindowsHuh with the same code base. So the big money went to C++. When Metrowerks discontinued Metrowerks Pascal, there was no bright future for Pascal on the Mac so I had to abandon the Mac or switch language. I tried both, made one Pascal project for Windows, and for the Mac I switched to Java and C.

After a few Java projects I had had enough. Awful language, slow, carries unnecessary C legacy in the syntax, hairy class libraries, and worst of all, religious. Wacko The general idea with the language is the assumption that you work better with the left hand, thus you should cut the right one off. (That is, OOP is assumed to be the right and only solution to Life, The Universe and Everything so you must only use that.) And if everybody get their right hands chopped off at birth, people will eventually accept having only the left hand, that is using Java. To me, OOP is a tool, just fine when used properly, but not a religion! Mad

Case in point: I was using Java 3D in my graphics courses, by recommendation by other teachers.Huh It just didn't work well, so the next season I allowed the students to pick either Java/Java3D or C/OpenGL for their projects. I still only taught them Java3D, not OpenGL, so the easiest path still should be Java3D. The OpenGL projects crushed the Java3D ones Wow, making much, much better results in less time! I promptly scrapped all Java3D stuff and made OpenGL lectures and labs instead, and it got soo much better!

So I focused on C, primarily with OpenGL, and added GLSL to the bagSmile. I did some VHDL too for a while. I liked this a lot better, but too often I found myself back in the slower pace I had had when using C in the past. Again I struggled with a language that made me make mistakes.

Then FPC 2.0 came around, a modern Pascal, portable, fast, heavily updated with modern features, all or most old flaws fixes.Smile For some time, poor IDE support was a problem, but now there are no less than three IDEs supporting it (four if you count the Xcode integration kit). The most important one may be Lazarus, a portable Delphi clone. Lots of interfaces, OpenGL, SDL (Jedi-SDLRolleyes), Cocoa (PasCocoa), Unix calls...

I ported my most vital OpenGL code to FPC, replacing clumsy C arrays by FPC dynamic arrays, and wow... everything got nicer, smaller, cleaner. I still use C a lot, but FPC is what I personally find productive.

"a --LITTLE-- lower level than Ruby, something that can utilize OpenGL and/or SDL easily", that sounds exactly like FPC to me. IMHO.

So FPC is worth considering, but of course you should try other alternatives too. The choice of tools should be made on good grounds. I am happy to know Java, so I know why I avoid it. I can't be without C in the toolbox, I don't really like the language (it is a hack) but I use it as needed. A Cocoa book is in my bag for further studies. Python and C# is on my to-do list, and so is Lazarus. I will learn more, and I might move again. All that matters is what gets the job done, what makes me productive and feel good (two things that are closely coupled).

Sorry for the looong posting. I couldn't stop.
Quote this message in a reply
Member
Posts: 86
Joined: 2008.04
Post: #5
I agree with Kyle - Objective-C has some of the messaging semantics you have used in Ruby...It performs well, and it works great on the iPhone, iTouch, and Mac.

As far as books, new version of both Hillegass and Kochan were just released and should get you started:

http://www.amazon.com/Programming-Object...pd_sim_b_7

http://www.amazon.com/Cocoa-Programming-...pd_sim_b_1
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #6
Interesting language commentary Ingemar. I don't know anywhere near that many languages. I haven't touched Pascal since like OS 8.6? Anyway, I don't miss Pascal, and I definitely like C. Objective-C is absolutely fantastic. You should definitely jump into a Cocoa book for a few days.
Quote this message in a reply
Member
Posts: 43
Joined: 2009.02
Post: #7
I would be perfectly happy with MacRuby (Or so I think...) if only I could use the latest versions...

10.5 intel only, and I have:
10.4 intel mac mini,
10.5 ppc (upgraded) powerbook G4...

Yeah, I need a new computer. Pascal seems interesting, I'll have to look into that.
Thanks guys! ^_^
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #8
If C is good for you, no problem. But a main point with this thread is where to go if it doesn't feel right. I know that a lot of people are uncomfortable with C and its relatives. They should look into the alternatives. I don't believe in "one size fits all".
Quote this message in a reply
Member
Posts: 43
Joined: 2009.02
Post: #9
I don't believe in 'one-size-fits-all' when it comes to languages either. And I wasn't saying I was comfortable with C/C++, I was saying that I would rather not have to work with them.

Right now I'm trying out Pygame.
Quote this message in a reply
Member
Posts: 24
Joined: 2008.02
Post: #10
Check out Panda3D. I've messed around with it, and it seems like a really easy to use framework for Python games, complete with model loading and built-in ODE physics.
Quote this message in a reply
Member
Posts: 43
Joined: 2009.02
Post: #11
I was looking at that, but 2d seems to be more my thing (atleast, for now). Wink

I got MacRuby to compile; I'll use it and OpenGL (Maybe SDL, I don't know if I can access SDL from MacRuby tho, I'll have to see...)
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #12
Oh jeez, stay away from Pygame. Use Pyglet instead.

My web site - Games, music, Python stuff
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #13
diordna Wrote:Oh jeez, stay away from Pygame. Use Pyglet instead.
Can you say a few words about why?
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #14
The nice thing about MacRuby is the ObjC runtime integration, so you almost always can chose to write a given class or even method in either ObjC or Ruby. This means rapid prototyping in Ruby, and if performance should ever become an issue, seamlessly moving slow code to ObjC/C isn't a problem.
Quote this message in a reply
Post Reply