That is the only reason I translated DataVision from Ruby to Java. The code
feels bloated now, but at least the GUI runs everywhere without end users
having to install a GUI library.
now that’s interesting.
would you consider porting back if we could give you a good GUI
solution?
I’m not sure. DataVision has a large user base now and I can’t abandon
them. I will have to continue Java development even if I port it back to
Ruby.
I would also have to think about what would make a “good GUI solution”. I
started by tring Tk, FOX, and Gtk. Each one didn’t do something I wanted.
Don’t ask what; it’s been about a year since I switched.
Dave, may I say that playing is a very pragmatic thing to do?
I believe that one of the reasons humans are programmed to play is so
that that we can gain experience in a safe environment, and then learn
from that experience.
Thanks for sharing your thoughts. Is it really true that Ruby is in many
ways a functional language? I know that Ruby was influenced to a certain
degree by Lisp, but can you elaborate on this further? If Ruby indeed has
some functional language nature, I will nominate Ruby as “the ultimate
functional language” :), just like one C course instructor called C as the
“ultimate assembly language”.
The functional language purists would probably shoot me for
saying this but while Ruby is not strictly a functional
language, many of the idioms of functional language can
be mapped quite easily to Ruby.
For example: One of the classical papers on Functional
Programming is
Let’s take his first example. He shows how you can
generalize a sum of list elements function to perform
pretty much any reduction on a list.
He defines reduce as
(reduce f x ) nil = x
(reduce f x ) (cons a l ) = f a ((reduce f x ) l )
The Enumerable module allows you to do very similar
things to any object that supports “collect”.
def reduce ( proc, value )
result = value
self.collect { |obj| proc.call(obj,result) }
return result
end
While strictly speaking this is not functional programming,
to me it “feels” like functional programming and the idea
is certainly the same. i.e. rather than writing a specialized
“sum” function for every list type, you write a function
that knows how to traverse a list and one that knows how
to “sum” two things together. Thus when you have a new
data type or a new sum you only need to write a new
function for “summing” two things together, you don’t need
to rewrite the code for traversing a list.
Whenever I see something like
phrase = “Now here’s a sentence”
phrase.split(" “).reverse.join.(” ")
I think “functional programming”. Perhaps, I just don’t
fully understand functional programming, but to me there’s
nothing particularly OO about the above code.
The paper quoted talks about two key features of functional
programming, Higher order functions and lazy evaluation.
I can think of lot’s of examples of the first in Ruby, but
nothing for the second. I guess you could adapt the coroutine
stuff to implement lazy evaluation, in fact that’s the only
real use I can think of for coroutines.
Some people say the essence of functional programming is having no side
effects, some think it is having higher-order functions.
Ruby has side effects, but *ML has too and it’s generally thought of as
functional. But Ruby does also allow higher-order functions, even though
functions aren’t first-class, via proc. Code blocks are sure cool!
Ummm, what would a non-side-effects Ruby look like? It would probably be
some kind of Lisp with a real syntax
As for lazy evaluation and dynamic (or static) typing, they don’t seem
to be defining criteria for what being functional is.
Anyway Lisp, often cited as THE functional language, is typeless and
thus closer to Ruby than statically typed languages. Another argument to
sustain our claim of Ruby being a great functional OO language!
···
On Sat, Aug 24, 2002 at 12:58:45AM +0900, William Djaja Tjokroaminata wrote:
Hi,
Thanks for sharing your thoughts. Is it really true that Ruby is in many
ways a functional language? I know that Ruby was influenced to a certain
degree by Lisp, but can you elaborate on this further? If Ruby indeed has
some functional language nature, I will nominate Ruby as “the ultimate
functional language” :), just like one C course instructor called C as the
“ultimate assembly language”.
Thanks for sharing your thoughts. Is it really true that Ruby is in many
ways a functional language? I know that Ruby was influenced to a certain
degree by Lisp, but can you elaborate on this further?
The blocks are what makes Ruby so functional. I would argue those
blocks are what are called closures. But my Ruby is not good enough to
tellt that exactly.
If Ruby indeed has
some functional language nature, I will nominate Ruby as “the ultimate
functional language” :), just like one C course instructor called C as the
“ultimate assembly language”.
I am almost at the point of deciding to learn a functional language. The
only problem is still the question, why Haskell? Why not Scheme, ML, or
Lisp, which have discussion groups?
Haskell is discussed in diverse Mailing Lists see haskell.org and in
comp.lang.functional. Well Haskell is a good idea because it’s sort of
“pure”. ML would fit the same description. Common Lips and Scheme are
“more practical” the don’t bann things for imperative programming, and
Common Lisp supports any kind of programmg style one can imagine. And
if it does not do the things you want it do do you extend Lisp to fit
your needs. I don’t think it’s a good idea to post Lisp code here,
therefor I invit you to check out http://www.bagley.org/~doug/shootout/
Not for the speed comparisoin but for the way things look may
look. Unfortunatly most of the programs have to be written to resemble
imperative programming style. That the real shortcoming.
no, actually i’m just curious about what the main features of using
Swing (you are using Swing?) or whatever GUI API you’re using with Java
that DataVision requires? i want to be sure GUtopIa is powerful enough
that it COULD at least do the job.
thanks,
transami
···
On Thu, 2002-08-22 at 13:56, Jim Menard wrote:
I would also have to think about what would make a “good GUI solution”. I
started by tring Tk, FOX, and Gtk. Each one didn’t do something I wanted.
Don’t ask what; it’s been about a year since I switched.
(reasonable, there was a macro assembler created for the 6800 that
included
most of the features of C).
Another Urban Legend strikes!
C is older than the 6800, by rather a lot. (C predates
microprocessors in general, IIRC, unless you consider the original
intel 4004 a microprocessor)
Hmm. He didn’t say that C was derived from it, only
that it had most of C’s functionality. In fact, I
think he could be saying that the macro assembler
mimicked C.
C’s generally considered a PDP-11 assembly, but K&R have denied that.
I still feel that there were influences there. I’ve used
PDP-11 assembly, and actually liked it. Do they
totally deny any influences?
--------------------------------------“it’s like this”-------------------
Dan Sugalski even samurai dan@sidhe.org have teddy bears and even
teddy bears get drunk
I’ve always wondered what this tag means and/or where it
originates. Care to elaborate? On- or offline.
Cheers,
Hal
···
----- Original Message -----
From: “Dan Sugalski” dan@sidhe.org
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, September 02, 2002 12:26 PM
Subject: Re: A Repeat: New Language After Ruby?
That may be so, but it’s still true that somebody built a macro assembler for
the M6800 (or 68000?) that implemented at least a large subset of C. There’s
no contradiction here.
···
On Monday 02 September 2002 10:26, you wrote:
At 2:20 AM +0900 9/3/02, Charles Hixson wrote:
(reasonable, there was a macro assembler created for the 6800 that
included most of the features of C).
Another Urban Legend strikes!
C is older than the 6800, by rather a lot. (C predates
microprocessors in general, IIRC, unless you consider the original
intel 4004 a microprocessor)
C’s generally considered a PDP-11 assembly, but K&R have denied that.
I dispute that Lisp is THE functional language. Mind you, I don’t know much
about Lisp or functional languages, but it seems to me that Lisp merely encourages functional programming.
Gavin
···
----- Original Message -----
From: “Mauricio Fernández” batsman.geo@yahoo.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, August 24, 2002 10:17 AM
Subject: Re: A Repeat: New Language After Ruby?
Anyway Lisp, often cited as THE functional language, is typeless and
thus closer to Ruby than statically typed languages. Another argument to
sustain our claim of Ruby being a great functional OO language!
(reasonable, there was a macro assembler created for the 6800 that
included
most of the features of C).
Another Urban Legend strikes!
C is older than the 6800, by rather a lot. (C predates
microprocessors in general, IIRC, unless you consider the original
intel 4004 a microprocessor)
Hmm. He didn’t say that C was derived from it, only
that it had most of C’s functionality. In fact, I
think he could be saying that the macro assembler
mimicked C.
D’oh! I misread that. I’ve seen so many “C is really X assembly
language” comments through the years I’ve gotten too quick on the
draw. Sorry, Chris.
C’s generally considered a PDP-11 assembly, but K&R have denied that.
I still feel that there were influences there. I’ve used
PDP-11 assembly, and actually liked it. Do they
totally deny any influences?
Depends on when you ask, I think.
--------------------------------------“it’s like this”-------------------
Dan Sugalski even samurai dan@sidhe.org have teddy bears and even
teddy bears get drunk
I’ve always wondered what this tag means and/or where it
originates. Care to elaborate? On- or offline.
That? Found it, as a quatrain, in an old BSD fortune file, and I
abused it into haiku form, more or less. (Yeah, I know it doesn’t
completely conform–feel free to insert appropriate “ignorant gaijin”
comments here I presume it came originally from the fevered and
caffeine addled brain of a CS undergrad somewhere.
···
At 2:46 AM +0900 9/3/02, Hal E. Fulton wrote:
----- Original Message -----
At 2:20 AM +0900 9/3/02, Charles Hixson wrote:
–
Dan
--------------------------------------“it’s like this”-------------------
Dan Sugalski even samurai dan@sidhe.org have teddy bears and even
teddy bears get drunk
It’s a 5-7-5 haiku. I wonder if Dan originated it, but the
meme’s kinda old now. At one point there was a Shockwave
Flash animation of a samurai teddy bear that watched over
someone sleeping and battled things while the sleeper
slept … but no amount of googling would reveal a URL for
it and I can’t find a factoid that points to it …
--------------------------------------“it’s like this”-------------------
Dan Sugalski even samurai dan@sidhe.org have teddy bears and even
teddy bears get drunk
I’ve always wondered what this tag means and/or where it
originates. Care to elaborate? On- or offline.
–
Dossy Shiobara mail: dossy@panoptic.com
Panoptic Computer Network web: http://www.panoptic.com/
“He realized the fastest way to change is to laugh at your own
folly – then you can let go and quickly move on.” (p. 70)
From: “Mauricio Fernández” batsman.geo@yahoo.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, August 24, 2002 10:17 AM
Subject: Re: A Repeat: New Language After Ruby?
Anyway Lisp, often cited as THE functional language, is typeless and
thus closer to Ruby than statically typed languages. Another argument to
sustain our claim of Ruby being a great functional OO language!
I dispute that Lisp is THE functional language. Mind you, I don’t know much
about Lisp or functional languages, but it seems to me that Lisp merely encourages functional programming.
Well that is not exactly true. Lisp can be used in a functional way,
but you do not have to. And jut for the record Lisp is not
typeless au contraire every object has it’s special type. But like in
ruby you don’t write down the types explicitly (well you do e.g in
defmethod) but that would be off-topic here.
It’s not mine, though I abused it into the haiku–I got it originally
from a BSD fortune file, IIRC. The earliest Usenet reference I can
find to it is January 15, 1985, but I’m pretty sure I had it before
that.
It’s not, so far as I can tell, attributed to anyone, which is a
shame, as I rather like the thing.
--------------------------------------“it’s like this”-------------------
Dan Sugalski even samurai dan@sidhe.org have teddy bears and even
teddy bears get drunk
I’ve always wondered what this tag means and/or where it
originates. Care to elaborate? On- or offline.
It’s a 5-7-5 haiku. I wonder if Dan originated it, but the
meme’s kinda old now. At one point there was a Shockwave
Flash animation of a samurai teddy bear that watched over
someone sleeping and battled things while the sleeper
slept … but no amount of googling would reveal a URL for
it and I can’t find a factoid that points to it …
–
Dan
--------------------------------------“it’s like this”-------------------
Dan Sugalski even samurai dan@sidhe.org have teddy bears and even
teddy bears get drunk