LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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

Poll: The best languages?
Poll Options
The best languages?

You must log in and have one post to vote in this poll. If you don't have an account, you can register here.
Results will be available after the polls close.

The nominees are:

PHP
Perl
Python
Ruby
C
C++
Java
Lisp
Erlang
Smalltalk
Haskell
C#
Lua
COBOL
Scheme
Go
Groovy
Fortran
R

Reply
 
Search this Thread
Old 07-29-2010, 04:23 AM   #76
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,313

Rep: Reputation: 175Reputation: 175

ruby is quite, er, slow.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-30-2010, 12:57 AM   #77
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Original Poster
Rep: Reputation: 41
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 01:03 AM.
 
Old 07-30-2010, 04:51 AM   #78
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,313

Rep: Reputation: 175Reputation: 175
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
 
Old 07-30-2010, 08:13 AM   #79
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
That's pretty impressive, from much slower than anything else to faster than Python!
 
Old 07-31-2010, 09:00 AM   #80
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Original Poster
Rep: Reputation: 41
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 11:23 AM.
 
Old 08-01-2010, 06:13 AM   #81
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,313

Rep: Reputation: 175Reputation: 175
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 06:14 AM. Reason: typo
 
Old 08-02-2010, 04:05 AM   #82
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,313

Rep: Reputation: 175Reputation: 175
I am so impressed I've just ordered "the ruby programming language"
 
Old 08-09-2010, 04:31 PM   #83
Marcelo Fortes
LQ Newbie
 
Registered: Feb 2005
Location: Brasil
Distribution: Conectiva, RedHat, Debian, Mandrake and Other Unix OSs
Posts: 4

Rep: Reputation: 0
Wink 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.
 
Old 08-09-2010, 04:41 PM   #84
Marcelo Fortes
LQ Newbie
 
Registered: Feb 2005
Location: Brasil
Distribution: Conectiva, RedHat, Debian, Mandrake and Other Unix OSs
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by fruttenboel View Post
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 !
 
Old 08-10-2010, 04:53 AM   #85
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,313

Rep: Reputation: 175Reputation: 175
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

 
Old 09-14-2010, 11:26 AM   #86
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Original Poster
Rep: Reputation: 41
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 11:30 AM.
 
Old 09-14-2010, 12:03 PM   #87
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
I wouldn't let popularity be such a big factor.
 
Old 09-14-2010, 12:12 PM   #88
Alexvader
Member
 
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994

Rep: Reputation: 94
Quote:
Originally Posted by MTK358 View Post
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...
 
Old 09-15-2010, 03:42 AM   #89
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 836

Rep: Reputation: 51
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 03:53 AM. Reason: Not being a genius
 
Old 09-15-2010, 04:00 AM   #90
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by theKbStockpiler View Post
... 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.
 
  


Reply

Tags
c++, compiler, java, language, programming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 programming language, languages to learn for linux. gimmee Programming 11 11-28-2006 08:30 PM
good programming languages to learn qennster Programming 13 05-22-2001 11:12 AM


All times are GMT -5. The time now is 04:00 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration