Hacker News new | past | comments | ask | show | jobs | submit login

Smalltalk was able to do #1 in the 70s without static types.



And also #3.1: you program within the environment you are programming.


I'm not familiar enough with Smalltalk to comment, but I'm guessing that it had a formal, discoverable system of hooking events to event handlers. Was that the case ?


There is no "formal" system for events, but there are patterns and most Smalltalk systems follow. For example, Pharo makes use of an object called `Announcer`, which you then subclass to make your own announcements. It works similarly to a pub/sub pattern, but using pure live objects and by sending specific messages to subscribers.

Previously, systems like Squeak used a pattern where objects had a collection of "dependents" that would be updated when sent the `changed` message. I think this is still how input events -- keys, mouse, etc -- work in Morphic.

In either case, the "handler" is whatever you want it to be, so long as the target object implements the appropriate message.

As for discoverable, I'd say most things in a Smalltalk are easily discoverable, though some of the patterns can get convoluted if you're inheriting an ancient object structure.


Thanks, very interesting. I think a lot of the confusion here is over my terminology and a general lack of understanding about what the Delphi IDE is actually doing.

By "discoverable", I mean can the IDE:

1) Compile/analyze the code in the component library/run-time,

2) Figure out which type of method can be used for a certain type of event property for a given class, and

3) Display all matching methods in the current unit/module for the user to select.

This is what Delphi does (and Visual Studio with WinForms), and all of it is done at design-time, meaning that your application is not getting compiled in order to determine any of this.

From what you're describing, I don't think Smalltalk is doing the same thing. However, it could be doing something similar if it enforces (at design-time) this part:

"so long as the target object implements the appropriate message"


You should play around with Pharo if you have some free time. It's a completely different way of doing things (and a lot of fun). Indeed, what you've described of Delphi is not happening in a Smalltalk: there's no difference between the thing you are programming inside of and the end product (at least not right away).

It's easier to think of a Smalltalk image as a live system that you are configuring (using Smalltalk itself) for some end-user or goal. Because a Smalltalk image is simply a snapshot of the state of the whole system, you can use a development image to generate a more bare-bones, customer image/application if you so choose. In other words, you can configure a Smalltalk image however you want for a client. This would be the equivalent of the kind of "compiling" that creates a usable end product. You are manipulating a live system and configuring it for some purpose rather than describing a system in text files, compiling it, and then giving it to people to use.

On a technical level, you are compiling all of the time when working in a Smalltalk. Every time you save, the changes recompile and execute, live, as instantly as these things can.

Of course this means that Smalltalk is highly self-aware, and therefore there can be / are some of the IDE features you've listed. One of my favorites is the ability to provide example inputs and example outputs and see recommended objects/messages and implement the method for doing it. It probably exists in other Java IDEs or something, but I've never seen it elsewhere myself.


Thanks again for the detailed reply.

I will definitely try Pharo and see how it all works. I've read a bit here and there about Smalltalk over the years, and the whole environment seems really cool. I'm especially interested in the whole "not requiring static types", because that may give some ideas on how to do a JS IDE without losing the functionality that we wish to maintain. The "liveness" of the Smalltalk environment is also very much in line with how JS/HTML are used, so there may be a natural fit there.


I just read scroot's comment (the grandparent comment to mine, and parent to yours). I found it somewhat uncannily similar to a sub-thread involving HN user mikelevins (a long-time Lisp developer) in another HN thread a while ago (about Lisp). He commented on something (it was a thread about a Show HN about Full Stack Lisp, a book), I asked a question, he replied in more depth. His description of some advanced features of Lisp was fairly similar to what scroot wrote above (but with more points added). So you might be interested to check it out:

https://news.ycombinator.com/item?id=11834887

That is the top comment by him in that sub-thread. My question to him is 2nd reply below, then he replied at even greater length. Some pretty deep stuff..

(In another of his comments - this one, in a different thread: https://news.ycombinator.com/item?id=14677396 - he also mentioned that Lisp and Smalltalk are two of only a few languages that share some of the features he talks about.)


I also should mention that I only started getting into the Smalltalk stuff a year ago, and am by no means an expert. But reading about it and using it (Pharo mostly) really changed the way I think not only about programming, but computing more generally. If you ever watch a Kay lecture you won't really get what he's saying until you've used one of these live environments, whether it's Smalltalk or an interactive Lisp.

I recommend getting the Adele Goldberg "Smalltalk: The Language and its Implementation" (colloquially known as the "Blue Book"). I find it to be the second best programming book ever, aside from The Little Schemer.


Thanks, will try to check out that book at some point, and Pharo too.


Thanks, I'll check those out. For a sub-thread that involved my original post getting down-voted, this is turning out to be very informative. ;-)


Ha, good one, and welcome.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: