LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-12-2008, 02:32 PM   #1
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Need a language that is efficient, readable, easy to use and learn


I know it's a tall order, and I've been searching for such a language for a long time, and I'll probably keep searching for a long time to come, until I die without finding it. But, who knows maybe I'll find it.

So, I'm looking for a language which will generate efficient binaries, such as C. So, it'll probably have to be a compiled language as only they can get close. But, I would like NOT to use C, because it really gets on my nerves, I mean it's like it was designed to piss me off, to show me how much I suck, how short my attention span is, etc. It's not, what can I call it, user-friendly, easy to use ... whatever, I just, I really don't like it. I really tried to like it, but I just can't, I also tried C++, took several classes in it, but it's not much better than C.

The language should be readable, I know that most readability comes from comments made by programmers (should they be nice enough to include some), but for example languages like Python and Ruby, which I have tried, are infinitely more readable than C. Now, of course, unfortunately, python and ruby are very inefficient, probably because they are interpreted languages. For example say I wanted to make a game, I've tried many games made with pygame, but they are incredibly inefficient, I can barely run them on my machine (not very new, a P4 machine with GeForce4 graphics card), most are very laggy, when in comparison a game of similar complexity written in C or C++ is way faster.

As for easy to use and learn, well I think it's obvious that python and ruby are easier to learn than C/C++. Now, this ties in with readability, ease of use, user-friendliness, etc.

I know there are quite a few, 'which programming language' threads out there, but I haven't found any answers there.

Does such a language exist ? Anything come close ? It would also need to be available for GNU/Linux as that's the OS that I use, it does NOT have to be portable tho.
 
Old 02-12-2008, 02:36 PM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Well, when it comes to powerful, efficient, and readable - it really is a "pick any two" kind of deal. If you want powerful and efficient, try C. If you want powerful and readable, then maybe perl? Or python. Efficient and readable will likely be c++. Sorry, but your best bet in the long run is to pick powerful and efficient, then get used to it so you get readability as well ;-) .
 
Old 02-12-2008, 02:42 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Pascal may be an option if you like that kind of thing. Or basic. Not
that I'd choose either over C or C++.


Cheers,
Tink
 
Old 02-12-2008, 02:43 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I have been impressed with Python. I learned the syntax and wrote a few simple things, but I'm still green. One thing that appeals to me is the concept of writing the speed-critical stuff in C functions and then calling them from a top-level Python program.

disclaimer: I am not a programmer (IANAP)
 
Old 02-12-2008, 03:14 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
You know, I had a similar problem when I tried learning Russian: It was neither clear nor easy to read. All those strange characters!

Of course, once you study and practice for a while things usually become a little easier.

Like most things in life, you need to "put out" before you can "get back."
 
Old 02-12-2008, 03:23 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Assembler - problem solved.
 
Old 02-12-2008, 03:42 PM   #7
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
My guess is that what you want isn't a programming language, it's two programming languages. First learn Java. It's not efficient at all, but it's relatively easy and readable - think C++ with all the funky operators thrown out and no memory management to deal with. Once you get used to Java, you'll start to ask yourself "Boy, wouldn't it be nice if the language let me do this..., or that...". Then look at C++. When you come from Java, you'll be more than halfway there on the syntax, and the new things you need to learn will be the powerful techniques you were interested in.
 
Old 02-13-2008, 05:17 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Thanks for the comments, it's true maybe what I want is not a programming language (or one that exists), but I'm just hoping that someone developed a language that is still readable much like python but compiles into very efficient code like C. I'm just hoping you know. Anyway, I'll keep looking. I don't think C/C++ is what I want, I've been studying them for quite some time, and I don't quite like them. It feels like they're just not for me.

Anyway, I'll post back if I find something good.

Quote:
Originally Posted by syg00 View Post
Assembler - problem solved.
Ahh, yes, great idea. In fact I did try x86 assembly for a while, but I get a headache very quickly and it seems to be silly to be telling the processor exactly what to do on that low of a level. And the advantages over say compiled C code by a good compiler are minimal.
 
Old 02-13-2008, 10:53 AM   #9
angrybanana
Member
 
Registered: Oct 2003
Distribution: Archlinux
Posts: 147

