Live data from Hacker News

Design Principles Behind Smalltalk (1981)

cs.virginia.edu

1–10 of 33 posts

Re: Design Principles Behind Smalltalk (1981)

#3
post #2

> Natural Selection: Languages and systems that are of sound design will persist, to be supplanted only by better ones. I loved coding in Smalltalk years ago. Guess “better” turned out to be rather subjective...

It's not about subjectivity. It's about exposure. A lot of people weren't exposed to a language long enough to know what is actually better.

I bet if everyone were exposed equal parts to smalltalk, javascript, haskell, lisp and python you will see an entirely different paradigm.

Re: Design Principles Behind Smalltalk (1981)

#4
post #2

> Natural Selection: Languages and systems that are of sound design will persist, to be supplanted only by better ones. I loved coding in Smalltalk years ago. Guess “better” turned out to be rather subjective...

No, it's just that this principle isn't true. There are a lot of factors that influence which languages and systems persist. Being of sound design is a factor, but not the biggest one.

Take Javascript, for example. It's the top language on Github. Its not there because its everyone's favorite language, or because it's an ideal language for writing reliable software. Its there because its baked into web browsers. We're now starting to get full-featured reliable compilers into JS with sourcemaps and whatnot, plus things like webassembly. So it's becoming quite reasonable these days to write code for the web in a language that isn't JS and not feel like a second-tier citizen. But that hasn't always been the case, so people wrote a lot of JS out of necessity. And that's why it's at the top.

(I don't mean to riff on JS in this post. There are plenty of other opportunities for that. The language has improved over the years, and this is surely part of the reason it's remained at #1, and part of the reason why browser vendors didn't throw up their hands and try a different language instead. But the main reason its at the top is because it's the language of the web.)

If SmallTalk were built into browsers instead of JS, then we'd all be writing SmallTalk. And it'd be blazing fast. And that has nothing to do with how sound its design is.

Re: Design Principles Behind Smalltalk (1981)

#5
post #2

> Natural Selection: Languages and systems that are of sound design will persist, to be supplanted only by better ones. I loved coding in Smalltalk years ago. Guess “better” turned out to be rather subjective...

The issue with applying an evolutionary metaphor to programming languages is that Natural Selection will thins a population by culling based on some environmental event, which means that what one might rationally consider to be "fittest" is not what will be selected.

So, the language may be well-strucuted, concise, extensible, etc. but natural selection may depend, for example, on availability for mobile platforms. In which case, languages that flourish on mobile platforms (e.g. browser-resident JavaScript) will survive that measure of "fitness".

The same is true in biology. What may seem well-formed, robust, and inevitable is meaningless to the process of natural selection. Nature randomly and arbitrarily chooses what those species that are fittest.

People too often mistake "survival of the fittest" to mean "survival of the most beautiful" or "survival of the most logical" because they consider existing species as fit by applying post hoc ergo propter hoc logic.

Re: Design Principles Behind Smalltalk (1981)

#6
post #2

> Natural Selection: Languages and systems that are of sound design will persist, to be supplanted only by better ones. I loved coding in Smalltalk years ago. Guess “better” turned out to be rather subjective...

No, it's just that this principle isn't true. There are a lot of factors that influence which languages and systems persist. Being of sound design is a factor, but not the biggest one. Take Javascript, for example. It's the top language on Github. Its not there because its everyone's favorite language, or because it's an ideal language for writing reliable software. Its there because its baked into web browsers. We'r…

Or if PHP were built into browsers, we'd all be using PHP.

Re: Design Principles Behind Smalltalk (1981)

#7
post #2

> Natural Selection: Languages and systems that are of sound design will persist, to be supplanted only by better ones. I loved coding in Smalltalk years ago. Guess “better” turned out to be rather subjective...

No, it's just that this principle isn't true. There are a lot of factors that influence which languages and systems persist. Being of sound design is a factor, but not the biggest one. Take Javascript, for example. It's the top language on Github. Its not there because its everyone's favorite language, or because it's an ideal language for writing reliable software. Its there because its baked into web browsers. We'r…

One turning point that saddens me as an ex-Smalltalker - at one point there were negotiations underway to have Smalltalk installed by default on all new Sun Workstations (this was back when Sun was a very significant player), but it fell through for financial reasons. Had this been the case, I'm sure Smalltalk would be significantly better known and more commonly used.

And as justinpombrio says above, that has nothing to do with how good or bad the language is.

Re: Design Principles Behind Smalltalk (1981)

#8

Earlier quoted context omitted.

No, it's just that this principle isn't true. There are a lot of factors that influence which languages and systems persist. Being of sound design is a factor, but not the biggest one. Take Javascript, for example. It's the top language on Github. Its not there because its everyone's favorite language, or because it's an ideal language for writing reliable software. Its there because its baked into web browsers. We'r…

Or if PHP were built into browsers, we'd all be using PHP.

And the world would be slightly dumber, and even more willing to accept shoddy design.

Shudder

(Yes, modern PHP is okay, but there are still a thousand and one bits of legacy baggage from a darker time that yet remain to be fixed - things like sane process control (PHP can't reliably access subprocess return values!), standard I/O support (can't read from stdin one char at a time, so sane CLI tools are broken), DB sanity (the SQLite3 extension will run all queries twice unless you code around bugs that have been known about for 10 years), etc), socket I/O (you physically cannot write rock-solid sockets code; the builtin streams functionality _and_ the socket extension do not provide enough surface area to handle all plausible error conditions, and it's entirely possible your script will hard-crash in certain obscure scenarios because the runtime doesn't give you the ability to trap all errors), and because of these longstanding issues PHP _does still have_ a sad culture of "it's okay, we'll just do this crazy horrible workaround", and nobody's fixing it.

I wanted to give a practical example, but unfortunately I can't find it. I was debugging some incredibly confusing socket behavior one day, and found where a major library/framework had hit exactly the same problem, and what they did - it was a remarkably well-engineered solution - was to setup a custom error handler, preg_match() the PHP error string (!) inside the error handler, then use some magic "if this is set to this and that var equals that value" derived from reading the PHP source code to detect a socket error condition. This code is still in place since PHP 7 hasn't fixed any of this, I just can't remember the library name or where to look for the code unfortunately.

Post reply on HN