From: Enric Lafont Date: 2002-11-04T05:54:40+09:00 Subject: Re: Thoughts on Ruby Albert Wagner wrote: >Smalltalk is pure OOP. Ruby is not. In Smalltalk the "operators" are simply >messages to an object. In Ruby "operators" are neither objects nor messages, >but are rather handled as in more conventional languages. I don't know why >Matz only went part way. This part-way-ness is also visible in other >aspects of the language such as "if", "while", etc. In Ruby these things >also are neither object nor message. Whereas in Smalltalk, such constructs >are messages to a Boolean object. > > Yes, this is one think I don't understand of the design on Ruby, it makes Ruby more C-alike, but looses the expresiveness of Smalltalk, when in fact Ruby is almost as OO pure as Smalltalk is. >Again, what can I say? Ruby is not Smalltalk. Large amounts of functionality >that in Smalltalk were written in Smalltalk, were in Ruby written in C. > > Smalltalk is writed in C also, take a look at the bytecode engine, just better, look at Squeak, the C code is generated by the compiler itself >I agree with you for the same reasons you give. I am a hater of syntax sugar. > > I don't hate sintax sugar, I just see Sintax sugar as a poor replacement for the real thing, every call is a method. When in fact the only thing you loose is the multi asignament capabilities, but I'm sure that I can think in a way to do it. >This is a difference that I have grown to like. Running back to the top of a >method every I need a variable name was tedious. > > OK, I don't like to go to the top of the routine just to put a forgotten variable, but in C and in other languages, you can declare a variable in the middle of the code (where it belongs, near the place you are going to use it). I'm just asking for a compiler warning telling me that some variable is undefined, this will really help me . >>Why are Strings arrays of integers ? aString[0] is an integer, yes, it's >>the way it is, but I would like to have String as an array of chars, and >>char if you want as a descendant of Integer (nice election because a >>Unicode String is and array of double chars i.e. integer), I don't know >>you, but for me aString[i].chr =='x' is somewhat unnatural, because it >>breaks the semantic of a String, so it's not intuitive for me. >> >> > >It is not intuitive to many people. There have been long discussions on the >pros and cons. > > The problem is that Ruby has no Char class, and maybe it's not needed, but a Char class helps. For example ?# is an integer '#' is a String When in fact is neither, it is a Char. This is the problem mixed semantics. >>Why is Ruby an interpreter ? >> >> > >All the things you mention are under consideration or under development. > Thanks God !!! :-) (just kidding....) > > > >>Don't get me wrong, I understand that Ruby is a young language that >>needs some maturing, and I love how easy is to learn, it's dinamicity >>and the fact that is a kind of mix between my loved Smalltalk, Self and >>other languages. In fact I'm writing this because I want to understand >>Ruby better and becasue I want to make some suggestions for future >>releases, maybe Mr. Matsumoto would like to consider some of them >> >> > >Most of the features I loved about Smalltalk are in Ruby. But what I do not >miss from Smalltalk is fact that it is image based. Ruby is not, and I think >that is a good thing. > Yes the Smalltalk environmet is a heavy rock to carry with it, there are solutions to this problem, but I also prefer the file-oriented programing paradign of Ruby >I think you will find that this is a very friendly list. Welcome. > > Thank you. Enric