Doubts about Ruby and JRuby

Hi all,

Right now, I’m very busy, but sometimes, I need to disconnect of all my
day tasks.

From some time ago, I would like to learn Ruby (I like smalltalk a lot,
and Ruby is very similar), and this could be a good moment. I’m
developing an application in a closed source enviroment, and I’m
thinking, develop it in Ruby too in parallel (when have time) to learn
it.

My main question, is, thath I readed thath is not possible to get
something equivalent to .pyc files in Python. This is not a problem when
you develop an opensource project, but if is not opensource, could be a
problem.

I readed with JRuby you can get something like a .pyc/.jar/“compiled”
file (I’m not sure, for this reason I’m here). And access to the vast
Java libraries, could be interesting.

Then… Is good idea, to use JRuby for Desktop closed source
applications instead Ruby MRI? For other type of projects, opensource
for example, is better Ruby 1.9 performance than JRuby? Am I mixing
concepts?

The application I’m developing right now, is a little desktop closed
source ERP for a customer. I need to develop a website too, with a
customers area to make invoices, and this web and ERP needs to be
communicated.

Thanks for your time.

Regards.

P.S.: Sorry for my english

On Mon, Mar 14, 2011 at 10:37 PM, Giuseppe luigi Punzi ruiz <
[email protected]> wrote:

source ERP for a customer. I need to develop a website too, with a
customers area to make invoices, and this web and ERP needs to be
communicated.

Hi,
I am not sure what the exact problem you are communicating, but in a
nutshell:

  • true, many corporate customers will not be familiar or comfortable
    with a
    Ruby Runtime. They have invested in enterprise level app deployment
    options
    that Ruby or any other interpreted language would not fit into.
  • JRuby based apps can integrate invisibly into Java based shops
  • source hiding is more of an issue - you want to prevent the end user
    making modifications to fully interpreted source (creates support
    problems),
    packaged software & installers avoids a lot of these problems.

regards,
Richard

Caution: .pyc files can be decompiled to realtively well-structured
Python code. The dynamicity
of the language (such as access to the local variable table) makes fewer
optimizations possible
at the bytecode level, so you can get surprisingly straightforward code
out of a decompilation.

http://depython.net/ is one example of a service that will decompile
code compiled with Python
2.5 and lower.

I would seriously recommend against treating pyc files as having more
security than raw .py files.

There are also decompilers for Java bytecode, but their output often
less closely matches
the input source. Also, the .jars emitted by JRuby will, when decompiled
by a Java decompiler,
be quite different from the input Ruby code, so you will have some
obscurity there as well.

Michael E.
[email protected]
http://carboni.ca/

Hi all,

  • true, many corporate customers will not be familiar or comfortable
    with a
    Ruby Runtime. They have invested in enterprise level app deployment
    options

The problem is not Ruby vs JRuby. I talked about JRuby, because I readed
thath with JRuby I can get something like “compiled” files and in Ruby
not. I don’t know the advantages of JRuby against Ruby. I suppose the
access to Java libraries is one of them. I will check all of this when
have time.

  • source hiding is more of an issue - you want to prevent the end user
    making modifications to fully interpreted source (creates support
    problems),
    packaged software & installers avoids a lot of these problems.

Yes, but the source still there. They can open the rb files, modify
them, and start again the application to see (or broke) the changes.
With bytecode this is not possible without compiling again (AFAIK). For
this I asked about something compilated (to native code or bytecode). I
know (or suppose) there are decompilers, but everything can be
decompiled if you want, but this is not the same as plain files with the
code. Probably, an obfuscating application could be enough, I don’t
know.

Caution: .pyc files can be decompiled to realtively well-structured
Python code.

I named Python only because I wanted to compare with something to what I
want. The “little” ERP I’m developing, needs to be deployed to desktop
without the possibility of touch/see the source. For website, If I
develop it in Rails, is not a problem if the source is visible for the
moment.

Could be interesting if code could be made compatible between VMs withou
much complex, so, If I can’t deploy the app in a Java enviroment, I can
use MRI.

As I wrote, for the moment, I’m evaluating, I’m looking for Access
Database (noSQL?), GUI development, Mobile possibilities (Android?
iPhone?) and so on, but, If I can’t lock de code…

On Mon, Mar 14, 2011 at 4:37 PM, Giuseppe luigi Punzi ruiz <
[email protected]> wrote:

Then… Is good idea, to use JRuby for Desktop closed source
applications instead Ruby MRI? For other type of projects, opensource
for example, is better Ruby 1.9 performance than JRuby? Am I mixing
concepts?

JRuby’s a great way to distribute Ruby apps on Windows, so long as they
don’t use native extensions, which is fairly easy to avoid if you’re
trying. For packaging JRuby apps, there’s Rawr, which will make a .exe
on
Windows and a .app for Macs:

http://rawr.rubyforge.org/

As far as performance goes, it’s really going to vary depending on what
you’re doing in terms of the actual Ruby code itself and what libraries
you’re using, as some of the JRuby alternatives to native extensions are
quite slow and vice versa. 1.9/YARV and JRuby are generally considered
two
of the fastest implementations available, and JRuby lets you tap into
Java
libraries where you need additional performance.

The precompiled .class files that JRuby generates are probably one of
your
best options in the Ruby world when it comes to source code obfuscation
for
a closed source application.

For what it’s worth, if you are that worried about your customers making
away with your code, then perhaps it would be better to stay away from
all scripting languages: Not just Ruby, but Python, PHP, Lua…

On the other hand, you should bear in mind that:

  • the vast majority of your customers will not have the knowledge or the
    desire to steal your source code.

  • The few that do are likely to have to spend quite a lot of effort to
    do so – maybe as much as writing from scratch, when you consider
    that…

  • … just copying large bits of your code won’t help them, because
    you’ll easily be able to spot that and prosecute (or threaten to).

  • Even compiled languages can be decompiled.

Just my 10c.

Ruby is One of The Best Forum,Think Before Submitting ur Answer .Just
Spend think… Could be interesting if code could be made compatible
between VMswithoumuch complex, so, If I can’t deploy the app in a
Javaenviroment,Ican use MRI.

  • JRuby based apps can integrate invisibly into Java based shops
  • source hiding is more of an issue - you want to prevent the end user
    making modifications to fully interpreted source (creates support
    problems),
    packaged software & installers avoids a lot of these problems.
    clickhost

Thanks a lot to all for your comments.

All of them are appreciated :slight_smile:

Now, is moment to digest all the information.

Regards.