[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby for Philosophers

Sebastian Torena

11/2/2008 3:10:00 AM

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.
--
Posted via http://www.ruby-....

13 Answers

Josef 'Jupp' Schugt

11/2/2008 11:23:00 AM

0

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.ruby...

For the what makes up the Object class see

http://www.ruby-doc.org/core/classes/O...

> ¿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/...

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
--
Blog: http://penpen.gooda...
PGP key (id 6CC6574F): http://wwwkeys.d...
Jabber - http://www.j... - contact information on request

Robert Klemme

11/2/2008 12:04:00 PM

0

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://rub...docs/Progra... although I'd recommend buying
the second edition. There are also numerous tutorials e.g. "Learning to
Program" which you can find from http://rub... .

> 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

Robert Klemme

11/2/2008 12:07:00 PM

0

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

ThoML

11/2/2008 12:34:00 PM

0

> 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.

Josef 'Jupp' Schugt

11/2/2008 4:54:00 PM

0

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
--
Blog: http://penpen.gooda...
PGP key (id 6CC6574F): http://wwwkeys.d...
Jabber - http://www.j... - contact information on request

Joel VanderWerf

11/2/2008 7:56:00 PM

0

Josef 'Jupp' Schugt wrote:
> 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

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.)

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Daniel Bush

11/3/2008 4:20:00 AM

0

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/cl...
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;

Anton Ivanov

11/3/2008 6:30:00 AM

0

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 :)
--
Posted via http://www.ruby-....

Brian Candler

11/3/2008 1:40:00 PM

0

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...
--
Posted via http://www.ruby-....

Caleb Clausen

11/3/2008 2:46:00 PM

0

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_conversations_vs...

> 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/tr...
#scroll down to the second section.

and introspection:
http://www.rubycentral.com/pickaxe/o...