Is Ruby the Language for Me?

N

Nathan Koren

Greetings!

I'm trying to figure out if Ruby is the right language for a project
that I'm working on, and I'd appreciate any advice that anyone can
give me. First, some background about myself and this project:

* Depending on who you talk to, I either am or am not a "real"
programmer. I have no formal training, and although I have extensive
experience in scripting languages like Bash, application-specialized
LISPs, Matlab, and especially PHP, I've never programmed in a "real"
relatively low-level language. Nor am I particularly eager to.

* I am currently developing my project with Matlab, but it looks like
Matlab's GUI capabilities (among other things) may be insufficient.
Thus I am looking for another language to port my program to, or at
least use to build a graphical front-end for my Matlab programs.

* Whatever language I use should be cross-platform, although initially
I am developing for Windows only. When thinking "cross-platform,"
Java is the first thing that comes to mind. But Java is a pain in the
ass, and I'd rather not do it – plus, I've never used a Java
application that has struck me as anything other than clunky.

When searching around for languages, I ran across Python, which seemed
like it would do everything I need, in combination with the wx widget
library. Then I noticed some people promulgating this "Ruby"
language. I'd never heard of it, but I was intrigued. Particularly
because they all seemed to have this particular glassy-eyed zeal that
I usually associate with Amiga or BeOS users. Now, I've been an Amiga
and BeOS user – back in their heyday – and I know that their zeal is
ABSOLUTELY 100% JUSTIFIED. Those systems were simply a JOY to use,
which is a selling point that seems to elude most computer people, but
is important to me. If I can experience some measure of joy while
learning a new language and porting my project to it, then that is a
very big selling point indeed.

However, if Ruby doesn't actually do what I need, then I'll have to
find another language to work with. Here are the concerns I have:

* This is going to be commercial software, and I do NOT intend to give
away the source code. Is their a way that Ruby programs can be
securely compiled so that the source code is inaccessible?

* For that matter, is there a way that Ruby programs can be compiled
as binary executables? On Windows, Linux, and Mac?

* I will be using a shareware-validation protocol not unlike
http://www.shareit.com. Will Ruby be compatible with this?

* If I am porting the entire program to Ruby, rather than just using
it as a frontend to my standalone Matlab programs, are there good Fast
Fourier Transform libraries for Ruby?

If anyone can help me answer these questions, I'd be most
appreciative.

Sincerely,

Nathan
 
G

Gavin Sinclair

Nathan said:
When searching around for languages, I ran across Python, which seemed
like it would do everything I need, in combination with the wx widget
library. Then I noticed some people promulgating this "Ruby"
language. I'd never heard of it, but I was intrigued. Particularly
because they all seemed to have this particular glassy-eyed zeal that I
usually associate with Amiga or BeOS users. Now, I've been an Amiga and
BeOS user – back in their heyday – and I know that their zeal is
ABSOLUTELY 100% JUSTIFIED. Those systems were simply a JOY to use,
which is a selling point that seems to elude most computer people, but
is important to me. If I can experience some measure of joy while
learning a new language and porting my project to it, then that is a
very big selling point indeed.

With that kind of attitude, I'm sure you'll benefit from learning the
language, whether or not you actually use it for your project. It is
intended to be a joy to use, and it's quite successful.

The point is, you can get a good overview of the language in a short time.
Check out http://phrogz.net/ProgrammingRuby.

None of this means, of course, that I think your project-specific
questions are unimportant :)
However, if Ruby doesn't actually do what I need, then I'll have to find
another language to work with. Here are the concerns I have:

* This is going to be commercial software, and I do NOT intend to give
away the source code. Is their a way that Ruby programs can be
securely compiled so that the source code is inaccessible?

Not that I know of. Does Python have a way? If so, the idea might be
transferrable as they are similar languages.
* For that matter, is there a way that Ruby programs can be compiled as
binary executables? On Windows, Linux, and Mac?

