Can we attack the 'not enough libraries' thing straight on?

@x, @y, and @tem are all the same object, viewed through different
variables. Since you use printf, I presume you know C. They are like
pointers.

BTW printf “#{@x}\n” == puts @x

Gavin

···

On Thursday, January 30, 2003, 3:13:43 PM, Maggie wrote:

Hi there,

I wrote a simple program to enumerate an array. The code is as below:
class Test
def initialize
@x=[0,1,2]
@tem=@x
@y=@x
y=del(@tem)
printf “#{@x}\n”
printf “#{@y}\n”
end
def del(x)
x.delete_at(0)
return x
end
end
a=Test.new

But the output is :
12
12
Why @x and @y are changed? Is there anyone can tell me how to deal with
this problem?

Hi there,

I wrote a simple program to enumerate an array. The code is as below:
class Test
def initialize
@x=[0,1,2]
@tem=@x
@y=@x
y=del(@tem)
printf “#{@x}\n”
printf “#{@y}\n”
end
def del(x)
x.delete_at(0)
return x
end
end
a=Test.new

But the output is :
12
12
Why @x and @y are changed? Is there anyone can tell me how to deal with
this problem?

Because @tem is a reference (pointer) to the object, which is the array
[0,1,2], and so is @y. @x,@y and @tem are all pointing to the same Array
object, they are not different objects.
If you want different objects, you have to make a copy:

Here’s an example using irb:

irb(main):001:0> a = [0,1,2]
=> [0, 1, 2]
irb(main):002:0> a.id
=> 537808534
irb(main):003:0> b = a
=> [0, 1, 2]
irb(main):004:0> b.id
=> 537808534
irb(main):005:0> c = a.clone
=> [0, 1, 2]
irb(main):006:0> c.id
=> 538070796
irb(main):007:0>

···

On Thu, 30 Jan 2003 13:13:43 +0900 “Maggie Xiao” mxiao@ee.ualberta.ca wrote:


Daniel P. Zepeda

Daniel Carrera dcarrera@math.umd.edu writes:

I don’t know what Simon thinks, but I really do think that exactly. It
took me a while to find NArray. The only reason why I can find it in RAA
now is because I already know it exists.

Right. I believe there are decent Ruby modules for handling MIME mails;
of course, I can’t find them, because they’re not sensibly named.

But hey, that doesn’t matter! All that matters is that people deliver
an unindexable, undocumentable, inexplicable mass of code. Then we’ll
catch up with CPAN, right?

···


I have heard that the universe does not support atomic operations
(although I’ve not seen the code.) If this is true, perhaps we should
report the bug to the manufacturer.
- Mark-Jason Dominus

matz@ruby-lang.org (Yukihiro Matsumoto) writes:

Libraries and programs have different naming requirement. I think
Simon was referring library naming convention.

Precisely. It’s all covered in

Programs should have attractive names; libraries should have functional
names.

···


I have heard that the universe does not support atomic operations
(although I’ve not seen the code.) If this is true, perhaps we should
report the bug to the manufacturer.
- Mark-Jason Dominus

I agree exactly.
Let the author choose whatever’s the name which he/she like, regardless
whether it’s a program or a library (if you can’t even name your own
baby, that takes the fun out of a lot of things, right?)

Just need a bunch of meta-data, which gets indexed, sorted and stored.
Users can then search for name (which can be very “cutesy”), category
(e.g. graphics, application, library, etc.), function, description, etc.

Tom Sawyer wrote:

···

not to get on the name issue, but the easy solution is to have a very-brief
description field along with the name, hence:

Package Name Descriptor
Rouge Lisp Interpretor

