[OT]Is Ruby Top 1 of Programming Languages that are Loved?

static automagic interface inference :))

···

il Thu, 13 May 2004 08:12:50 +0900, Gavin Sinclair gsinclair@soyabean.com.au ha scritto::

So, Sean, what kind of type checking would you like to see in Ruby?
And what kind of type checking do you thikn is possible?

“Bill Kelly” billk@cts.com wrote in message news:00f201c43872$65c0ae10$6442a8c0@musicbox

Why does that somehow sound in violation of at least one of the
laws of thermodynamics? …

:slight_smile:

It requires a lot of effort on the part of the person implementing the
type-checking system, but none on the part of the users.

As Gabriele said in response to Gavin’s question:

So, Sean, what kind of type checking would you like to see in Ruby?
And what kind of type checking do you thikn is possible?

static automagic interface inference :))

This is exactly correct. This is the sort of type checking that some
languages, like Haskell, have. Of course, in Haskell you can get much
more strict, because Haskell doesn’t have Objects, and functions are
strongly typed. The best you can do in Ruby is guess at the
duck-typing and ignore issues of self-modifying code. In Ruby, type
checking must be optional, and be considered a debugging tool rather
than a language feature; I doubt if Ruby can ever be made strongly
typed without removing some other language features.

In any case, consider the following code:

def my_func( my_arg )
my_arg.each { |x| x.add( 1 ) }
end

A type checker can determine a number of things from this:

  1. my_arg must implement each()
  2. The objects iterated over by each() must all implement add()
  3. The add() method of these objects must accept Fixnums

A deep type checker could verify that both of these conditions hold,
and could detect errors elsewhere in the code such as:

my_func( 1 )
my_func( %w{ hello world } )

This could all be done outside of the Ruby VM, of course; implementing
this would, IMO, be a large, possibly complicated, job. However, it
could be done, and could check most Ruby objects in
non-self-modifying code.

Again, I don’t recommend that this be default Ruby behavior. I’d love
to see it tied to the “-c” argument, so that, when testing, one could
run a type check test.

I wouldn’t say that mistyping based errors are rare in Ruby, so
something like this would be useful. To be honest, though, it is too
large a job for me to undertake – without getting paid for it – and
would probably best be done within the Ruby VM where we have access to
the parse tree.

— SER

Matt Lawrence wrote:

Ruby, the distribution, needs more binary packages available. I have over
150 AIX systems that I would love to install Ruby on, but I know very
little about how to create a .bff (aka “installp” format) package. And,
unfortunately, not a lot of time to mess with it.

Hmm, does it compile ok for you? Someone told me recently he had
problems on AIX.

I’ve created some intallp packages, but gosh, it’s been years.

IBM now distributes CDs of Open Source software along with their AIX
install CDs. Getting Ruby onto those would be fantastic!

Now there’s an idea. Maybe I can talk to someone over here. So many
of my IBM contacts are gone now, though.

Hal

Thank you for that, I’ll explore those further.

    Hugh

Hugh Sasse wrote:

Googling further as a result suggests that config.nt replaces

Babelfish agrees, mainly.

One reply from the original poster says:

    [...]
···

On Tue, 11 May 2004, daz wrote:


BTW: The Perl module they speak of has a Ruby port:
[ANN] http://ruby-talk.org/89997
http://rubyforge.org/projects/win32console/

(by Gonzalo Garramuno using the Michael L. Semon library)

I was prepared for this not to work for me when I tried it
(with no ANSI.SYS loaded) and found that it did (Win9x).

This lack of support in cmd.exe amazes me: PCs have supported colour
since the late 80’s… I could see nothing from Microsoft on the
topic, not even deprecating its use, for some reason.

They confirm the shocking news:
Microsoft Support
(mentioned in the page you linked to)

daz

This is exactly correct. This is the sort of type checking that some
languages, like Haskell, have. Of course, in Haskell you can get much
more strict, because Haskell doesn’t have Objects, and functions are
strongly typed.

yet, ocaml is OO and can do type inference anyway. In the end we don’t
really need to determine what an object is, we just want to check if
it implements something…
More than this, it is interesting the paper from latest Pycon about
starkiller, a python compiler that make use of type inference to run
python (somtimes) faster than equivalent C code.

The best you can do in Ruby is guess at the
duck-typing and ignore issues of self-modifying code. In Ruby, type
checking must be optional, and be considered a debugging tool rather
than a language feature;

It would be nice even if this was just some kind of tool.
Say, ruby -rcheck/static myprog

But I’m way too stupid to really understand this kind of problems

···

il 13 May 2004 07:50:24 -0700, ser@germane-software.com (Sean Russell) ha scritto::

Matt Lawrence wrote:

Ruby, the distribution, needs more binary packages available. I have over
150 AIX systems that I would love to install Ruby on, but I know very
little about how to create a .bff (aka “installp” format) package. And,
unfortunately, not a lot of time to mess with it.

Hmm, does it compile ok for you? Someone told me recently he had
problems on AIX.

I’ve created some intallp packages, but gosh, it’s been years.

Umm, no, I don’t have a C compiler. I could install gcc, but I just
haven’t had time. Among other things, the team decided that I’m “the”
Linux guy, so I don’t spend much time on the AIX systems.

IBM now distributes CDs of Open Source software along with their AIX
install CDs. Getting Ruby onto those would be fantastic!

Now there’s an idea. Maybe I can talk to someone over here. So many
of my IBM contacts are gone now, though.

There’s a lot of that going around. I have no idea how to make it happen,
but, again, it would rock.

– Matt
The American Non-Sequiteur Society: We may not make sense, but we do like
pizza.

···

On Fri, 7 May 2004, Hal Fulton wrote: