caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matt Gushee <matt@gushee.net>
To: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] GC and file descriptors
Date: Wed, 19 Nov 2003 23:35:11 -0700	[thread overview]
Message-ID: <20031120063510.GC893@swordfish> (raw)
In-Reply-To: <Pine.LNX.4.44.0311182039440.5009-100000@localhost.localdomain>

On Tue, Nov 18, 2003 at 09:07:17PM -0600, Brian Hurt wrote:

> > > > > single-person, throw-away projects.  And they aren't that far from 
> > 
> > I beg to differ (see below)!
> > 
> 
> I concede the point.
> 
> > > One problem I have is that programming is going away from strict compile 
> > > time type checking to run-time type checking.  The problem with run-time 
> > > type checking is that it only catches errors in the field.  Static type 
> > > checking is the most powerfull tool we've come up with to ensure 
> > > correctness in programs.  And no, unit tests are not a replacement for 
> > > strict compile-time type checking.
> > 
> > But doesn't the value of type checking depend on the types of problems
> > you are working with? Many important problems in Web programming, for
> > example, depend on distinguishing between differently-structured
> > strings (including HTML and XML markup, of course, but also things like
> > URI references and e-mail addresses). To my knowledge, there are very
> > few existing type systems that even attempt to accommodate such
> > distinctions (XML Schema is the only one I know of).
> 
> "Airbags in dashboards don't help you with side-impact collisions, so why 
> do we need airbags?"

Nice metaphor. Though I would point out that "safety" in software, or
lack thereof, rarely directly affects life and limb ... so that it may
be more acceptable to cut corners on safety for economic reasons (though
I don't necessarily agree with that reasoning).

> Strong type checking is not a replacement for unit tests either.
> 
> That being said, what advantage does weak type checking, or run-time type
> checking, give you in this situation?

None, if your focus is exclusively on software-as-product. On the other
hand, dynamically-typed languages mostly dispense with variable type
declarations (as, of course, does OCaml in most cases). I would claim
that elaborate rituals like

    public static void main(String[] args) {

can be an obstacle to clear thinking about the many problems that go
beyond type safety. And too much attention to type safety can lead
programmers into the trap of thinking that whatever compiles must be
good (I'm not accusing you of this error, though I was tempted to do so
;-). As Donald Knuth famously remarked,

  Beware of bugs in the above code; I have only proved it correct, not
  tried it.

If I read him right, he thought that correctness (including, I imagine,
type safety) was a necessary but not sufficient condition for quality
software, which seems to be your view also. And I don't disagree,
really. One of the reasons I got interested in OCaml was that it offers
much of the expressiveness of the "scripting languages" together with
strong type safety. But I get worried when I see the quest for program
correctness take on a religious tinge, as it sometimes appears to on
this list. So I thought it was time to play Devil's Advocate.

> > So in some cases, good string manipulation and regexp facilities can be
> > much more valuable than type checking ... and this is one of the
> 
> The big advantage Java has is J2EE.  Basically, if you're doing any sort
> of major enterprise app, J2EE solves the hardest parts (failover, load
> balancing, distributed computing, interfacing with legacy systems and DBs,
> etc) for you.

Okay, I'll grant that, but I don't see what it has to do with the merits
of static typing.

> I do agree that Ocaml could use better regex handling.  Thanks to being 
> able to define new operators, you wouldn't even need to change the 
> language, you could do it all in a library.
> 
> > Does the shift away from compile-time checking really mean the world is
> > going to Hell in a handbasket, or does it simply reflect the
> > (postulated) fact that programmers today are commonly dealing with
> > distinctions that aren't accommodated by type systems, even the more
> > sophisticated ones such as OCaml's?
> 
> You're arguing that most programmers are doing web programming?

Nonsense! I was speaking of a relative shift in emphasis, and offered
Web programming as an example.

> Yes, things are going downhill.  Even within my adult lifetime it's become 
> more acceptable to ship programs with known flaws in them.

Hmm ... I also have the sense that quality is gradually becoming
extinct, not just in computer software, but also in most consumer
products, in education and politics. But is that true, strictly
speaking, in the case of software (sincere question here, I really don't
know the answer)? Are the kinds of mission-critical systems that have
been around for decades actually getting worse? Or is it rather that
business doesn't see fit to provide quality products for the many new
uses--and users--of computers that have arisen?

> When I was in college, C was derided for having too weak a typing system- 
> now the new popular languages make C look strongly typed.

Perhaps ... but noone has ever seriously suggested that Python, Perl and
friends should *replace* C. Rather, the argument is that "scripting"
languages are best suited for high-level tasks (especially in
text-intensive applications), often in combination with C libraries that
will perform common, performance-intensive routines.

-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


       reply	other threads:[~2003-11-20  6:35 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031118232227.GA8437@swordfish>
     [not found] ` <Pine.LNX.4.44.0311182039440.5009-100000@localhost.localdomain>
2003-11-20  6:35   ` Matt Gushee [this message]
2003-11-21 16:44     ` skaller
2003-11-21 22:17 Gregory Morrisett
  -- strict thread matches above, loose matches on Subject: below --
2003-11-13  0:50 Dustin Sallings
2003-11-13  1:18 ` David Fox
2003-11-13  4:09   ` Dustin Sallings
2003-11-14 13:42     ` Damien Doligez
2003-11-14 14:57       ` Christophe Raffalli
2003-11-14 20:24         ` Dmitry Bely
2003-11-14 20:54           ` Eric Dahlman
2003-11-14 22:21             ` Brian Hurt
2003-11-14 21:36               ` John J Lee
2003-11-14 21:48           ` Brian Hurt
2003-11-15  1:47             ` Dmitry Bely
2003-11-15  2:25           ` Max Kirillov
2003-11-15  2:49             ` Mike Furr
2003-11-15  2:58             ` David Brown
2003-11-17 14:19         ` Damien Doligez
2003-11-17 18:18           ` skaller
2003-11-14 18:35       ` Dustin Sallings
2003-11-15 14:16         ` skaller
2003-11-15 15:56           ` Ville-Pertti Keinonen
2003-11-15 17:30             ` skaller
2003-11-15 20:31               ` Martin Berger
2003-11-16 19:19               ` Brian Hurt
2003-11-17 18:15                 ` skaller
2003-11-17 19:26                   ` Aleksey Nogin
2003-11-18 13:49                     ` skaller
2003-11-18 17:51                       ` Dustin Sallings
2003-11-18 20:17                       ` Aleksey Nogin
2003-11-20  7:36                         ` Florian Hars
2003-11-17 21:20                   ` Brian Hurt
2003-11-17 23:02                     ` John J Lee
2003-11-18 12:05                     ` Ville-Pertti Keinonen
2003-11-18 15:19                       ` skaller
2003-11-18 18:10                         ` John J Lee
2003-11-18 17:55                           ` skaller
2003-11-18 20:02                         ` Ville-Pertti Keinonen
2003-11-18 21:20                           ` John J Lee
2003-11-19 12:25                           ` skaller
2003-11-19 13:55                             ` Ville-Pertti Keinonen
2003-11-19 14:26                               ` Samuel Lacas
2003-11-19 14:47                               ` skaller
2003-11-18 15:28                       ` skaller
2003-11-18 18:00                       ` John J Lee
2003-11-18 22:28                       ` Brian Hurt
2003-11-18 23:07                         ` John J Lee
2003-11-18 23:22                         ` Benjamin Geer
2003-11-19  1:49                         ` Martin Berger
2003-11-19  3:57                           ` Dustin Sallings
2003-11-19 13:35                           ` skaller
2003-11-19 13:00                         ` skaller
2003-11-19 13:02                         ` skaller
2003-11-19 17:36                           ` Brian Hurt
2003-11-20  5:14                             ` skaller
2003-11-20  7:37                               ` David Brown
2003-11-18 15:12                     ` skaller
2003-11-18 16:49                       ` Martin Berger
2003-11-18 17:46                         ` skaller
2003-11-19  1:33                           ` Martin Berger
2003-11-19 13:27                             ` skaller
2003-11-19 14:41                               ` Martin Berger
2003-11-19 16:54                             ` Richard Jones
2003-11-19 17:18                               ` Damien Doligez
2003-11-19 21:45                                 ` Richard Jones
2003-11-19 23:09                                   ` Benjamin Geer
2003-11-20  0:50                                     ` Nicolas Cannasse
2003-11-20  9:42                                       ` Benjamin Geer
2003-11-19 18:03                               ` Martin Berger
2003-11-18 18:26                         ` Benjamin Geer
2003-11-18 19:24                           ` Xavier Leroy
2003-11-18 23:49                             ` Benjamin Geer
2003-11-19  1:36                             ` Martin Berger
2003-11-19  2:28                               ` Nicolas Cannasse
2003-11-19  3:26                               ` Brian Hurt
2003-11-19 11:44                                 ` Martin Berger
2003-11-19 17:29                                   ` Brian Hurt
2003-11-20  5:17                                     ` skaller
2003-11-20 16:13                                       ` Brian Hurt
2003-11-19 13:33                               ` skaller
2003-11-19 17:01                                 ` Richard Jones
2003-11-19 17:43                                 ` Brian Hurt
2003-11-20  5:05                                   ` skaller
2003-11-19  1:33                           ` Martin Berger
2003-11-19  2:47                             ` Benjamin Geer
2003-11-18 22:23                       ` Brian Hurt
2003-11-19 13:00                         ` skaller
2003-11-13  1:19 ` Nicolas George
     [not found] ` <87smkstkhg.fsf@igloo.phubuh.org>
     [not found]   ` <347A7A46-1612-11D8-8F93-000393CFE6B8@spy.net>
2003-11-13 20:18     ` Mikael Brockman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031120063510.GC893@swordfish \
    --to=matt@gushee.net \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).