On Windows, yes (google for exerb). But that doesn't actually compile the
code; it just bundles the interpreter and the source into an .exe. I
doubt this is an effective way to hide source.

On the other platforms, I don't think so.
* I will be using a shareware-validation protocol not unlike
http://www.shareit.com. Will Ruby be compatible with this?

Sorry, no idea.
* If I am porting the entire program to Ruby, rather than just using it
as a frontend to my standalone Matlab programs, are there good Fast
Fourier Transform libraries for Ruby?

Again, I don't know. But you can look for one on
http://raa-ruby-lang.org. Some people here know a fair bit about
scientific calculations with Ruby, I think.
If anyone can help me answer these questions, I'd be most
appreciative.

Good luck,
Gavin
 
P

Phlip

Nathan said:
I'm trying to figure out if Ruby is the right language for a project
that I'm working on, and I'd appreciate any advice that anyone can
give me. First, some background about myself and this project:

* Depending on who you talk to, I either am or am not a "real"
programmer. I have no formal training, and although I have extensive
experience in scripting languages like Bash, application-specialized
LISPs, Matlab, and especially PHP, I've never programmed in a "real"
relatively low-level language. Nor am I particularly eager to.

The distance between low and high level in languages gets greater all the
time - from microcode and writable instruction sets to app-specific macro
languages.

Ruby can be used as a high-level macro language. For example, this code
draws a T:

tubes.longer(5).tube.tube.shorter.
push.right.tube.pop.
left.tube

Each command is actually a method (on 'tubes') that creates an object. Later
code will traverse the array of objects, executing each one. This makes Ruby
the scripting language for a Ruby project, via the 'eval' method. It takes a
string of Ruby code and executes it.

http://flea.sourceforge.net/reference.html

Put another way, one could write a sufficiently clever Ruby object model,
and users would drive it with matlab-style code.
* I am currently developing my project with Matlab, but it looks like
Matlab's GUI capabilities (among other things) may be insufficient.
Thus I am looking for another language to port my program to, or at
least use to build a graphical front-end for my Matlab programs.

This is how to use TkCanvas, the best canvas I have found so far. Each
painted element is itself an object, so you can manipulate its properties on
the fly.



There are also probably charting tools for Ruby. There may also be a Matlab
interface.
* Whatever language I use should be cross-platform, although initially
I am developing for Windows only. When thinking "cross-platform,"
Java is the first thing that comes to mind. But Java is a pain in the
ass, and I'd rather not do it - plus, I've never used a Java
application that has struck me as anything other than clunky.

Portability is for canoes. There are three ways to be portable:

1. screw it. Satisfy customers on one platform first, quickly
2. predict portability, pick a portable platform, then apply 1.
3. test on multiple platforms after writing each line.
When searching around for languages, I ran across Python, which seemed
like it would do everything I need, in combination with the wx widget
library. Then I noticed some people promulgating this "Ruby"
language. I'd never heard of it, but I was intrigued. Particularly
because they all seemed to have this particular glassy-eyed zeal that
I usually associate with Amiga or BeOS users. Now, I've been an Amiga
and BeOS user - back in their heyday - and I know that their zeal is
ABSOLUTELY 100% JUSTIFIED. Those systems were simply a JOY to use,
which is a selling point that seems to elude most computer people, but
is important to me. If I can experience some measure of joy while
learning a new language and porting my project to it, then that is a
very big selling point indeed.

Uh, yeah. Guilty. Python sucks.
However, if Ruby doesn't actually do what I need, then I'll have to
find another language to work with. Here are the concerns I have:

* This is going to be commercial software, and I do NOT intend to give
away the source code. Is their a way that Ruby programs can be
securely compiled so that the source code is inaccessible?

r2c? A ruby compiler? I don't know the answers to the remaining questions.
 
P

Phlip

Phlip said:
The distance between low and high level in languages gets greater all the
time - from microcode and writable instruction sets to app-specific macro
languages.

Ruby can be used as a high-level macro language. For example, this code
draws a T:

tubes.longer(5).tube.tube.shorter.
push.right.tube.pop.
left.tube

Each command is actually a method (on 'tubes') that creates an object. Later
code will traverse the array of objects, executing each one. This makes Ruby
the scripting language for a Ruby project, via the 'eval' method. It takes a
string of Ruby code and executes it.

http://flea.sourceforge.net/reference.html

Put another way, one could write a sufficiently clever Ruby object model,
and users would drive it with matlab-style code.


This is how to use TkCanvas, the best canvas I have found so far. Each
painted element is itself an object, so you can manipulate its properties on
the fly.
http://www.rubygarden.org/ruby?SvgCanvas

There are also probably charting tools for Ruby. There may also be a Matlab

Portability is for canoes. There are three ways to be portable:

1. screw it. Satisfy customers on one platform first, quickly
2. predict portability, pick a portable platform, then apply 1.
3. test on multiple platforms after writing each line.


Uh, yeah. Guilty. Python sucks.


r2c? A ruby compiler? I don't know the answers to the remaining questions.
 
D

Dave Burt

I'll skip what Gavin has already covered and I agree with.
* This is going to be commercial software, and I do NOT intend to give
away the source code. Is their a way that Ruby programs can be
securely compiled so that the source code is inaccessible?

It seems to me that the language lends itself to being quite well
obfuscated, but Ruby users at the moment are largely developers and
open-source fans, so there isn't such a thing (AFAIK) as an obfuscator, yet.
Could be fun to write, for an experienced rubyist.

If you want "secure compilation", I believe this limits you to using C or
C++. Java and .NET, for example, "compile" into bytecode for a virtual
machine that is tailored to run them, and decompilers are readily available
that will produce quite legible source. Although, with something like
Perl/Tk, you may be able to use their B::C module/perlcc program (see
perlcompile manpage) to compile to native code via C.

Finally, comments are a significant part of the value of source code. When
you compile your .NET or Java app, you will strip the comments. In lieu of
an obfuscator, a simple script to strip the comments before packaging your
app is half-way there.
* For that matter, is there a way that Ruby programs can be compiled
as binary executables? On Windows, Linux, and Mac?

Not that I know of. But there should be.
* I will be using a shareware-validation protocol not unlike
http://www.shareit.com. Will Ruby be compatible with this?

Probably. What interface is required?
* If I am porting the entire program to Ruby, rather than just using
it as a frontend to my standalone Matlab programs, are there good Fast
Fourier Transform libraries for Ruby?

I did a quick bit of research, and found what you are looking for exists in
Ruby: Ruby/GSL is a Ruby interface to the GNU Scientific Library (GSL).
See:
http://raa.ruby-lang.org/list.rhtml?name=ruby-gsl-1
http://www5d.biglobe.ne.jp/~ytsune/Ruby-GSL/index.html
http://www5d.biglobe.ne.jp/~ytsune/Ruby-GSL/fft.html

Hope this is of some help,
Dave
 
P

Phil Tomson

I'll skip what Gavin has already covered and I agree with.


It seems to me that the language lends itself to being quite well
obfuscated, but Ruby users at the moment are largely developers and
open-source fans, so there isn't such a thing (AFAIK) as an obfuscator, yet.
Could be fun to write, for an experienced rubyist.

I can easily imagine that one could write a crypto_require or
obfuscated_require method that does what the built-in require does, but
first applies some decryption algorithm of your choice to the required
file. This wouldn't be that difficult to do.
If you want "secure compilation", I believe this limits you to using C or
C++. Java and .NET, for example, "compile" into bytecode for a virtual
machine that is tailored to run them, and decompilers are readily available
that will produce quite legible source. Although, with something like
Perl/Tk, you may be able to use their B::C module/perlcc program (see
perlcompile manpage) to compile to native code via C.

Finally, comments are a significant part of the value of source code. When
you compile your .NET or Java app, you will strip the comments. In lieu of
an obfuscator, a simple script to strip the comments before packaging your
app is half-way there.


Not that I know of. But there should be.

Actually, it seems like you culd just emed Ruby into a very simple C
program that essentially just starts the ruby interpreter and does a
rb_require of your script. You shouldn't even need to learn any C code as
I'm sure someone here would be willing to supply the C main function for
doing this (it should be less than a page). ;-)

Phil
 
R

Ryan Paul

Greetings!

I'm trying to figure out if Ruby is the right language for a project
that I'm working on, and I'd appreciate any advice that anyone can
give me. First, some background about myself and this project:

* Depending on who you talk to, I either am or am not a "real"
programmer. I have no formal training, and although I have extensive
experience in scripting languages like Bash, application-specialized
LISPs, Matlab, and especially PHP, I've never programmed in a "real"
relatively low-level language. Nor am I particularly eager to.

* I am currently developing my project with Matlab, but it looks like
Matlab's GUI capabilities (among other things) may be insufficient.
Thus I am looking for another language to port my program to, or at
least use to build a graphical front-end for my Matlab programs.

* Whatever language I use should be cross-platform, although initially
I am developing for Windows only. When thinking "cross-platform,"
Java is the first thing that comes to mind. But Java is a pain in the
ass, and I'd rather not do it – plus, I've never used a Java
application that has struck me as anything other than clunky.

When searching around for languages, I ran across Python, which seemed
like it would do everything I need, in combination with the wx widget
library. Then I noticed some people promulgating this "Ruby"
language. I'd never heard of it, but I was intrigued. Particularly
because they all seemed to have this particular glassy-eyed zeal that
I usually associate with Amiga or BeOS users. Now, I've been an Amiga
and BeOS user – back in their heyday – and I know that their zeal is
ABSOLUTELY 100% JUSTIFIED. Those systems were simply a JOY to use,
which is a selling point that seems to elude most computer people, but
is important to me. If I can experience some measure of joy while
learning a new language and porting my project to it, then that is a
very big selling point indeed.

However, if Ruby doesn't actually do what I need, then I'll have to
find another language to work with. Here are the concerns I have:

* This is going to be commercial software, and I do NOT intend to give
away the source code. Is their a way that Ruby programs can be
securely compiled so that the source code is inaccessible?

* For that matter, is there a way that Ruby programs can be compiled
as binary executables? On Windows, Linux, and Mac?

* I will be using a shareware-validation protocol not unlike
http://www.shareit.com. Will Ruby be compatible with this?

* If I am porting the entire program to Ruby, rather than just using
it as a frontend to my standalone Matlab programs, are there good Fast
Fourier Transform libraries for Ruby?

If anyone can help me answer these questions, I'd be most
appreciative.

Sincerely,

Nathan

I recently joined the ruby community. I was a python programmer, and I too
became intrigued with ruby as a consequence of their uncompromising
zealotry. Like you, I was also a support of BeOS. If you are anything like
me, ruby is definitely the language for you. Ruby provides astonishingly
elegant OO support, profoundly flexible syntax, immense versatility, and
relatively impressive runtime speeds. It does everything python does, and
quite a bit more. The ruby community has been incredibly helpful and
responsive, and what I have read about potential future developments of
the language itself further increase the allure. Ruby comes from a
tradition of sensibility and innovation. You might be interested in
reading interviews with the creator of the language:
http://www.artima.com/intv/craft.html.

I have studied numerous languages, both compiled and interpreted, and ruby
provides an unprecedented fusion of power, mutability, and usability. If
you want to rapidly produce scalable, portable, and robust applications,
you need look no further.

--SegPhault
 
S

Steve Cooper

Hi

I was wondering whether anyone has gotten Ruby/GSL running under
Windows, and also whether anyone has successfully used the
pre-compiled binaries (available at
http://gnuwin32.sourceforge.net/packages/gsl.htm) with RubyGSL. My
attempts to do a "ruby setup.rb config" didn't work, and it's not
clear to me where to go from here. Any tips or instructions would be
appreciated.

Thanks,

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top