tom sawyer, aka transami
transami@transami.net

                               .''.
   .''.      .        *''*    :_\/_:     .
  :_\/_:   _\(/_  .:.*_\/_*   : /\ :  .'.:.'.

.‘’.: /\ : ./)\ ‘:’* /\ * : ‘…’. -=:o:=-
:/:‘.:::. | ’ ‘’ * ‘.'/.’ (/’.‘:’.’
: /\ : ::::: = / -= o =- /)\ ’ *
‘…’ ‘:::’ === * /\ * .‘/.'. ‘._____
* | : |. |’ .—"|
* | _ .–’| || | _| |
* | .-‘| __ | | | || |
.-----. | |’ | || | | | | | || |
__’ ’ /“\ | '-.”". ‘-’ ‘-.’ '` |.


Wai-Sun “Squidster” Chia
Techinical Consultant
Consulting & Integration
“Just Another Ruby Miner”

look at boost and you’ll understand what i meant : the idea is that very
good
modules (like, say, amrita) are all potential candidates for inclusion
into a standard library and thus should somehow be ‘comformant’. for an
example of how NOT to do this open up ten or so of the ‘standard’ modules
which ship with perl! if the authors who write such good modules (rdoc,
amrita, testunit, etc) had a set of module standards to follow it would be
trival to incorporate them into the next release of ruby, and the cvs version
before that.

-a

···

On Thu, 23 Jan 2003 dblack@candle.superlink.net wrote:

  • libraries wishing to become part of the ruby standard library should
    follow some sort of standards (naming being one of them) and perhaps fit
    into some overall package management system (like the cpan shell). they
    should install in standard places, have standard docs (in fact it’d be
    great if there were a site_ruby/doc directory doccumenting every thing
    installed on your system), etc.

  • other modules can do what they please

The standard library is a different matter – at least, that term is
generally reserved for the stuff in the distribution itself. RAA is
all add-on – the well-named stuff as well as the miscellany :slight_smile:

====================================

Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================

I would like to contribute a few thoughts on the topic. When installing
additional ruby packages the first thing you have to do currently is
looking into the README file to see if the package is installed via

ruby extconf.rb && make && make test && make site-install

or

ruby install.rb

or

ruby install.rb config && ruby install.rb setup && ruby install.rb install

or perhaps it’s something completely different (The example commands
above were taken from: ruby-gnome-all-0.29, rdoc-beta-1, date2-3).

It would be very nice if installation works just like software written
using GNU autoconf (./configure && make && make install). All the
package managers of the various linux distributions use a uniform way of
installation, generally something like “retrieve that thing from
harddisk/from the web, unpack it, then run a certain script with a
fixed, predefined name to actually install it”. What exactly that
script does it not important, but the interface should not vary. My
proposition would be: installation of ruby modules is done via

ruby install.rb

which configures the package, builds it and installs it. Nothing more
and nothing less.

···

On Thu, 23 Jan 2003 11:51:18 +0900, Tim Bates wrote

On Thu, 23 Jan 2003 01:12 pm, ahoward wrote:

this is one idea CPAN lacks - a central set of standards which modules must
conform to (unit testing for modules?) and a way to separte the really good
modules from all the chatter and useless crap…

Debian GNU/Linux gets this just right, IMHO. They have a policy that packages
wishing to be placed on their central set of package mirrors must adhere to,
a proper dependency system, mirroring of packages so they’re always available
and not dependant on the author’s personal server/ISP (one of my pet hates
about RAA), command-line and curses tools for installing/removing/viewing
packages and their dependancies, policies concerning the quality, quantity
and location of documentation, etc… This packaging system is the one and
only reason I use Debian over any other Linux distribution. It would take a
significant amount of effort to get such a beast running for Ruby, but once
done I think the benefits would be phenomenal.


Timon Christl me@christltimon.de
AIM: sgmfragcollector
ICQ: 172280602

Getting back to the original poster’s question, “what is not available?”,
I grepped through my Perl sources for ‘use’ to find what modules I’d be
missing if I had
to write any of that over again:

What I found was that the “missing” things fell into 4 basic categories

  1. Things that Ruby already has in the core, or that
    Ruby’s design obviates the need for, which Perl needed a
    module to add the functionality
  2. Things I wrote myself that were project-specific
  3. Things that are not a big deal, could probably code up in less
    than an hour
  4. Truly missing needed functionality

In the not-a-big-deal category:

User::grent
User::pwent – Password a group utilities. Admittedly, not a big deal,
searched for ‘password’
Proc::killall - kills off a process by name, searched for ‘process’ and
’killall’

In the truly missing category:

Net::DNS - A DNS interface, to create and process query packets
- searched for 'DNS’
CPAN

There was a last category in my mind, things that I didn’t know
about and was pleasantly surprised to find:

SNMP - an interface to UCD SNMP

and

sablot - an interface to the ginger alliance’s XLST engine.

Of those things I say are missing, I did search RAA and the Pickaxe class
and
standard library guides, for the obvious keyword with no results.

I find it telling that the OP asked for what pieces were missing, but the
discussion tended to naming conventions and module management. There is
a ton of stuff on CPAN, but a lot of it is not needed, because Ruby
obviates
the need for it, and of course, my list is not exhaustive, just my
experiences.
Maybe after all the discussion is done, we’ll find that CPAN is huge
because
it has to be, to add stuff to Perl that Ruby already has, and that the
small
size of Ruby doesn’t show the lack of available functionality, but the
power
of the core Ruby.

···


“Daniel P. Zepeda” <daniel@z,e,p,e,d,a,-,z,o,n,e.net>
(Remove commas for address)

This only takes into account the web site for CPAN… the real power is in
perl -MCPAN -eshell…

···

That concludes my tour of search.cpan.org. I don’t see any killer
feature in it that puts any daylight between it and RAA, just a more
professional look and a few little things. I’ve said it before, but
the last major update to RAA was a quantum leap, and the whole
community applauds your efforts (^^)// so the pace of improvement is
already very good.

I very strongly disagree with installing docs in my lib dir. Of
course, anything in the FreeBSD ports tree should be moving over to
/usr/local/share/doc/ruby, but if I am installing a non ported package
I do not want it cluttering up my lib dir with things that are not
libraries.

from hier(9) on FreeBSD:
lib/ archive libraries

          ...

          share/

          ...

                  doc/       miscellaneous documentation; ...
···

Gavin Sinclair (gsinclair@soyabean.com.au) wrote:

About “standard docs”, I think this is the way forward:

  • packages have a doc directory

  • this gets installed along with the package so it ends up in
    something like
    site_ruby/1.6/froboz/doc/package.info
    /index.html

  • it can therefore be determined which packages have been installed
    and have documentation installed


Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Tim Bates tim@bates.id.au writes:

this is one idea CPAN lacks - a central set of standards which modules must
conform to (unit testing for modules?) and a way to separte the really good
modules from all the chatter and useless crap…

Debian GNU/Linux gets this just right, IMHO. They have a policy that packages
wishing to be placed on their central set of package mirrors must adhere to,
a proper dependency system, mirroring of packages so they’re always available
and not dependant on the author’s personal server/ISP (one of my pet hates
about RAA), command-line and curses tools for installing/removing/viewing
packages and their dependancies, policies concerning the quality, quantity
and location of documentation, etc… This packaging system is the one and
only reason I use Debian over any other Linux distribution. It would take a
significant amount of effort to get such a beast running for Ruby, but once
done I think the benefits would be phenomenal.

rpkg was meant to be just that and went as far as handlig dependencies
and compiling on the fly. Unfortunately some months ago I got busy
with another job and at about the same time the new RAA and
raa-install were announced, interest in it declined somewhat and I
felt less of in a hurry to complete it.

(Actually, in the last week two persons contacted me because they
couldn’t access it anymore on allruby.com, so maybe I wasn’t totally
right.)

Massimiliano

Hi, Gavin and Daniel,

From: “Gavin Sinclair” gsinclair@soyabean.com.au
Sent: Saturday, January 25, 2003 12:25 AM

  1. Find a more accessible domain name. www.ruby-lang.org/raa is not as
    easy to remember as www.cpan.org. Unfortunatelly
    (ruby|cran|raa).(org|net) are all taken.

How do you feel raa.ruby-lang.org ?

It’s logical and compelling.

We ruby-lang.org admins are talking about its possibility.

  1. RAA is hard to browse. I think that a setup of the style of
    www.search.cpan.org is best.

I don’t use CPAN modules so I seldom use CPAN search…

What is the most significant point of all the features which
CPAN search have and RAA don’t have, do you think? We’ll
change it better and better untill RAA.succ comes.

I never use it, but in order to justify this “me too”-ish post, I did
my bit and tried to answer your question anyway :slight_smile:

Thank you for your great summary. Much help us.

search.cpan.org provides the following features:

  1. Clear enumeration of categories up front

In contrast to RAA’s very hierachical structure, CPAN seems to be
organised around 26 categories. When I used to use it, I actually
found it confusing, as I roughly knew what I was looking for, but
couldn’t decide which of 2 or 3 categories was the most logical place
to find it. So I used it for browsing, but was never convinced that
it all made sense.

Sure. CPAN seems to have many(26) top categories, compared
with RAA has only 4 top categories. But from another point;
CPAN top categories are for library, right? RAA library section
has 86 subcategories now.
http://www.ruby-lang.org/raa/cat.rhtml?category_major=Library

Hmm. Should RAA have independent library (metadata) archive
such as RLA: Ruby Library Archive?

Too few prepared category(4: Doc, Ports, App, and Lib) and
too much author opened free category(86 for Lib, now) are
exactly a big problem of RAA. But continuous categorizing
(not only at once, continuously) is much more than one or two
person do.

  1. Search options (search in modules, distros, or authors, or all)

Pretty straightforward really. RAA’s not so big that it needs this.
Search all works fine.

Sure. It’s on our ToDo so you’ll see in the future.

  1. Browse by author

Good idea, but annoyingly over-hypertext. I want to browse all
authors on one page, with an index up the top using anchors. This
forces you onto a different page for each author.

I’d like this feature in RAA.

http://www.ruby-lang.org/raa/owners.html
and
http://www.ruby-lang.org/raa/owner.rhtml?id=8
We already have a pae for each owner?
Do you mean that the owner listing page might be simplified?

  1. Recent updates

Browse the last 7 days of “uploads”. I hate arbitrary limits - why
not allow you to go further back. But it’s good anyway.

For now, please use YARAA: http://ruby.yi.org/raa/ .
Metadata is replicated via SOAP between RAA(master) and
YARAA(replica). YARAA developed features will be integrated
to RAA in the future.

RAA should allow you to view “recent updates” separately from “recent
additions”, but I’ve carped on about that enough and you’ve agreed to
support it in future. (^o^)/

Yeah. I hope you’ll see in this month.

  1. About/Mirrors/Feedback

Various meta-information/services.

  1. FAQ

RAA should have one, including plans for future updates.

I like those to have.

So I dug into a search to see what functionality I could find. I
searched for MIDI in Modules and got 33 results. (MIDI in all got 413
or something. Go figure.)

Good feature: change the number of entries per page. The output is
nice and neat; RAA could take an example here.

Sure. I pushed it the ToDo list.

That concludes my tour of search.cpan.org. I don’t see any killer
feature in it that puts any daylight between it and RAA, just a more
professional look and a few little things. I’ve said it before, but
the last major update to RAA was a quantum leap, and the whole
community applauds your efforts (^^)// so the pace of improvement is
already very good.

Again, many thanks for your survey. I’ll try to reflect your
suggestions.

PS. See サービス提供終了のお知らせ for
the great Japanese smileys!

I didn’t know the site. Good explanation. (^-^)/

Regards,
// NaHi

Hi,

From: jbritt@ruby-doc.org
Sent: Saturday, January 25, 2003 1:10 AM

What is the most significant point of all the features which
CPAN search have and RAA don’t have, do you think? We’ll
change it better and better untill RAA.succ comes.

Um, on CPAN, module authors seem to write better descriptions of their code. Very frustrating to go to RAA, and see:

Name Short Description
SomeNonDescriptiveName SomeNonDescriptiveName

As you may know, it’s from historical reason.
“Short Description” field is added in Oct. 2002 and we RAA
maintainer only filled it with its name.

I hope owners to change “short description” to describe their
project more clearly.

Regards,
// NaHi

Hi,

···

In message “Re: wait for more perl programmers! (Re: Can we attack the ‘not enough libraries’ thing straight on?)” on 03/01/25, David Garamond davegaramond@icqmail.com writes:

  • discourage use of symbol variables (e.g. $/, etc.) in manual
  • discourage use of Perlish features by giving warnings.

hm, i wonder what is the list of features that the author (matz?) decide
as perlish and should be discouraged.

  • symbol variables

  • regexp in conditional expression

  • range (…/…) in conditonal expression

     					matz.
    

Fair comment. I must admit to not being that conversant with Debian,
but I guess the main thing that I am driving at is that Ruby could
benefit from a lot of what the CPAN infrastructure has to offer, and the
model by which it has developed has been thru a classic ( and healthy )
Open Source Bazaar style development cycle.

I really want to see Ruby succeed, as it has an enormous amount to
offer, but not openly accepting and learning and embracing the good
things that can be learnt from other Languages, would be a terrible
mistake.

Cheers.

···

On Sat, Jan 25, 2003 at 07:30:07AM +0900, Massimiliano Mirra wrote:

Piers Harding piers@ompa.net writes:

I agree with you that ultimately distributions, and “certified
collections” of packages are probably an ultimate goal, but I would
suggest that one reason why this works for RedHat is that RedHat is a
commercial entity, and they (as an entity) have the man power/time and
the money to do it.

Debian is not a commercial entity and yet is the distribution with the
best package management (way better than Red Hat anyway).

Massimiliano

i think all branches in the naming tree should be ‘well accepted’ (perhaps
even voted on) leaving the author to name the leaves, eg:

Language::LISP::Blue
Language::LISP::Green
HTML::Template::Amrita

etc.

best of both worlds.

-a

···

On Sat, 25 Jan 2003, MikkelFJ wrote:

One could codename modules like “Green Lisp” to distinguish it from a
potential future “Blue Lisp”, yet I would instantly know it was a Lisp
module.

====================================

Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================

Thank you, guys.

···

----- Original Message -----
From: “Daniel P. Zepeda” daniel@zepeda-zone.net
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Wednesday, January 29, 2003 9:34 PM
Subject: Re: A simple program but strange output

On Thu, 30 Jan 2003 13:13:43 +0900 > “Maggie Xiao” mxiao@ee.ualberta.ca wrote:

Hi there,

I wrote a simple program to enumerate an array. The code is as below:
class Test
def initialize
@x=[0,1,2]
@tem=@x
@y=@x
y=del(@tem)
printf “#{@x}\n”
printf “#{@y}\n”
end
def del(x)
x.delete_at(0)
return x
end
end
a=Test.new

But the output is :
12
12
Why @x and @y are changed? Is there anyone can tell me how to deal with
this problem?

Because @tem is a reference (pointer) to the object, which is the array
[0,1,2], and so is @y. @x,@y and @tem are all pointing to the same Array
object, they are not different objects.
If you want different objects, you have to make a copy:

Here’s an example using irb:

irb(main):001:0> a = [0,1,2]
=> [0, 1, 2]
irb(main):002:0> a.id
=> 537808534
irb(main):003:0> b = a
=> [0, 1, 2]
irb(main):004:0> b.id
=> 537808534
irb(main):005:0> c = a.clone
=> [0, 1, 2]
irb(main):006:0> c.id
=> 538070796
irb(main):007:0>


Daniel P. Zepeda

Hi –

Daniel Carrera dcarrera@math.umd.edu writes:

I don’t know what Simon thinks, but I really do think that exactly. It
took me a while to find NArray. The only reason why I can find it in RAA
now is because I already know it exists.

Right. I believe there are decent Ruby modules for handling MIME mails;
of course, I can’t find them, because they’re not sensibly named.

Any package that doesn’t turn up on an RAA search for “mime” doesn’t
deserve to be found. Even if it’s called “marcel”, it should have
“mime” in its description.

But hey, that doesn’t matter! All that matters is that people deliver
an unindexable, undocumentable, inexplicable mass of code. Then we’ll
catch up with CPAN, right?

Parts of CPAN, anyway :slight_smile:

But honestly, no one is advocating the kind of disorder you’re
describing here. There are some different views and ideas on the
table, but I think we all agree that things should be documented,
indexed, searchable, etc.

David

···

On Thu, 23 Jan 2003, Simon Cozens wrote:


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

In article 87r8b41ruw.fsf@simoncozens-2.dsl.easynet.co.uk,
Simon Cozens simon@simon-cozens.org writes:

Programs should have attractive names; libraries should have functional
names.

Rouge is a program. Maybe Amrita is a better example?

···


Tanaka Akira

What happens when the RAA goes down??

I’ve always wanted to apply the principles of Napster/Kazaa-like
availability to code libraries/depots.

Concept::

  1. Everyone has a ‘server’ that they run on the computer that holds the
    source they want publicised.

  2. Each folder on the ‘serving’ computer would act as a new ‘namespace’…
    all folders under my RAA ‘login’…

  3. When I want some extra functionality, I open an interface on my computer
    to this distributed network, and search or browse until I find what I need.

Extraneous things like naming conventions will be ‘isolated’ within each
’distributed server’ run on each computer. Ruby won’t ‘look’ bad because of
naming problems… and those with ~issues~ of conformance would fall by the
wayside, since no one would want their code.

my code could be referenced …

http://www.ruby-lang.org/en/raa.rb?richardLyman.internet.html.linkValidator.
rb

Anyway… I normally get ignored, but I thought I’d put it out… :wink:

-Rich