Forum: Ruby Ruby for Philosophers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7baffd18ad101af48470513b2e065b51?d=identicon&s=25 Sebastian Torena (book-fu)
on 2008-11-02 04:11
Hi there,
Maybe I'm helpless; don't know. I use and like to read a lot, to write a
lot, but, honestly, my favorite time goes by just thinking. So, I've
been thinking a lot during all my entire life, and specially the last,
maybe, six years, when most of this game of thinking started to become
itself focused around certain aspect of reality, mostly Philosophy of
Art, or Aesthetics.

One Philosopher's great ambition may be to create almost one new.concept
during his or her life, almost one concisely written idea, in whatever
language. At certain point, doesn't really matter what language. Anyway
almost everybody knows that Philosophy's History Most-Most Greatest Hits
were written in Greek, Latin or German. I still don't know well why but,
maybe, think, that could be related to some language's kind of
flexibility that favors the creation -to get together in a mind- of
major concepts.

So, what all this got to do with Ruby? Well, I've been thinking about to
learn a second language from scratch. It could be Ruby. And I say could
cause I can't find one document that shows me the foundation. If I not
wrong, in Ruby, everything belongs to one class or another. Then, the
class Class itself must inherit certain characteristics from something
else. Anyway, my question is what leads: ¿Where can I find a
documentation that lists and defines all the elements of the class
Class? ¿Is it possible to think about learning Ruby as to learn, for
example, chess? If that's true, which are the most basics rules for
playing Ruby?

I'm a philosopher, I got to think all the stuff by myself, so I'm not
very interested on what programmers are doing with the latest classes or
objects created by them. Just the basic rules; to comprehend and then
start thinking -or playing-.

Forgive my ignorance.

And thanks in advance.
3cb4fdcf13aad6a7dcae83876b0e784e?d=identicon&s=25 Josef 'Jupp' Schugt (Guest)
on 2008-11-02 12:25
(Received via mailing list)
Hi!

I changed the topic because "Ruby for Philosophers" is highly
misleading.
It suggests you want to present Ruby to Philosophers (say to do
automatic
theorem testing).

On Sun, 02 Nov 2008 04:10:29 +0100, Sebastian Torena
<citizenkant@gmail.com> wrote:

> If I not wrong, in Ruby, everything belongs to one class or another.
> Then, the class Class itself must inherit certain characteristics from
> something else.

The basic class in Ruby is "Object", not "Class". Every object in Ruby
is
an instance of "Object" but most objects are no instance of "Class".

For the class hierarchy see

     http://objectgraph.rubyforge.org/

For the what makes up the Object class see

    http://www.ruby-doc.org/core/classes/Object.html

> ¿Where can I find a documentation that lists and defines all the
> elements of the class Class?

Start at

     http://www.ruby-doc.org/core/classes/Class.html

BTW: El '¿' no es utilisado en el inglés...

> ¿Is it possible to think about learning Ruby as to learn, for example,
> chess?

That depends on you mental disposition.

> Forgive my ignorance.

There hardly is anything more unforgivable than ignorance as it is known
to be the most productive source of conflicts.

Josef 'Jupp' Schugt
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (Guest)
on 2008-11-02 13:05
(Received via mailing list)
On 02.11.2008 04:10, Sebastian Torena wrote:
> One Philosopher's great ambition may be to create almost one new.concept
> during his or her life, almost one concisely written idea, in whatever
> language. At certain point, doesn't really matter what language. Anyway
> almost everybody knows that Philosophy's History Most-Most Greatest Hits
> were written in Greek, Latin or German. I still don't know well why but,
> maybe, think, that could be related to some language's kind of
> flexibility that favors the creation -to get together in a mind- of
> major concepts.

I for myself think the reasons for your observation are historic rather
than linguistic.  The fact that we know these writings has to do with a
lot of lucky coincidences and the fact that Greek philosophy became
fashionable in different periods of European history.  Btw, I believe
you forgot to mention a few other languages, namely Hindi, Chinese and
probably others which were also used to write important philosophical
texts.

> So, what all this got to do with Ruby? Well, I've been thinking about to
> learn a second language from scratch. It could be Ruby.

You should be very clear about the fact that a programming language is
very different from a natural language.  I am not sure whether
programming languages are suited to write philosophical texts although
they can help in reasoning about and solving of a certain class of
problems (usually in the area of logic).

> And I say could
> cause I can't find one document that shows me the foundation.

The Pickaxe could be a good start, you can find it here
http://ruby-doc.org/docs/ProgrammingRuby/ although I'd recommend buying
the second edition.  There are also numerous tutorials e.g. "Learning to
Program" which you can find from http://ruby-doc.org/ .

> Is it possible to think about learning Ruby as to learn, for
> example, chess?

Do you want to think about learning Ruby or do you want to learn Ruby?

> If that's true, which are the most basics rules for
> playing Ruby?

I'd say they are the same for all procedural programming languages (on a
certain level at least): you have state and you have instructions that
operate on this state transforming it into another state (-> Turing
Machine).

> I'm a philosopher, I got to think all the stuff by myself, so I'm not
> very interested on what programmers are doing with the latest classes or
> objects created by them. Just the basic rules; to comprehend and then
> start thinking -or playing-.

I am not sure whether it is a good idea to ignore the purpose of a tool
when trying to understand how to use it.  Good luck!

Kind regards

  robert
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (Guest)
on 2008-11-02 13:10
(Received via mailing list)
On 02.11.2008 12:23, Josef 'Jupp' Schugt wrote:
> I changed the topic because "Ruby for Philosophers" is highly misleading.
> It suggests you want to present Ruby to Philosophers (say to do automatic
> theorem testing).

I believe OP wants something different:

> One Philosopher's great ambition may be to create almost one new.concept
> during his or her life, almost one concisely written idea, in whatever
> language. At certain point, doesn't really matter what language.

As far as I understand him he considers using Ruby to write a
philosophical treatise.

Viele Grüße ;-)

  robert
9b905791cbdbb1af35b65e02c3217e23?d=identicon&s=25 toomln (Guest)
on 2008-11-02 13:35
(Received via mailing list)
> As far as I understand him he considers using Ruby to write a
> philosophical treatise.

I personally would like to see Heidegger's "Sein und Zeit" rewritten
in prolog. This could be fun.
3cb4fdcf13aad6a7dcae83876b0e784e?d=identicon&s=25 Josef 'Jupp' Schugt (Guest)
on 2008-11-02 17:55
(Received via mailing list)
On Sun, 02 Nov 2008 13:33:43 +0100, toomln <micathom@gmail.com> wrote:

>> As far as I understand him he considers using Ruby to write a
>> philosophical treatise.
>
> I personally would like to see Heidegger's "Sein und Zeit" rewritten
> in prolog. This could be fun.

May I suggest writing "Critik(*) der reinen Vernunft" by Immanuel Kant
in
Lisp?

(*) No, that is no misspelling. In modern German it reads "Kritik" but
in
the original print it is written with initial "C".

Josef 'Jupp' Schugt
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2008-11-02 20:57
(Received via mailing list)
Josef 'Jupp' Schugt wrote:
>
> (*) No, that is no misspelling. In modern German it reads "Kritik" but
> in the original print it is written with initial "C".
>
> Josef 'Jupp' Schugt

Rudolph Carnap's "Der logische Aufbau der Welt" (logical reconstruction
of the world) could be ported to ruby, but it would suffer from the same
flaw as the original:

NoMethodError: undefined method `Rs' for ...

(Rs was the relation of similarity between sense experiences, etc.,
IIRC.)
9b4c04c050122bcea16a6f3376d680fa?d=identicon&s=25 Daniel Bush (danb)
on 2008-11-03 05:21
Sebastian Torena wrote:
...
> So, what all this got to do with Ruby? Well, I've been thinking about to
> learn a second language from scratch. It could be Ruby. And I say could
> cause I can't find one document that shows me the foundation. If I not
> wrong, in Ruby, everything belongs to one class or another. Then, the
> class Class itself must inherit certain characteristics from something
> else. Anyway, my question is what leads: ¿Where can I find a
> documentation that lists and defines all the elements of the class
> Class? ¿Is it possible to think about learning Ruby as to learn, for
> example, chess? If that's true, which are the most basics rules for
> playing Ruby?
...

I was going to suggest this link:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/...
as a good starting point (assuming they know ruby).
The 2nd paragraph definitely bears a closer reading.

I don't know how you'd write philosophy in Ruby, but the
ruby universe does seem kind of tidy and self-consistent (putting
to one side the dark internals) - I'm sure philosophers like
Spinoza, for instance, would have appreciated the structure
and maybe taken inspiration from it :)

From a pedagogical point of view, wouldn't it be helpful to
have a diagram showing how ruby is structured based on
Object#class and Class#superclass?
I don't mean listing all the in-built classes like File, IO.. etc
but just mapping out fundamentally how ruby is structured.
This would be trivial to people who do ruby metaprogramming
in their sleep, but it might help other people get their heads round
classes and object instances and modules etc.. ?

My understanding is:
All ruby objects have an associated class-like object (see below)
courtesy of Object#class.  This class gives them their method
definitions.
Class-like objects have their class set to Class itself.  This gives
ruby's class-like objects a hierarchy (ie classical inheritance) because
Class has the method 'superclass'. Object ends up being at the top of
this hierarchy.
Putting aside how all this is implemented internally, it seems
that Class sets up the idea of "class" and class hierarchy; which allows
Object to be given the ultimate superclass status in the ruby universe.
Seems like both Object and Class are intertwined a little; with Module
sitting between them (just looking at it philosophically from the
surface).

The diagram I was thinking of would have 3-4 sections with pointers
mapping 'class' relationships and 'superclass' relationships.
The sections would be something like:

1) Class
2) Class.new, Object, Module, class Foo;...;end, File, IO,  ...
---------------------------------------------------------------
3) Module.new, module Bar;...;end, Kernel, ...
4) Object.new, Class.new.new , Foo.new, ...

Sections 1 and 2 are the class-like objects whose 'class' is Class
(including Class itself) and so have the idea of a superclass hierarchy;
.
Class itself interestingly is at the bottom of the class hierarchy,
followed
by Module and then Object at the top.  Classes created by us eg Foo have
their superclass set by default to Object unless you specify
that they inherit from some other class.

The diagram bascially splits the ruby universe into two groups:
class-like objects (1 and 2) which have a class hierarchy and non
class-like objects (3 and 4).
3) is sort of an in-between, halfway house.  These objects (ruby
modules) resemble classes in 2) but can't be instantiated and don't have
class Class
and as a result no superclass.

Any thoughts?

--
Daniel Bush
42179cc17425b7305cc32b76cbb623a2?d=identicon&s=25 Anton Ivanov (_ai_)
on 2008-11-03 07:31
Joel VanderWerf wrote:
> Josef 'Jupp' Schugt wrote:
>>
>> (*) No, that is no misspelling. In modern German it reads "Kritik" but
>> in the original print it is written with initial "C".
>>
>> Josef 'Jupp' Schugt
>
> Rudolph Carnap's "Der logische Aufbau der Welt" (logical reconstruction
> of the world) could be ported to ruby, but it would suffer from the same
> flaw as the original:
>
> NoMethodError: undefined method `Rs' for ...
>
> (Rs was the relation of similarity between sense experiences, etc.,
> IIRC.)

