Ruby on AIX?

We’re looking at big IBM hardware running AIX as a potential
deployment platform for the big credit card processing Rails and Ruby
stuff that my team is currently building. I was wondering if anyone
else is running on AIX or knows if Ruby is well-supported on this
platform.

I googled the subject, but
http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/3daaf60b012c1921
is the only thing I found – it’s not 100% confidence inspiring.

It seems like more people out there are running Ruby on Solaris, but
the client is indicating that they’d rather host our stuff on the IBM
servers rather than Fujitsu.

Any advice is appreciated.

Thanks,
Obie

I have come across an issue that might currently be an obstacle
for usage of rails in certain applications, for example finance
applications.

The problem of floating point is that it rounds in a way that you
cannot control. Just think of a web shop where you buy stuff and
the sum you have to buy is like 1 cent off the sum that you would
get with a calculator. So sometimes it is a requirement to have control
about how rounding is done. Off course, types like Rational or
Ruby’s BigDecimal can help. But the standard way to work with
this is to have something like Java’s BigDecimal, which is basically
an integer with a power of 10 for scaling. Since the name
“BigDecimal” is already occupied for longer floating point numbers,
this would need another name. So I started a rubyforge project
long-decimal with file name longdecimal.rb and class name LongDecimal
for this. It seems not too hard to do this, but it might still
take a few days to complete, because I can only work like an hour
or so in the evening on it.

In case this thing (or some other project going for the same
goal) achieves a status of being useful, it might be considered
a good idea to allow ActiveRecord to use this, because it
matches the common numeric types of the database more closely.

Any comments about this?

Best regards

Karl

If I was using Rails to write financial apps, which by their nature
tend to be business-critical, I’d be doing my money calculations
within database functions rather than Rails/Ruby code.

Databases have been doing money calcs for years, and the best
practices for the various database products are now widely known.
Regardless of which database you’re using, a Google search will turn
up stored function code that does money calculations correctly and
accurately for your product.

If you try doing this in Rails, you might run into a world of trouble
if you make a mistake. Is your Ruby code going to work with every
type of database out there, or is there some gotcha in e.g. MySQL or
Firebird that’s going to bite at some point? Is it worth the risk?

My 2c…

Dave M.

Check out the money gem:

gem install money

Works perfectly with composed_of.


– Tom M.

If I was using Rails to write financial apps, which by their nature
tend to be business-critical, I’d be doing my money calculations
within database functions rather than Rails/Ruby code.

There are many answers possible. Let’s say you do standard
calculations.
They can be done with existing tools, no need to do them in Ruby.
But now let’s assume we want to do a web shop with something special,
which is not around. Then this needs to be done for the specific web
shop
(or finance application or whatever, something requiring the kind of
accuracy
needed for finance apps). The java-guys would most likely do it in
java,
not in PL/SQL. Would the ruby-guys automatically go for PL/SQL (or
whatever
the DB has to offer for stored procedures)? I’d say yes, if the PL/SQL
is
there and easily integrated. That would by the DRY-principle in a
way…
But if it isn’t there?

If you try doing this in Rails, you might run into a world of trouble
if you make a mistake. Is your Ruby code going to work with every
type of database out there, or is there some gotcha in e.g. MySQL or
Firebird that’s going to bite at some point? Is it worth the risk?

I do not believe so much in DB-independence. So it would be Oracle or
PostgreSQL.
And a big big migration, if this changes. Yes, mySQL would probably be
possible
as well, also DB2. I do not really know firebird well enough to tell
(only firefox and thunderbird :wink: )
Don’t get me wrong, rails supports great DB-indepence and this is
appreciated
very much. But the actual application usually takes some advantage of
DB-specific
stuff, so it throws away the DB-independence that rails would have
provided.
Which is ok for an app that is only installed a couple of times in the
world.

Best regards,

Karl

Don’t start something new.

If Money is not complete or satisfactory, patch away!

We don’t need TWO money objects!


– Tom M.

I’ve successfully compiled and installed Ruby 1.8.3 on AIX, I have not
tried 1.8.4 yet… I had to do a lot of fiddling with it to get it to
compile, but that was on AIX 5.1… I have heard that it compiles
just fine on AIX 5.3.

-Will

There won’t be two money classes.
There could be another numeric type, like the BigDecimal of Java,
but named LongDecimal, because BigDecimal is already occupied for
something different in Ruby.
This numeric type could be used for money instead of Integer,
when it is finished. This could make the money class better.
But it could also be used for other stuff, not directly related
with money.

Tom M. wrote:

Don’t start something new.
If Money is not complete or satisfactory, patch away!
We don’t need TWO money objects!

So I do not see a duplication.

Best regards,

Karl

Tom M. wrote:

Check out the money gem:

gem install money

Works perfectly with composed_of.

Yes, that is really cool and useful and actually working today!
I am not sure, if it really goes far enough to cover everything.
Just to give you some points:

  • there are other numbers to deal with, which do not belong to
    currencies
  • the smallest unit of currencies does not follow the same pattern as
    with EUR or USD
  • sometimes it is necessary to increase the precision to more digits for
    a certain calculation
  • there are like half a dozen different rounding rules for division to
    choose from
    So I think that there might still be some justification to have this
    LongDecimal going.

Best regards,

Karl

Obie,
I have a mixed of Ruby 1.6.7 and Ruby 1.8.2 running in over 75 RS/6000
under
AIX 4.3.3, AIX 5.2.0 and AIX 5.3.0. I had some issues with the
installation,
but with the help of this great Ruby gang I was able to quickly address
my
issues.
Although I do some networking (TCP and UDP protocol) with Ruby, I am not
an
experienced Ruby programmer. But the point is that Ruby works just fine
and
I try to use it always in place of the Korn Shell, which is the default
shell in AIX.

Victor

Hi,
I reckon this is my first post to this mailing list.

The other day, I stumbed across the need to reindent some ruby code. So
I
started hacking some little script for it. Then I thought that probably
somebody else has had the same idea, so I looked around for this kind of
project. I found some references to the idea in the mailing-list
archives,
but no real project. I also found a project in
http://rindent.rubyforge.org/, but there was no access to any code.

So I have more or less finished my quick hack, which incidentaly is also
named Rindent, and which can be found here:
http://blep.org/doku.php?id=proyectos:scripts
But still, it is very limited and all; so I would like to know if
anybody
has written some better implementation, has worked on the idea of the
parser making a tree of the code and all that?

Thanks,
Diego

On Feb 10, 2006, at 12:52 AM, Karl B. wrote:

So I do not see a duplication.

Well…not directly. :slight_smile:

My point is that if you have specialized knowledge of handling
money in applications more accurately than the money gem does
currently, then by all means apply that knowledge to the Ruby
and Rails world.

If you think that a new class will help money, then please
create the class AND patch money to use it (or work with
Money’s authors), and let the world know that money is better
than ever in addition to letting the world know that this
other class exists for general use. But please do not release
the the gem as an alternative, as that will just dilute the
uniformity of Rails based money handling.

Mark my words as I paraphrase one of the least recognized
geniuses of all times:

We must all hang together, or assuredly we shall all hang
separately.

You see, Benjamin Franklin understood the meaning of Ruby on
Rails over 200 years ago. :slight_smile:


– Tom M.

On Sat, Feb 11, 2006 at 03:05:26AM +0900, Diego Cano L. wrote:

The other day, I stumbed across the need to reindent some ruby code.

Any worthwhile editor should have a Ruby mode that handles indenting
for you.

(In emacs, use M-x indent-region)

regards,
Ed

DÅ?a Piatok 10 Február 2006 19:15 Edward F. napísal:

(In emacs, use M-x indent-region)

I also think you can run emacs in batch mode and have it reindent a
whole file
somehow.

What I couldn’t figure out within the time I get sick of going through
info
manuals is how to remap RUBY-REINDENT-NEWLINE-AND-INDENT (or however the
function is called) to RET in init.el or custom.el in a load hook for
ruby-mode.el short of hacking ruby-mode.el itself. Any budding (X)Emacs
gurus
able to help?

David V.

En Fri, 10 Feb 2006 19:15:10 +0100, Edward F. [email protected]
escribió:> On Sat, Feb 11, 2006 at 03:05:26AM +0900, Diego Cano L. wrote:

The other day, I stumbed across the need to reindent some ruby code.

