From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Tue, 7 Sep 2004 15:13:39 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> <6F2Yc.848$8d1.621@newsread2.news.pas.earthlink.net> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1094570019 199 134.91.1.34 (7 Sep 2004 15:13:39 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Tue, 7 Sep 2004 15:13:39 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:3433 Date: 2004-09-07T15:13:39+00:00 List-Id: jayessay wrote: : Georg Bauhaus writes: : :> jayessay wrote: :> : Ole-Hjalmar Kristensen : ... :> :> :> :> I do not consider myself a Lisp programmer, but I have programmed :> :> enough Lisp to conclude that you probably are correct that the ability :> :> to create a constrained narrowly focused domain specific language :> :> within Lisp could very well outweigh the advantages of static typing. :> : :> : If you've been there, you know this. Actually, the incremental bottom :> : up development with _continual_ testing of almost every code snippet :> : is a significant advance above static typing. :> :> I do these little steps all the time, _with_ static type checks, :> documenting my expectations in lots of small test-programs. : : You can't. Because the sort of snippets I'm discussing are not even : legal programs in things like C++/Ada/Eiffel/etc. : : How do you do stuff like this: : : ;; Does the log reader return the correct forms for a log file : (alice:read-unanswered-log "../alice-unanswered.log") with Alice; procedure test is begin Alice.read_unanswered_log("../alice-unanswered.log"); end test; : Doing this in Ada/C++/Eiffel would require setting up a fairly big : procedure/function with all sorts of withs or imports and : instantiations, etc just to get to the one line out of hundred or so : that you want to test. Huh? The fact that you have a big, hopefully tested and checked library/system full of convenient things in CL may be a plus if you can use it. If I have a big Ada library, I expect to use it as an Ada library. Ada is explicit and verbose. You get something in return. : The whole idea is a complete non starter. Not for me. A can live with some typing on the keyboard. If I want to do incremental try-out programming, I know where to get it. (Lisps, Smalltalk, ...) : Or how about: : : (with-protected-resource *main-database* : (let ((broken-bits (ensure-consistent-state it))) : (when broken-bits : (pprint-db-items broken-bits)))) : : : Here, you'd need to set up a couple of tasks and probably a protected : object plus more boiler plate. Here, someone has provided a set of identifiers implicitly setting up a couple of task and some such I guess. How much time has it taken to define all this using testing and run-time type checking, when you compare to the time needed to do the "same" thing with static type checks on? Seems a more interesting question. The possibility to do amazing things in Lisp is beside the point I think. : You simply cannot do this sort of thing in stactic languages. You : shouldn't be bothered by this because you are claiming static type : checks are worth the price of losing this sort of thing. Why should static type checking be in the way of every dynamic thing? True, sometimes being explicit about everything using types can be combersome plus Lisp has EVAL and macros, adding power... :> But why do you assume that static typing replaces the need to test :> every corner of the software? : : I don't. Obviously it doesn't. No one believes that it does. You : are hacking at a strawman. >From what you were saying (sounding like static type checks are a waste of time) I thought it wasn't obvious. :> But the "incremental testing fans" do not assume that testing many :> cases will give them type coverage? : : There is no assumption. First dynamic typing is as strong (robust) as : static typing. At run-time only ... Or at try-out time, maybe? : Second, testing many cases is irrelevant. Testing : _outside_ the expected envelope is key. A type defines an envelope, known to both the compiler at compile time and the program at run time, or test time. So you have at least told your readers where outside is. Testing inside is important as well, because unless proven you don't know for sure which values are inside and outside, resp.. As someone said somewhere else in this thread, test the unexpected unexpected :-) : Once you have accounted for : this you are set to go. As you evolve the functionality input : producing erroneous results (type or logic) is caught futher and : further up the chain. At each point you account for this and : continue. And the use of types removes some of the need to test a function with arguments that cannot be passed to the function because the compiler has checked. -- Georg