Why, I am in fact slowly working on implementing in Ruby Montague's
system which relies heavily on Carnap's.  I'll keep ya posted :)
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2008-11-03 14:41
Sebastian Torena wrote:
> If that's true, which are the most basics rules for
> playing Ruby?

If you are thinking of it as a game, and are prepared to persevere
through the noise, then maybe this is for you:
http://poignantguide.net/ruby/
Ab870531383eea6e4d9110317f5401e7?d=identicon&s=25 Caleb Clausen (Guest)
on 2008-11-03 15:50
(Received via mailing list)
Just some of my thoughts here, not necessarily interesting or even
original.

On 11/1/08, Sebastian Torena <citizenkant@gmail.com> wrote:
> almost everybody knows that Philosophy's History Most-Most Greatest Hits
> were written in Greek, Latin or German. I still don't know well why but,
> maybe, think, that could be related to some language's kind of
> flexibility that favors the creation -to get together in a mind- of
> major concepts.

As Robert pointed out, it may be very difficult to write an expository
text in ruby. Programming languages and natural languages aren't used
for (quite) the same thing. Most statements in ruby are imperative,
whereas in natural languages, mostly declarative statements are used.
So does this mean that you should be trying to learn prolog or SQL
instead? I don't know the answer to that.

> So, what all this got to do with Ruby? Well, I've been thinking about to
> learn a second language from scratch. It could be Ruby. And I say could
> cause I can't find one document that shows me the foundation. If I not
> wrong, in Ruby, everything belongs to one class or another. Then, the
> class Class itself must inherit certain characteristics from something

The interesting thing about Class is that it is an instance of itself.
Object and Module are the only other cases of this, as far as I know.

There's definitely a link between category theory (is that the right
name?) in philosophy and the design of object systems in computer
science. You should check out Francis Hwang's talk at last year's
rubyconf. It's on video:
http://rubyconf2007.confreaks.com/d2t1p7_conversat...

> I'm a philosopher, I got to think all the stuff by myself, so I'm not
> very interested on what programmers are doing with the latest classes or
> objects created by them. Just the basic rules; to comprehend and then
> start thinking -or playing-.

The best tool for learning and playing with ruby is irb.... it's the
ruby program that overall has given me the most joy. If you're going
to learn by playing in irb, I recommend learning about some of ruby's
introspection features... things like Class#instance_methods.

The pickaxe has a writeup on irb:
http://www.rubycentral.com/pickaxe/trouble.html
#scroll down to the second section.

and introspection:
http://www.rubycentral.com/pickaxe/ospace.html
C1b6b5557723c9db912b075e954166d3?d=identicon&s=25 Jeff Moore (djief)
on 2008-11-03 16:48
Sebastian Torena wrote:

>
> Forgive my ignorance.
>
> And thanks in advance.

Perhaps a more general description of the concepts that form the
foundation of Ruby and other Object Oriented languages would help you
decide.

http://en.wikipedia.org/wiki/Object_orientation

IMHO, the ease that Ruby offers in creating Domain Specific Language
should be
very useful in exploring new concepts and their relationships.

It would depend, of course, on whether the concepts you are working with
can be
modeled in this context but that's the challenge, after all.
7baffd18ad101af48470513b2e065b51?d=identicon&s=25 Sebastian Torena (book-fu)
on 2008-11-04 13:44
Well,
Thank´s a lot for all your replies!
Now I have a good starting point to figure out if it´s possible or not.

Thanks again.
8a7a74182e801b31248d51cf8d94f2d5?d=identicon&s=25 rick_2047 (Guest)
on 2008-11-04 16:46
(Received via mailing list)
I would consider myself the last one who can give a tip but maan is
this discussion good. I mean this stuff can create history in the
world, not to mention give enough food to Sci-Fi writers
This topic is locked and can not be replied to.