Technology solutions for Ruby?

On Jul 16, 2007, at 1:25 AM, snacktime wrote:

  1. Binary - Are there any utilities for compiling Ruby into a binary
    executable?

No.

YES!!! THERE IS rubyscript2exe!

Awesome tool, never used it, but I’m hoping it’s awesome.

link: http://www.erikveen.dds.nl/rubyscript2exe/index.html

G’luck, mate! (in inspiration of today’s featured wikipedia article)

HTH,
-------------------------------------------------------|
~ Ari
crap my sig won’t fit

On Jul 16, 1:46 pm, vasudevram [email protected] wrote:

or
technologies to use, you’ll have to evaluate the suggested options to
mature enough for production use. Does anyone have any experience
"wxPython is a cross-platform toolkit. This means that the same
(e.g. a few widgets / controls and a file dialog or two). I was able

‘win32all’ to get it. Its also available as a link from the Python for
its trivial to correct if you know Python indenting rules). Also read
building EXEs for a simple Python hello-world program, and for a
Note: py2exe only creates an EXE and DLLs needed, from your source and
rather thoroughly in the last few weeks (and trying out and modifying

P.S.: Some more thoughts:

  • sockets (lowest level, more coding needed, need to create your
    (E.g. I could generate a PDF file on the server in response to a
    that delegates to other classes to do the needed work.
    for a commercial license.
    Python, open-uri for Ruby. I’ve checked this out (briefly), it works,
    and is a neat and somewhat powerful technique, IMO. (What this implies
    is that the client for your HTTP server, need not be a browser - it
    can be a…

read more »

wxPython uses the native widgets of the platform it is running on in
most (if not all) cases, so if you want the “native look & feel”, than
that is the way I would go. They have the best user’s group I’ve seen
so far as well.

Mike

In article [email protected],
[email protected] wrote:
.
.
.

wxPython uses the native widgets of the platform it is running on in
most (if not all) cases, so if you want the “native look & feel”, than
that is the way I would go. They have the best user’s group I’ve seen
so far as well.

Mike

Now you have me curious–when you write of “the best user’s group
…”, do you mean <URL: http://www.python-forum.de/forum-19.html >?

Mr Eiland wrote:

I’m contemplating writing an application in Ruby but in order to do so I
have some requirements that I hope everyone can help me out with.

  1. GUI
  2. Databases
  3. Binary

I have no experience with developing/deploying Ruby in a
“shrinkwrapped-esque” environment and would appreciate input from those
with more experience.

For what it’s worth to you, I’ve been using the following components for
production Windows desktop apps for the past year and a half:

GUI = wxRuby (0.60)
Database = Sqlite3 (with the sqlite3 ruby bindings)
Binary = RubyScript2exe
Installer = Inno Setup

I (and my users) have been pleased with the results, but your needs may
differ.

You’ll find comments about all or most of these components in this
thread.

Some further details can be found here:

David

[ Though the OP posted his message to comp.lang.ruby, I’m cross-
posting it to comp.lang.python, since he mentions Python as a possible
alternative he’s looking at, and also because I’ve recommended Python
for his stated needs. Also, interested to see what other Pythonistas
have to say in response to my reply.

  • Vasudev]

On Jul 16, 2007, at 2:21 AM, Michael R. wrote:

At the heart of the issue is the fact that I refuse to use Java for this
project, I prefer not to use .Net because of the portability issues,
and
I’d like to get away from C++ for obvious reasons.

To me this means Ruby, Python, or, as mentioned above, Perl. If anyone
can tell me of a way to meet the above requirements in either Python
or
Perl, I’m all ears (I just prefer Ruby).

Yes, I think it would be really great for the Ruby community and for
the growth of the language if wxRuby was more mature as a GUI toolkit.
(Not knocking the wxRuby developers at all, its great that they’ve
even done what they have - I know that creating other language (like
Ruby) bindings to a C++ lib is a non-trivial task).

My suggestion: Python + wxPython + Python DBI + (Py2Exe + InnoSetup)
might meet all your needs. (As with any decision about what software
technologies to use, you’ll have to evaluate the suggested options to
see if they fit your needs.)

Note: I’ve used and like both Ruby and Python (saying this after using
many, though not all, language features and libraries of both
languages), and am not trying to discourage you from using Ruby for
your needs; its just that, based on your needs as described, it looks
to me as if Python meets them better than Ruby at present:

  1. GUI - Native Look and Feel. According to wxRuby the bindings aren’t
    mature enough for production use. Does anyone have any experience
    with
    this and/or can you offer alternatives that provide a native look and
    feel (I

I don’t know enough about wxRuby to comment.

wxPython has this (Native Look and Feel), I think (used it some, a
while ago), not 100% sure, you can check on the site - http:/

  • to make sure. The site does say that it is cross-platform:

"wxPython is a cross-platform toolkit. This means that the same
program will run on multiple platforms without modification. Currently
supported platforms are 32-bit Microsoft Windows, most Unix or unix-
like systems, and Macintosh OS X.
"

but that doesn’t necessarily mean that it will have native look and
feel on all supported platforms. (The two are not the same thing.)
That’s why you will need to check.

wxPython pros: Its fairly easy to learn, at least for simple GUI apps
(e.g. a few widgets / controls and a file dialog or two). I was able
to build these simple ones - see the code, article and screenshots
available here (or from links from here):

  • in quite a short time, starting from zero knowledge of wxPython (I
    did know some Python from before), just by looking at the sample apps,
    and some reading of the docs.

See the quotes about wxPython: http://www.wxpython.org/quotes.php

  1. Databases - contemplating using ActiveRecord, but I would like to use
    ODBC to support multiple types of DB’s in a uniform way (if you know
    of
    alternatives to ODBC or ActiveRecord, please let me know).

I think, but again, not sure, that Python DBI + appropriate database
drivers, may meet this need. Basically Python DBI is similar to ODBC
(roughly), and to Perl DBI + DBD, as I understand. There’s also ODBC
support in the Win32 extensions package for Python - IIRC, Google for
‘win32all’ to get it. Its also available as a link from the Python for
Win32 MSI installer on python.org.
I’ve used Python ODBC some, it works and is easy to use.
See this for a simple example:

(See the second post at that page, titled "Publishing ODBC database
content as PDF
". The code shown in the post is not indented as per proper the Python
syntax (LiveJournal messed up the indentation), sorry about that, but
its trivial to correct if you know Python indenting rules). Also read
the Python ODBC docs and examples, of course.

  1. Binary - Are there any utilities for compiling Ruby into a binary
    executable? The issue is twofold, speed, and not handing the
    customer
    the source :slight_smile:

For Python, there is py2exe (for Windows only). I used py2exe recently
and it works well enough for the simple cases that I tried. (I tried
building EXEs for a simple Python hello-world program, and for a
simple wxPython GUI app based on my xtopdf toolkit. Both worked ok.)
For cross-platform (Windows and Linux, IIRC), there is PyInstaller
(Google for it), haven’t tried it out yet, just downloaded it
recently.

I don’t think you’ll gain much speed by this compiling step, though
(over and above what Python gives you itself, when it compiles
your .py files to .pyc files). The purpose of py2exe is more to hide
the source code than to speed it up, as I understand (could be wrong).

Note: py2exe only creates an EXE and DLLs needed, from your source and
its required Python modules. To create an installer, try InnoSetup
(for Windows only). I recently tried it out, version 5, again, it
worked well. Could create Windows SETUP.EXE-type installers for the
two EXEs described above. Worked ok.

I first learned Python, have been using it for some time for various
projects, and then learned Ruby, and have done some projects with Ruby
too.

I’ve been reading both the Ruby Cookbook and the Python Cookbook
rather thoroughly in the last few weeks (and trying out and modifying
many of the recipes), and what I’ve observed is that the two languages
are roughly similar in features. For basic features common to most
languages (constants, variables, arrays, hashes/dictionaries, file I/
O, classes, objects, modules/libraries, etc. - they work roughly in
the same fashion - though syntax obviously differs, you can mostly do
what you can in one of them, in the other as well. (Note that I’m not
talking about libraries here - this will obviously differ as each
language will have its own set of libraries for doing various tasks,
like networking and other areas - though even here there is a good
amount of overlap/similarity.)

For more advanced language features related to object-orientation,
metaclasses / metaprogramming, both have some support, but you might
or might not be able to do in one, what you can do in the other.

HTH
Vasudev Ram
Site: http://www.dancingbison.com
PDF toolkit (in Python): Conversion of other file formats to PDF download | SourceForge.net
Blog: http://jugad.livejournal.com

vasudevram a écrit :
(snip)

To me this means Ruby, Python, or, as mentioned above, Perl. If anyone

can tell me of a way to meet the above requirements in either Python
or
Perl, I’m all ears (I just prefer Ruby).

  1. GUI - Native Look and Feel. According to wxRuby the bindings aren’t
    mature enough for production use.
    (snip)
    wxPython has this (Native Look and Feel), I think

It does - just like wxRuby, since both are language-specific bindings to
the C++ wxWidgets toolkit.

And FWIW, wxPython has been used on production for many years, so I
think it qualifies as “production ready” !-)

(snip)

  1. Databases - contemplating using ActiveRecord, but I would like to use
    ODBC to support multiple types of DB’s in a uniform way (if you know
    of
    alternatives to ODBC or ActiveRecord, please let me know).

In Python, you may want to have a look at SQLAlchemy, which offers lots
of things from the “db abstraction layer” to the full-blown (and
possibily somewhat ActiveRecord-like, cf the Elixir project) ORM.

(snip)

  1. Binary - Are there any utilities for compiling Ruby into a binary
    executable? The issue is twofold, speed, and not handing the
    customer
    the source :slight_smile:
IIRC, Ruby is actually still an interpreted language. Python is much like Java wrt/ this issue : it's byte-compiled (the difference being that this step is automagically managed by the VM).

IOW, you won’t gain any speed from the existing packaging systems(but
then, if your project is mostly a GUI/DB tunnel, the two most critical
parts are already somewhat optimized). And the level of protection
gained from these packaging systems is very debatable at best (which,
FWIW, is also the case with Java).

(snip)

I first learned Python, have been using it for some time for various
projects, and then learned Ruby, and have done some projects with Ruby
too.

I’ve been reading both the Ruby Cookbook and the Python Cookbook
rather thoroughly in the last few weeks (and trying out and modifying
many of the recipes), and what I’ve observed is that the two languages
are roughly similar in features.

Yes.

(snip)

For more advanced language features related to object-orientation,
metaclasses / metaprogramming, both have some support,

s/some/great/g

Both Ruby and Python are known for this.

but you might
or might not be able to do in one, what you can do in the other.

I’d say that - wrt/ “advanced” programming tricks - most of what you
can do with one can be done with the other - but usually in a very
different way. While Ruby and Python have similar features and may look
very similar at first sight, their respective object models are totally
different.

Basically, it's a matter of - which language *you* prefer - which one has the best libs for your app

It seems that, in your case, you prefer Ruby but Python may or not
have the best/more mature toolkit. So the best thing to do would be to
first try to write a quick ‘proof of concept’ program in the language
you prefer. Then, if you’re still in doubt, write the same program in
Python.

My 2 cents (and friendly salutations to the Ruby community).

M. Edward (Ed) Borasky wrote:

Yeah … jRuby has a cross-platform GUI and all the database stuff. I
don’t particularly like the typical Java GUI look and feel, but that’s
just my personal taste.

Generally the default Java L&F tries to match the host platform as well
as possible, and in Java 6 it’s pretty damn close. Of course, you can
plug in any L&F you want without changing the code.

  • Charlie

[email protected] wrote:

wxPython uses the native widgets of the platform it is running on in
most (if not all) cases, so if you want the “native look & feel”, than
that is the way I would go. They have the best user’s group I’ve seen
so far as well.

I’ll have to admit that as much as I like the Qt look and feel, wxGTK on
Linux and whatever flavor of wxWidgets runs on Windows does an excellent
job on a tool that I use regularly – PgAdmin3. It’s a bitch to build
from source, though – get the RPMs (or .debs or ebuilds).

On 7/16/07, SonOfLilit [email protected] wrote:

Of course - actually, personally I prefer Camping over Rails.

But Rails has all the features, all the glitter and all the userbase.

That’s why I recommended it.

Aur
Aur if you think that Camping is better why do you go mainstream and
recommend Rails ???
Difficult to understand.

Cheers
Robert

Hi,

Of course - actually, personally I prefer Camping over Rails.
But Rails has all the features, all the glitter and all the userbase.
That’s why I recommended it.

why do you recommend things you aren’t totally ‘in sync’ with. :slight_smile:
Things having glitter… this is blinding people, user base, Java has
a huge userbase, I still would only recommend it on special occasions.
What I do recommend though is ‘check things out’ and ‘dont’t take
stuff for granted’. Try out several frameworks, not everything that
glitters smells good, and good smell is the base of all good feelings.
And if ‘feeling good’ isn’t the only thing worth living for, what else
is it…

Kash

On 7/21/07, Robert D. [email protected] wrote:

Difficult to understand.
More mature, more documentation, more community, more tools - Rails is
easier to cope with.

It’s also better, based on my limited impression, for big projects,
whilst Camping shines in small projects - which is why I prefer it for
my own work.

Aur

Bruno Desthuilliers wrote:

s/some/great/g

Both Ruby and Python are known for this.

Thanks for the info. (I don’t know much about metaprogramming etc. in
either languages - just started exploring those topics recently.)

I’d say that - wrt/ “advanced” programming tricks - most of what you
can do with one can be done with the other - but usually in a very
different way. While Ruby and Python have similar features and may
look
very similar at first sight, their respective object models are
totally
different.

Can you briefly explain what you mean by “their respective object
models are totally different”? Do you refer to how the object-
orientation (classes, objects, etc.) is implemented in the two
languages?

Thanks
Vasudev