"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Monday, December 27, 2004

Even More on Reliability and Static Types

I answer some recent comments on static type annotations and reliability...

"Great programmers produce great programs."
I agree this is the number one factor. But they're better off using better tools.
"Surely you mean static type annotations"
Yes. As for languages like Haskell and ML that infer types, I only have experience writing a few very small programs. I think this approach has potential, but would like to see evidence of large, evolving, dynamic systems built this way.
"It seemed smug in its assumptions, assumptions which I don't think are certain in any way."
Fair enough, I can be fairly smug. 8^)

I agree with you in terms of absolute certainty. All we have are stories, but I think they are worth telling if for no other reason than to root out contrary stories (which I have not see).

"This post seems much better"
Thanks for getting me to write it.
"Live updating is a powerful feature, one that is possible in python but easy in smalltalk, and a point to be argued in this debate."
I think the language and runtime have to (and should be designed to) deliberately support this. I'd rather see the Python community focus on this than on optional static typing.
"I don't yet understand erlang's concurrency, or whatever other language features it has that support reliability, but it's something I've been meaning to study in detail. I will try to read the thesis you referenced; the abstract is interesting."
That's great, if I can get others to try new ideas. The basic idea is that Erlang is designed to be a simple, concurrency-oriented language. You might want to begin with Joe Armstrong's invited talk at Lightweight Languages 2 (http://ll2.ai.mit.edu), the slides and the video (morning session).
"I admit that I played devil's advocate"
I appreciate that.
"Erlang systems are reliable because the language does not have static-type-checking; or because the language is a single-assignment functional language designed around process-isolation?"
Erlang systems are reliable for a variety of reasons. The original argument in this thread was that static type annotations are not necessary for reliability, and could very well be at a disadvantage compared to languages like Erlang, Smalltalk, Lisp, and Python that do not have statictype annotations. This is an argument against adding optional static type annotations to Python, a "feature" which is currently under investigation in the Python community.
"How about Smalltalk? I've seen superb Smalltalk systems and dreadful ones."
Yes, see the quote above about great programmers.
"How about Orbitz? Hmmm iirc a large part of their system is built around Jini..."
I'm sure Orbitz is a very large post-modern system with a variety of moving parts. I would note that Jini's coordination mechanism (JavaSpaces) is asynchronous and dynamically typed (content-based, pattern-matched, addressing). If I were to build a significant system in Java, I would put this consideration high on my list.

The basic coordination mechanism in Erlang also is asynchronous, dynamically typed, and based on pattern matching. I don't consider this a coincidence.

3 comments:

Anonymous said...

Technically, Orbitz doesn't use Lisp, Orbitz is a client of ITA Software, who provide their fare search data, which is written partly in Lisp. I think every GDS now is an ITA customer, Orbitz was just the first, and thus most visible.
-- Gordon Weakliem

Anonymous said...

How is the argument from reliability of Lisp and Erlang systems an argument against optional static type declarations? In the Lisp world, you program with dynamic typing initially until the program stabilizes and the hot spots are known. You then type annotate just the hot spots to improve code generation of those hot spots (Lisp code is generally compiled), with the option to go to C to improve the hottest of the hot spots. Basically, type annotations in Lisp (and, one presumes, Python) are an upside option that you can but don't have to use. Writing Python code (or Lisp code) from scratch with type annotations would be pretty silly. (Or, to put this another way, in Lisp type annotation is a performance, not a reliability feature).

Anonymous said...

To the Anonymous person above me...

If type annotation is only about optimising hotspots, then surely Pyrex already fills most of this need, without needing to complicate the base language further? I appreciate Pyrex is not as convenient as having inbuilt language support, but it would probably do a better job of optimising anyway.

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.