Rep: Reputation: 21
Using psyco with python gives it a nice speed bonus (depending on what you're doing)

Another option would be to use pyrex. This way the majority of your code will be "readable, easy to use and learn" the system intensive parts will be "efficient"

"Pyrex lets you write code that mixes Python and C data types any way you want, and compiles it into a C extension for Python." - pyrex webpage.
 
Old 02-13-2008, 11:29 AM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by H_TeXMeX_H View Post
And the advantages over say compiled C code by a good compiler are minimal.
Caution: that only holds true if the person writing the
high-level language code (not the compiler) knows what
they're doing ... read Randall Hyde's excellent books
"Write great code" for details.

It's an often reiterated misconception that just because
one uses an "optimising compiler" the produced executable
will be perfect. Think about it - it couldn't possibly:
the compiler makers can't conceivably anticipate every
programming mistake ;}


Cheers,
Tink
 
Old 02-13-2008, 11:41 AM   #11
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by syg00 View Post
Assembler - problem solved.
Yeah that's what I was gonna say. In fact most languages are not really readable unless you spend a lot of time with them. How you code, and how other people code often makes more difference than what language they use. I guess of all the languages I've come across I would have to say Ada is the most readable. It's also one of the most frustrating languages to use in *NIX for many reasons so unless you have big $$$$ for a nice toolset......

Quote:
Originally Posted by TexMex
In fact I did try x86 assembly for a while, but I get a headache very quickly and it seems to be silly to be telling the processor exactly what to do on that low of a level. And the advantages over say compiled C code by a good compiler are minimal.
I don't know about x86 assembler but I really like *not* having some compiler or worse, a scripting language or system like Java doing me dubious favours under the covers. Gimme some patchcords and get out of the way. As to your last comment, it depends on the platform. You can do pretty much anything in *NIX in C because the OS is based on C. You can't do that on IBM's big systems, they're assembler machines. All of the system calls and interfaces are in assembler and PL/X. If you want to start pounding C over there it will be like using Ada on *NIX.
 
