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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,84bf0ec36cf20893 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-17 07:33:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3CE514CD.DC9C679@despammed.com> From: Wes Groleau Reply-To: wesgroleau@despammed.com X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,es-MX,es,pt,fr-CA,fr MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Would an *AdaScript* language be a good / bad idea? References: <5ee5b646.0205140618.2d789fc9@posting.google.com> <5ee5b646.0205151846.4b14a73f@posting.google.com> <3CE3D8B4.C272C737@san.rr.com> <3CE3EA03.394B3EA@despammed.com> <3CE3FFE7.775E5103@san.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 17 May 2002 09:33:49 -0500 NNTP-Posting-Host: 151.168.144.162 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 1021646039 151.168.144.162 (Fri, 17 May 2002 10:33:59 EDT) NNTP-Posting-Date: Fri, 17 May 2002 10:33:59 EDT Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:24269 Date: 2002-05-17T09:33:49-05:00 List-Id: > Errr, well, being used to scripting languages, I'd call both of these > "difficult" compared to what you typically do with a scripting language. > Obviously it's not impossible, or you wouldn't be able to write an OS in > Ada, but it's certainly a lot easier to say something like > > source $name_of_file > > or > > MyClass x = new CodeLoader("xyz.class"); > > or something like that than it is to write the support code it would > take to find an arbitrary Ada source, compile it in a cross-platform > way, write out all your state, invoke the compiled program, and then > somehow clean up all that afterwards, taking care to catch any errors. You listed five steps, but your examples only do one of the steps--invoke. And I don't see either example as being more difficult than Invoke (Name_Of_File); Sure, someone had to write procedure Invoke (Command : String); pragma Import (C, Invoke, "exec"); -- this won't work, it's merely illustrative but as I said, many implementations are sold with the equivalent already built-in. What about the other steps? Is either incredibly harder than the other? Building: print OUTPUT ("$Var = \$Var + \$Latest;\n"); # perl ? Put_Line (Output, "Var := Var + Latest;" ); # Ada Compile and link: # scripts don't need it, so penalize compilers one point Invoke (Make_Command & " " & Source_File_Name); # Ada -- not platform independent, so another one in favor of -- interpreters or JIT compilers. Run: source New_Script_Name # csh Invoke (Exec_Name_Rule (Source_File_Name)); # Ada Saving state: No example--it varies in difficulty according to the application, not the language. Also, it's not necessary unless you are "modifying" the currently running program. Cleaning up: rm $scratchpad Invoke ("rm Scratchpad_Name"); (Actually, difficulty of--or need for--cleanup depends on the application, not the language.) Error handling: No scripting example, because it's too much work to write the equivalent of exception when E : others => Not to mention the code to detect the errors! Summary (higher means harder): Task Compiled Ada Interpreted shell ------------------ ------------ ----------------- Building: 1 1 Compile and link: 2 0 Run: 1 1 Saving state: * * Cleaning up: * * Error handling: 1 2-5** =============== ==== ======== TOTAL 5 4-9 * neither a language issue nor a compiler/interpreter issue ** a language issue, but not a compiler/interpreter issue So, I'm not saying one _should_ use Ada for stuff like this, I'm just saying it's NOT difficult. Long post for two lines, eh? -- Wes Groleau http://freepages.rootsweb.com/~wgroleau