(Smalltalk > you) ifTrue: [self postTo: LiveJournal].

Jan 12, 2007 00:53

Been fiddling about with Dolphin Smalltalk. I'm really liking this language. I first figured objects out in Java, and they seemed like a great idea, but certain things just seemed more complex than they needed to be. Smalltalk has no such cruft. Most especially, writing a small class does not necessitate writing a header which is larger than the ( Read more... )

Leave a comment

Comments 14

plogon January 12 2007, 11:22:01 UTC
it would be even more fun if you could extend your language with a keyword "singleton". and when you add it to a class definition, the language does all the work for you (mirror methods, disable new,..)

i bet that it is possible in lisp ( with macros or something?)

Reply

dour January 12 2007, 18:39:12 UTC
While it's probably a bad idea-from what I've seen, you're generally not supposed to expose the instance methods through the class in a singleton for a couple of reasons-it's thoroughly possible ( ... )

Reply

plogon January 14 2007, 20:41:16 UTC
are you making a game too?

Reply

dour January 15 2007, 01:36:39 UTC
By fits and starts, yes.

Reply


tilton January 12 2007, 17:16:37 UTC
Yay Smalltalk! I used to do a bit of it back in the day, but it's been a long, long time.

If You Like Smalltalk, You Might Also Like(tm): Ruby. It rifled through Smalltalk's pockets and made off with its block closures, then broke into LISP's house and took some other bits. I'm finding it to be really fun to do things like

# Print "hello, world!" five times
    5.times.do { puts "Hello, world!" }

and

# Reverse each name in the list
    names.map { |n| n.reverse }

where the things in {}'s are block closures being passed to the 'do' method and the 'each' method, respectively. These are just small built-in toy examples.

And Ruby objects are infinitely extensible at runtime. You can open them, poke them, prod them, define new methods, rename old methods, intercept messages and do highly inappropriate things. It's wonderful.

Of course it loses out by not having the integrated workspace system that Smalltalk has, but it does have a reasonable interactive shell called irb that lets you spit arbitrary Ruby into your ( ... )

Reply

dour January 12 2007, 18:01:04 UTC
You're not the only person who's suggested that I check out Ruby. Thing is, Ruby is an interpreted language; Smalltalk runs on a JIT VM, and these days you can package the whole deal in an executable, not to mention that all the Windows APIs have been packaged for Smalltalk. (Including DirectX. Vista's nearly done, even.) Also, Ruby cleaves to C/Java-ish syntax (curly braces, dots for message designation, etc.) which I'm really getting happy about not having to deal with! :D

All of your examples are identically short in Smalltalk, too. :)

Reply

tilton January 12 2007, 18:20:32 UTC
Oh, I'm not implying it's better than smalltalk. I'm just saying it's useful to have in your toolkit :) They're both very fun languages!

Reply

dour January 12 2007, 18:41:50 UTC
I'm not implying it's worse, just explaining why I picked the one I picked. ;)

Reply


zaimoni January 13 2007, 03:15:17 UTC
Not to mention Smalltalk is what spawned Extreme Programming.

Reply


Leave a comment

Up