Any worthwhile editor should have a Ruby mode that handles indenting
for you.

(In emacs, use M-x indent-region)

regards,
Ed

I am aware that it should (I use Vim, by the way), but it doesn’t. I
have
all imaginable variables in my .vimrc (indent on, smartindent, etc.),
but
all I have is syntax colours, no autoindentation.

It’s not a big problem for the code I write now, since I am quite
careful
with correct indentation and all; but for old messy code, it could help
me
a lot to have a auto-reindenter, and even better, a code beautifier
limiting code to 80 columns, uniformising spaces after commas and all
this.

Thanks,
Diego

On 2/10/06, Diego Cano L. [email protected] wrote:

I am aware that it should (I use Vim, by the way), but it doesn’t. I have
all imaginable variables in my .vimrc (indent on, smartindent, etc.), but
all I have is syntax colours, no autoindentation.

I use vim, and the following works just fine for me:
:1
shift-v
shift-g

I always forget vim config stuff, but I think these are the relevant
config variables in my vimrc:
set formatoptions=tcqronwl " see :help fo-table
set cindent
set autoindent
set nosmartindent

Cameron

On Fri, Feb 10, 2006 at 10:10:07AM -0800, Tom M. wrote:
[…]

Mark my words as I paraphrase one of the least recognized
geniuses of all times:

We must all hang together, or assuredly we shall all hang
separately.

You see, Benjamin Franklin understood the meaning of Ruby on
Rails over 200 years ago. :slight_smile:

I agree wholeheartedly.

This is also a substantial advantage of ruby over perl.

Having two (or in the case of perl, sometimes ten) ways to do
something where one good way would suffice only leads to confusion.


- Adam

** Expert Technical Project and Business Management
**** System Performance Analysis and Architecture
****** [ http://www.everylastounce.com ]

[ Adam Fields (weblog) - - entertaining hundreds of millions of eyeball atoms every day ] … Blog
[ Adam Fields Resume ]… Experience
[ Adam Fields | Flickr ] … Photos
[ http://www.aquicki.com/wiki ]…Wiki
[ http://del.icio.us/fields ] … Links

DÅ?a Piatok 10 Február 2006 19:27 Diego Cano L. napísal:

regards,
Ed

I am aware that it should (I use Vim, by the way), but it doesn’t. I have
all imaginable variables in my .vimrc (indent on, smartindent, etc.), but
all I have is syntax colours, no autoindentation.

Weird, last time I used Vim, it worked fine in this respect. But that
was GVim
back in Windows times, and both the Windows Vim and XEmacs seem to come
with
slightly more sensible defaults in some respects.

It’s not a big problem for the code I write now, since I am quite careful
with correct indentation and all; but for old messy code, it could help me
a lot to have a auto-reindenter, and even better, a code beautifier
limiting code to 80 columns, uniformising spaces after commas and all this.

Bite into the bitter pill and have an emacs in batch mode chomp over
your old
code? Although it might not quite work, the emacs ruby-mode doesn’t
quite
support auto-fill-mode (the code to limit code to a set page width)
properly,
or handle multi-line comments and such.

And a pure ruby source code beautifier for Ruby does sound interesting,
but
there are some pitfalls - especially in the page width limitation when
determining where to put a line break.

Wasn’t there a project to make a self-hosting Ruby? You might want to
have a
look at how far they got and possibly rip… err… -borrow- their Ruby
parser, and then just write a pretty printer for their code model to
save
yourself a lot of work?

David V.

Diego Cano L. wrote:

Ed

Thanks,
Diego

http://rubyforge.org/projects/vim-ruby/

Tom M. wrote:

My point is that if you have specialized knowledge of handling
money in applications more accurately than the money gem does
currently, then by all means apply that knowledge to the Ruby
and Rails world.

I will see if I can help improve “money”.

If you think that a new class will help money, then please
create the class AND patch money to use it (or work with
Money’s authors), and let the world know that money is better
than ever in addition to letting the world know that this
other class exists for general use. But please do not release
the the gem as an alternative, as that will just dilute the
uniformity of Rails based money handling.

I agree with you. I think if we can persue this path, the outcome
would be pretty much identical to what I would consider if there
were no preexisting “money”-library and it would have to be written
from scratch.

Best regards,

Karl