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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
|
View Poll Results: The best languages?
|
|
PHP
|
  
|
23 |
18.40% |
|
Perl
|
  
|
33 |
26.40% |
|
Python
|
  
|
43 |
34.40% |
|
Ruby
|
  
|
13 |
10.40% |
|
C
|
  
|
86 |
68.80% |
|
C++
|
  
|
53 |
42.40% |
|
Java
|
  
|
37 |
29.60% |
|
Lisp
|
  
|
14 |
11.20% |
|
Erlang
|
  
|
4 |
3.20% |
|
Smalltalk
|
  
|
4 |
3.20% |
|
Haskell
|
  
|
9 |
7.20% |
|
C#
|
  
|
10 |
8.00% |
|
Lua
|
  
|
6 |
4.80% |
|
COBOL
|
  
|
3 |
2.40% |
|
Scheme
|
  
|
6 |
4.80% |
|
Go
|
  
|
1 |
0.80% |
|
Groovy
|
  
|
2 |
1.60% |
|
Fortran
|
  
|
10 |
8.00% |
|
R
|
  
|
6 |
4.80% |
 |
|
07-29-2010, 03:23 AM
|
#76
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
ruby is quite, er, slow.
|
|
|
|
|
Click here to see the post LQ members have rated as the most helpful post in this thread.
|
07-29-2010, 11:57 PM
|
#77
|
|
Member
Registered: Jun 2010
Distribution: Fedora
Posts: 289
Original Poster
Rep:
|
http://www.thebuzzmedia.com/ruby-19-quick-speed-test/
Quote:
|
Now, it is no news that 1.9 is faster than 1.8, but an 8x improvement on this simple recursive script? I was astonished! This is better than using XRuby to speedup Ruby performance!
|
http://programmingzen.com/2007/12/03...ruby-shootout/
Quote:
|
Ruby 1.9 confirms itself as a fast implementation, about three times the speed of 1.8.6 which is going to replace it in 3 weeks. Ruby 1.9 (Yarv) is still the fastest of the lot in most tests, but others are clearly catching up. We have been waiting for a long time for this version of Ruby and it’s sure not to disappoint. A great Christmas present for Ruby lovers.
|
NOTE^ I'm sure they meant "which it is going to replace in 3 weeks."
Last edited by pr_deltoid; 07-30-2010 at 12:03 AM.
|
|
|
|
07-30-2010, 03:51 AM
|
#78
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
Completely ignore my previous comment.
I updated my ruby to the 1.9 version and
I can confirm that ruby is no longer slow.
my personal test is to shuffle input lines, using fisher yates shuffle,
(which I use to randomize mp3 file names to put on a stick).
Code:
$ time ruby18 ./fisher_yates.rb 1.txt > 1
4.05s real 3.50s user 0.53s system
$ time ruby19 ./fisher_yates.rb 1.txt > 1
1.82s real 1.78s user 0.03s system
that is an impressive improvement!
my previous comparison was with perl...
Code:
$ time ./fisher_yates.pl 1.txt > 1
1.07s real 1.04s user 0.02s system
and python:
Code:
$ time ./fisher_yates.py < 1.txt > 1
2.25s real 2.20s user 0.03s system
test text is "don quixote" by cervantes, split to one word per line.
Code:
$ cat 1.txt | wc -l | commify
433,968
|
|
|
|
07-30-2010, 07:13 AM
|
#79
|
|
LQ 5k Club
Registered: Sep 2009
Distribution: Arch x86_64
Posts: 6,443
|
That's pretty impressive, from much slower than anything else to faster than Python!
|
|
|
|
07-31-2010, 08:00 AM
|
#80
|
|
Member
Registered: Jun 2010
Distribution: Fedora
Posts: 289
Original Poster
Rep:
|
Alright, my votes were:
C and Python.
After reading and thinking, I'm going to make my final vote:
C, C++, and Ruby or Python
I don't know the details of why Python is better than Ruby, even though I've seen it said again and again, but I've read some Python tutorials and now I'm learning Ruby and in my opinion, I would vote Ruby. It's very nice, I don't see anything wrong with it. Python's a good language, also, but I prefer Ruby.
Last edited by pr_deltoid; 09-14-2010 at 10:23 AM.
|
|
|
|
08-01-2010, 05:13 AM
|
#81
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
interestingly (?) on my benchmark C++ may blitz the scripting languages
or may not be appreciably any faster!
depending whether you use stdio or C++ streams:
using <cstdio>
Code:
$ time ./fisher_yates 1.txt > 1
0.14s real 0.11s user 0.03s system
using <iostream>
Code:
$ time ./fisher_yates_iostream 1.txt > 1
1.35s real 0.62s user 0.72s system
$
very disappointing show for iostreams I feel.
Last edited by bigearsbilly; 08-01-2010 at 05:14 AM.
Reason: typo
|
|
|
|
08-02-2010, 03:05 AM
|
#82
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
I am so impressed I've just ordered "the ruby programming language"
|
|
|
|
08-09-2010, 03:31 PM
|
#83
|
|
LQ Newbie
Registered: Feb 2005
Location: Brasil
Distribution: Conectiva, RedHat, Debian, Mandrake and Other Unix OSs
Posts: 4
Rep:
|
ObjectPascal
I by myself do powerfull systems /applications in modern variants of ObjectPascal, its a pitty that this language is threated as second class citzen just becouse C/unix inventor, just did a unhappy commentin early 70'ies! Its a myth ObjectPascal is a feeble language only for educational porpuses. TIOBS list shows that interest on Pascal/ObjectPascal have been growing.
Not to mention others as Ada, Eiffel, SPARK.
|
|
|
|
08-09-2010, 03:41 PM
|
#84
|
|
LQ Newbie
Registered: Feb 2005
Location: Brasil
Distribution: Conectiva, RedHat, Debian, Mandrake and Other Unix OSs
Posts: 4
Rep:
|
Quote:
Originally Posted by fruttenboel
I'd say: Tcl/Tk and Java. Both are scripted languages. Still, they are fast enough and both are excelletn for building programs. Tcl/Tk is great for building GUI front ends, and also for 'normal' programs.
Java is the language of the future. It's the safest among the 'curly braces languages'. C and C++ are portable assemblers. And assemblers are outdated. But don't take me on my words here. C and C++ are neither assemblers nor portable. At least, not as much as the users would like them to be.
My great love in programming languages is Modula-2. It's a very safe language, like Ada, and it is certified for mission critical applications (like Ada). Alas, nobody is using it. Probably because it was made in Switzerland instead of in the US.
Java has a lot in common with C, C++ and Modula-2. It builds on the syntax of C and C++ yet has a lot of the safety issues of Modula-2 added to it. This makes the compiler type-safe. Java is cross platform and identical for every implementation. Add it all up and you have a good programming environment.
|
Agreed remember ObjectPascal ans Eiffel too !
|
|
|
|
08-10-2010, 03:53 AM
|
#85
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
marcelos!
java is of the future!
the past more like.
I think you may find that Tcl and Java interpreters are implemented largely in terms of
C or C++, as is perl, ruby, python, etc etc etc
I think you may find this is what is know as, reality

