From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7E6A4BC48 for ; Wed, 6 Apr 2005 06:53:09 +0200 (CEST) Received: from tomts40-srv.bellnexxia.net (tomts40.bellnexxia.net [209.226.175.97]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j364r8KK016356 for ; Wed, 6 Apr 2005 06:53:08 +0200 Received: from nagash.wacky ([65.95.130.167]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050406045307.XJUG27737.tomts40-srv.bellnexxia.net@nagash.wacky> for ; Wed, 6 Apr 2005 00:53:07 -0400 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: some comments on ocaml{lex,yacc} from a novice's POV References: <49464.202.164.198.46.1112355123.squirrel@www.ivorykite.com> <200504041051.07270.jon@ffconsultancy.com> <87mzsdv3gb.fsf@nagash.wacky> <200504051449.39133.jon@ffconsultancy.com> From: Geoff Wozniak Date: Wed, 06 Apr 2005 00:52:58 -0400 Message-ID: <87vf70tsk5.fsf@nagash.wacky> User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Security Through Obscurity, linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Miltered: at concorde with ID 42536B34.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 grammar:01 recursive:01 parser:01 grammar:01 ocaml:01 minor:01 writes:01 typing:01 simpler:01 simpler:01 functions:01 conflicts:01 lex:01 X-Attachments: type="application/pgp-signature" X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: --=-=-= Content-Transfer-Encoding: quoted-printable Jon Harrop writes: > Note that, in this case, I was referring to the detection of grammar > conflicts and not static type checking. > Sorry -- that notion didn't come across very well in your message. The criticism was misplaced. (And I hope that my response didn't come off as an "ad hominem" fallacy.) > Can you give an example where dynamic typing has helped you to prototype = a=20 > program more quickly than you could have done with static type checking? > It happens quite often when I write code for a specification that is incomplete and I have to go back and change something. For example, I was recently working on a recursive decent parser for some grammar. I was interested to see what sentences in the grammar would look like, how they would parse, and other things of this nature. Basically, I was coding to flush out the inadequacies of the design. I was doing this in OCaml, but I found that I had to constantly create new types to represent the different forms that could be found in the parse tree. Often, it would involve moving some element from one type to another. This resulted in me making minor changes to a few different functions in order for the program to type check. It would have been considerably simpler to just throw the element into a cons cell with the first element being a symbol/string/whatever that just described the element. Then I would just write code that checked if the car/head of the cons cell was X and if so, do something with it. I am not advocating that this code would be suitable for release. In fact, I would have little faith in it and would probably be embarassed to release it. However, incrementally developing some program that does not have much of a specification seems to be much simpler if I don't burden myself with the act of conjuring up types for everything. Once I've gone through a couple iterations of the program, then I'm very interested in some form of strong type checking to make sure that I'm not missing the little things. =2D-=20 Geoff Wozniak --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBCU2sx+nqGMR5VMhkRAly4AKDijNqjK2FA2k0DMf5lOiVMhRNj+QCeLquw rHhm3dLIie+fQs7A69IwrOs= =iORm -----END PGP SIGNATURE----- --=-=-=--