12 Replies - 2772 Views - Last Post: 25 June 2011 - 09:45 AM Rate Topic: -----

#1 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

How fast does compiled Ruby run?

Posted 22 June 2011 - 08:15 PM

Hello dream.in.code. I've been looking around these forums quite a bit, but this is my first post. I've already become relatively proficient in C#, and 'messed around' in C++, Java, and VB. I've been looking at Ruby quite a bit. I really like the look and feel of Ruby, but my main deciding point in choosing a language is its speed.

Now that I've gotten the introduction out of the way it's probably time to get on to my question.

My question is how Ruby compares to C# in speed of performing the same task.

A preemptive 'Thank you!' to whoever helps me!
Crockeo

Is This A Good Question/Topic? 0
  • +

Replies To: How fast does compiled Ruby run?

#2 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: How fast does compiled Ruby run?

Posted 22 June 2011 - 08:42 PM

I apologize for the double post, but I'd just like to add to my question. Are you able to make GUI's relatively easily in Ruby?

Thank you again!
Crockeo
Was This Post Helpful? 0
  • +
  • -

#3 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 05:28 AM

To clear things up, are you referring to JRuby? Ruby is an interpreted language rather than compiled.

I have no benchmarks, but I'm fairly certain C# runs faster than Ruby because C# is an interpreted language.

GUIs can be frustrating to do in Ruby because there's no definitive GUI toolkit. I hear people enjoy QT and WxRuby, but I just keep to the command line so that's the extent of my input.
Was This Post Helpful? 0
  • +
  • -

#4 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 06:33 AM

To be completely honest, I don't know what I'm referring to.After I'm done writing this I'll go see what the difference is. Nevermind, I just looked it up. So JRuby is something that makes Ruby be able to be compiled, but it runs on top of the JRE right? I've tried Java in the past but generally stayed away from it due to its slow speeds.

So if what I said above was right, then I don't think I'll use (J)Ruby.

Now that I've made the decision not to use (J)Ruby might there be any other languages that you'd suggest that are similar to (J)Ruby in the way you program, but faster in the way it executes?

Thank you for all of your help,
Crockeo
Was This Post Helpful? 0
  • +
  • -

#5 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 06:57 AM

Ruby wasn't designed with speed in mind - you aren't likely to find a language equally expressive that runs as fast as a compiled language.

I'm actually surprised at your comments on Java slowness - it has a slow startup, but once the virtual machine is "warmed up" it has competitive execution speeds.

Edit: Also, JRuby does make Ruby GUIs better because you can use the Swing library to build them, which is common and decent enough to use.

This post has been edited by xclite: 23 June 2011 - 06:58 AM

Was This Post Helpful? 0
  • +
  • -

#6 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 01:50 PM

Thank you for your input on this. You've swayed me from using Ruby or JRuby (mostly due to the lack of speed). Now, although it's slightly off topic, I have another question.

I've worked in C++ and C# for a while, and I want to try something that's not a C language nor especially similar to a C language. So what would be a good language for me to check out if I want that?

Thank you again,
Crockeo

EDIT:
P.S. I'd like it not to use the .NET framework for GUI's so I can learn other frameworks.

This post has been edited by Crockeo: 23 June 2011 - 01:52 PM

Was This Post Helpful? 0
  • +
  • -

#7 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 05:08 PM

Have you considered Go? It's still based in C, but it's a good systems language and "fixes" some of the issues of C.
Was This Post Helpful? 0
  • +
  • -

#8 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 05:19 PM

1) C#/Java is compiled, then interpreted
2) (J)Ruby is ran on compiled software
3) :o Don't give up on Ruby just yet! Give it a week or two, and you'll see its shining beauty!

There is no really other option. Software was written in either in the C family or languages that borrowed from the C family. You're going to have some mind of C anyway you go.

If you want a GUI-based application, you basically shot down all the possibilities. .NET is great for GUI. Swing is great for GUI. I was going to mention Cocoa, but it seems that you are working on a Windowz computer based on your context. I was also going to mention the Win32 API, but you want to stray away from C.

So if you want a GUI, you either use a .NET language, (a) Java (or Java-based language).

This post has been edited by heyoman1: 23 June 2011 - 05:19 PM

Was This Post Helpful? 0
  • +
  • -

#9 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 06:58 PM

I'm still curious to know what he's working on that Java is too slow for. I fear he's just bought into the Java is Slow myth rather than thought about how JRuby could really be what he's looking for.
Was This Post Helpful? 0
  • +
  • -

#10 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: How fast does compiled Ruby run?

Posted 23 June 2011 - 07:19 PM

Java wasn't too slow for me, it's just that between it not being especially fast and me not enjoying the way you code in it I never really gave it a chance. I guess I can try JRuby again, but I'm not currently fond of it.

Thank you,
Crockeo
Was This Post Helpful? 0
  • +
  • -

#11 NotarySojac  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 53
  • View blog
  • Posts: 428
  • Joined: 30-September 10

Re: How fast does compiled Ruby run?

Posted 24 June 2011 - 01:25 PM

In my opinion, c# (much less portable than java) is a tremendously fun coding experience. It's very similar to java, but your 2D arrays can be expressed like this

int[,] myTwoDee = new int[3, 3];

Not to mention Microsoft's extremely user friendly GUI designers, I could never get into java's (but that's not to say that I don't plan on picking it up as a new skill).

You shouldn't be too concerned with "picking the right language", since they're all pretty much the same thing, they just have different emphases.

Middle ground languages
The distinction between java, I want to say, is portability, versus noob friendlyness. You can literally have zero programming experience and figure out what to do with Microsoft visual studio with either VB.net or C#, plus, there's tons of online chatter about c# making it a pretty decent starter language.

quick, lil Script languages
The distinction between Ruby and java/.net is going to be efficiency and readability. Ruby has amazing readability (and writeability it looks like too). I think of Ruby as my script language, it's what I'm going to use to replace vbs as my script language. It's for little stuff that I don't have any need to have run quickly.

Performance languages
I'm not very comfortable with C++, but that's the language I intend to use for programs that make a lot of loops. It has very poor online chatter for explaining how things are done compared to C# because it's a bitch to do anything with ;P But, it's very good at stuff like file parsing, matrix multiplying, real time monitoring, sploits (ehem), and image processing.

Keep in mind that you can invoke any program you'd like from any language you'd like, so you can write a snazzy c#, WPF project with all the sleek appearances that you boss desires, and call a low level C++ application to monitor all emails that leave his netwo... eer, I means parse lots of things, with a c++ application for your boss. Yeah.

So start somewhere. I'd urge java/c# as a good starting place, but if you feel you're getting somewhere in Ruby already, then stick with it.

I did a little research on ruby GUI and it looks like _why did a ruby GUI project. I'm a big fan of his work, so I strongly recomend it, completely lacking familiarity with how it work.
http://www.youtube.c...h?v=PoZ9bPQ13Dk
http://shoesrb.com/

This post has been edited by NotarySojac: 24 June 2011 - 01:27 PM

Was This Post Helpful? 0
  • +
  • -

#12 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: How fast does compiled Ruby run?

Posted 25 June 2011 - 07:56 AM

Why is awesome but I try to avoid using toolkits that aren't strongly supported (his has like, one developer since he left).
Was This Post Helpful? 0
  • +
  • -

#13 NotarySojac  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 53
  • View blog
  • Posts: 428
  • Joined: 30-September 10

Re: How fast does compiled Ruby run?

Posted 25 June 2011 - 09:45 AM

That's a pretty important consideration too, but for some reason I was having trouble implementing a gui using NetBeans 6.9.1 using the swing library. It doesn't seem to be "installed" or something =/

Not exactly my greatest concern considering I put the time in to learn WPF and linux people tend to be displeased with GUIs in the first place =P but I'm definitely open to any IDE suggestions here because it would be sweet to work on ruby projects with a drag and drop designer supporting my creativity.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1