Need a language that is efficient, readable, easy to use and learn
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Title: The Practice of Programming
Author: Brian W. Kernighan, Rob Pike
Date: February 14, 1999
Publisher: Addison-Wesley Professional
ISBN: 0-201-61586-X
Pages: 288
Categories: programming, language, software engineering
Comments: 4 stars ( 49 reviews Amazon 2008.02 )
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
Quote:
Originally Posted by H_TeXMeX_H
Thanks again for the answers.
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.
Ada is frustrating on *NIX unless you pay big money because *NIX is a C-based OS. All the system interface (header files) is in C. Anything else has to either create a new equivalent header file in the source language you're using or call a C program to get anything done.
Ada is great and powerful and clean for such a huge language, but many common services you need to do anything worthwhile don't have bindings (interfaces) in Ada or if they do they might not be available in a free license (GTKAda, for example) so you have a LOT more work than a C or C++ programmer to get the same job done. If you spend 5 or ten thousand dollars for an Ada toolchain you may be happy on X86.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
Quote:
Originally Posted by PTrenholme
On the other hand, I think I could have coded the same application in APL in a few hours, so maybe you'd like APL. The A+ implementation is available as an RPM in the Fedora repositories, and probably available for other distributions.
APL is NOT a good general purpose language and it's almost useless without an APL keyboard. If you spend your day inverting matrices (or even know what that is) and compressing vectors APL is interesting and fun but otherwise...
With regards to ta0kira's earlier response, I heavily recommend [Common] Lisp. The language itself is full-featured, and amazingly well documented (while at the same time, not taking up much hard drive space).
It took me a while to get around the excessive amount of parentheses, but I realized the reason for it: Lisp = List Processing. Everything is essentially expressed as a list, which further led me to discover that you can be hellishly impulsive with Lisp code, but the language still works you into writing readable, sensical code.
As an example:
Code:
/* In C: Declaring a variable and increasing its value by some condition */
int x = 1;
int y = 2;
int z = 0, sum = 0;
for (z = (x + y); z > 1000000;)
{
if (z % 2 = 0)
sum += z;
x = y;
y = z;
}
;; The same thing in Common Lisp
;;
(let* ((x 1) (y 2) (z 0) (sum 0)) ; declare some vars
(loop ; start an infinite loop
(if (> (+ x y) 1000000) ; if the limit is reached
(return sum) ; then break out and return SUM
(setq z (+ x y))) ; else lexically set Z
(when (= (mod z 2) 0) (incf sum z)))) ; increase SUM by Z if Z is an even number
Granted, the language has some incredibly foreign (if you use ALGOL-based syntax as a reference point) concepts about code structure, and syntax, but once you realize how simple everything is, it really just boils down to "proppuh" (pron. with a British accent) structure - the syntax takes care of itself.
With Common Lisp, if you use the ECL REPL (Read-Eval-Print-Loop; the Lisp shell), it has a built-in Lisp-to-C translator, so you can write Lisp strength code, just to have some of it lost in translation and then compiled to native code.
Lisp does have a COMPILE function in the language standard. What it does is compile your source to a FASL (Fast Load) file where it doesn't have to worry about "macro-expansion time" and all symbols get pre-declared. I realize this makes NO sense right now, but given time and study, it'll be quite clear.
Although Lisp's ANSI library is quite dense (read. Common Lisp HyperSpec), if you want to mess around with similar syntax but a "purer" form, check out Scheme.
Scheme is to Common Lisp, as Assembly is to C. It's a bad analogy, yes, but in theory, Scheme sticks to the building blocks of the language.
PS. Lisp and Scheme are also as high-level, or low-level as you want them to be.
Always a good read: Linus' comments on coding style.
Yes, I've read that too. It helps, but I need more.
Quote:
Originally Posted by makyo
Title: The Practice of Programming
Author: Brian W. Kernighan, Rob Pike
Chapter 1, Style, about 25 pages
Looks pretty good, maybe I'll go look around for it. In the place I'm in now it's kinda hard to find good programming books, but I'll get somehow.
Quote:
Originally Posted by RanduxII
Ada is frustrating on *NIX unless you pay big money because *NIX is a C-based OS. All the system interface (header files) is in C. Anything else has to either create a new equivalent header file in the source language you're using or call a C program to get anything done.
Ada is great and powerful and clean for such a huge language, but many common services you need to do anything worthwhile don't have bindings (interfaces) in Ada or if they do they might not be available in a free license (GTKAda, for example) so you have a LOT more work than a C or C++ programmer to get the same job done. If you spend 5 or ten thousand dollars for an Ada toolchain you may be happy on X86.
Rand
Ah, I see, well that's too bad, it was looking like maybe Ada was close to what I was looking for. Thanks for the explanation.
So far it looks the first thing I'll do is get a refresher on C++ and use that for a while. Must dig up my old programming course books. It's funny, they gave them all away at the end of the course, they said everyone is switching to java next year, got lots of free C++ books (they are a bit old and dusty tho)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.