|
|
|
|
09-14-2010, 10:26 AM
|
#86
|
|
Member
Registered: Jun 2010
Distribution: Fedora
Posts: 289
Original Poster
Rep:
|
It's really hard for me to choose between Ruby and Python, but Python is used for so many things that it makes it seem better to me. I'd like Ruby to be as popular as Python. If it got as popular as Python, I'd probably use it instead. I don't know which one I would say is better, but Python is used so much... Ruby seems to be very nice and neat and I don't see any problems with it, and Python is getting changed around too much in my opinion (unless they stop now, after 3). But Python is so popular and commonly used for pretty much anything, that it seems like the better one to start learning.
I don't like the amount of changes between Python 2 and 3, even though I'm sure it's a big improvement. I won't care if they stop doing that after 3 or 4, but if every major release has a hundred differences, it's going to turn ridiculous. Hopefully 4 doesn't have to go through too many changes and then it's done with.
Last edited by pr_deltoid; 09-14-2010 at 10:30 AM.
|
|
|
|
09-14-2010, 11:03 AM
|
#87
|
|
LQ 5k Club
Registered: Sep 2009
Distribution: Arch x86_64
Posts: 6,443
|
I wouldn't let popularity be such a big factor.
|
|
|
|
09-14-2010, 11:12 AM
|
#88
|
|
Member
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994
Rep:
|
Quote:
Originally Posted by MTK358
I wouldn't let popularity be such a big factor.
|
Hi MTK358
Popularity means a larger coder base -> more resources in terms of libraries and snippets -> etc, etc.
This is like speaking/writing in a common language... I bet there are more pieces of technical / Philosophical / history / <whatever> writing in English than in Urdu... IMHO,
... so you access a bigger pool of knowledge being an English speaker, than being an Urdu speaker...
|
|
|
|
09-15-2010, 02:42 AM
|
#89
|
|
Member
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 733
Rep:
|
It depends
For Linux administration you should prioritize on Bash.
For a Solid understanding of the backbone of computing you should learn C which can be expanded to object C in the future.
For more learing I recommend RISC assembly for Microcontrollers although this is a little out there for most PC users. A full assmebly language set looks like C as compared to RISC so I only think it is interesting if you only want it to use BIOS for system calls.If you are a genius I would also then learn Perl. I studied Pascal and loved it but it is harder to implement than C for embedded and other small stuff.Bite the bullet and learn C as a base Language or use Java because it is more popular for employment. 
Last edited by theKbStockpiler; 09-15-2010 at 02:53 AM.
Reason: Not being a genius
|
|
|
|
09-15-2010, 03:00 AM
|
#90
|
|
Senior Member
Registered: May 2005
Posts: 4,397
|
Quote:
Originally Posted by theKbStockpiler
... I studied Pascal and loved it but it is harder to implement than C for embedded and other small stuff. ...
|
IIRC, full standard Pascal compiler written in Pascal is just about 5000 lines long. The point is not Pscal vs "C" complexity, but rather the fact that by design standard Pascal does not give access to memory addresses, i.e. one can't write in standard Pascal "store 5a hex at address 1234" and one can't access IO devices from standard Pascal.
I.e. Pascal was meant as an application programming (opposed to system programming) language.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:15 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|