Old 02-13-2008, 05:30 PM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, here's my 2 cents worth.
I did C for about 8 yrs, then (now) Perl for about 8 yrs.
Perl is about 80-90% as fast as C (it's sort of compiled on the fly, see: http://www.perl.com/doc/FMTEYEWTK/comp-vs-interp.html for details).
Perl is definitely easier to read/learn in as much as it handles a lot of the micro details for you eg var lengths are dynamic, so no going off the end of buffers/arrays etc.
Whether it's good for games I wouldn't know.
Any serious lang is going to require some serious study ...
The best place to ask about Perl suitability is here: www.perlmonks.org
 
Old 02-14-2008, 08:12 AM   #13
lali.p
Member
 
Registered: Jan 2007
Distribution: Slackware 11.0
Posts: 141

Rep: Reputation: 16
Wow i am surprised

Hey H_Tex_Mex Man i am surprised. I thought you were a great programmer.

In fact for past few months even i have been trying my hand at C++ to be in the league of guys like you and you saying you don't like C++

C++ is a great language yummmy yummy!!!
and i guess ta0kira is a very learned member :-p
 
Old 02-14-2008, 08:30 AM   #14
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Thanks again for the answers.

Quote:
Originally Posted by angrybanana View Post
Using psyco with python gives it a nice speed bonus (depending on what you're doing)
Yeah I know, I've used psyco for some time, but I have to tell you that it doesn't always work properly, at one point something probably went wrong during the process and the python application kept crashing when I tried to load it. I found that strange, because this never happened before and it was now happening constantly. Well somehow I got the idea that psyco may have messed up in the partial compilation process, so I edited the python script to stop using psyco and deleted the byte-code, and then it worked, it no longer crashed. Now, this is rare, this only happened once. I also hear that PyPy will replace psyco and you may one day be able to fully compile python code. I think they even said you can do it now, but it takes forever and the results aren't always the best. I'll be looking into it tho.

Quote:
Originally Posted by Tinkster View Post
Caution: that only holds true if the person writing the
high-level language code (not the compiler) knows what
they're doing ... read Randall Hyde's excellent books
"Write great code" for details.

It's an often reiterated misconception that just because
one uses an "optimising compiler" the produced executable
will be perfect. Think about it - it couldn't possibly:
the compiler makers can't conceivably anticipate every
programming mistake ;}
Yes, I know, the executable will never be perfect, but I mean when you weigh having to write a program in x86 assembler versus writing it in C (not to mention that one will not be at all portable), and then weighing the outcome, I don't think writing many things in assembler will have a good cost/benefit ratio. Probably if you need something to run as fast as possible you should write that part (as little as possible) in assembler, but I think you can already do that within C, to add bits of assembler in critical areas of the code where great efficiency is needed.

Quote:
Originally Posted by RanduxII View Post
Yeah that's what I was gonna say. In fact most languages are not really readable unless you spend a lot of time with them. How you code, and how other people code often makes more difference than what language they use. I guess of all the languages I've come across I would have to say Ada is the most readable. It's also one of the most frustrating languages to use in *NIX for many reasons so unless you have big $$$$ for a nice toolset......
Actually, I've been looking into Ada recently, and it's very readable. But, why is it frustrating to use in *nix ? I'd like not to have to spend too much money, especially on a toolkit.

Quote:
Originally Posted by chrism01 View Post
Well, here's my 2 cents worth.
I did C for about 8 yrs, then (now) Perl for about 8 yrs.
Perl is about 80-90% as fast as C (it's sort of compiled on the fly, see: http://www.perl.com/doc/FMTEYEWTK/comp-vs-interp.html for details).
Yes, Perl fits in with Python and Ruby, it compiles into byte-code or parse-tree or whatever it might be, then an interpreter reads that and relays to the processor what must be done. Probably you may be able to write a game in perl, but not more than a text game or simple graphical game. The problem is that pretty much only C or languages that come close to being as theoretically efficient (assuming the programmer is very good at what they do) as C can be used to make a 3D game or even a decent 2D one. Am I wrong ? And it's actually very difficult, it takes a lot of work by a lot of people constantly revising, rewriting, testing, debugging, enhancing, etc. At least this is true for the engine, but then you need artist too to make then art, and damn it's a lot of work.

Now, I'm not specifically wanting to make a game. What I was thinking was more like:
So I know some python, bash, C, C++, basic. However, I'm not specialized in any of these languages, the most I even code are small utilities to make my life easier. I just find it difficult sometimes to write a program in bash or python that will do things efficiently, then I'm stuck writing much of it in C or C++, which I don't like to do because it requires lots of debugging (lots !). So, I was thinking, why not learn a language that does both, one that is readable, easy to use, efficient, therefore requiring less debugging because the language won't let you make stupid mistakes like leaving off an & and then the resulting program segfaults, and then you use gdb to find out where, and then figure out why and then figure out how to fix it, and then recompile and find yet another bug ... this happens with C and C++, but much less often with python, if ever (and certainly not with bash).

Quote:
Originally Posted by lali.p View Post
Hey H_Tex_Mex Man i am surprised. I thought you were a great programmer.

In fact for past few months even i have been trying my hand at C++ to be in the league of guys like you and you saying you don't like C++

C++ is a great language yummmy yummy!!!
and i guess ta0kira is a very learned member :-p
Who, me ? Well, in all actuality I'm not a bad programmer, I'm just pissed off at myself for making so many mistakes, but I blame it on C/C++, because they let me make so many mistakes.

Last edited by H_TeXMeX_H; 02-14-2008 at 08:32 AM.
 
Old 02-14-2008, 11:12 PM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
It would be interesting to know what you mean by
'I just find it difficult sometimes to write a program in bash or python that will do things efficiently, then I'm stuck writing much of it in C'
What sort of things are you getting stuck on, and why would it be that much more efficient in C?
If it's just for yourself, you can use any lang to write any 'app', but in work you'd ideally choose the most appropriate, recognising that programmmer time is expensive compared to machines theses days (inc debugging mistakes).
IOW, it'd probably be bash for short ctrl scripts, then Perl/Python etc for major stuff and C/assembler for writing your own OS/device drivers.
Maybe you just need to learn a P* type lang thoroughly ie at least as well as you know C...?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What was your first language to learn? vashsna Programming 21 06-11-2007 07:04 PM
what language is best to learn io13 Programming 4 07-09-2006 09:17 AM
What Language Should I Learn? KungFuHamster General 45 04-25-2006 02:10 PM
Which C language to learn? Heiland Programming 10 08-14-2005 08:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration