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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,84bf0ec36cf20893 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-17 09:22:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.columbus.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3CE52E77.FC3FC588@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en 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> <3CE514CD.DC9C679@despammed.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 17 May 2002 16:22:57 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1021652577 66.75.151.160 (Fri, 17 May 2002 09:22:57 PDT) NNTP-Posting-Date: Fri, 17 May 2002 09:22:57 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:24287 Date: 2002-05-17T16:22:57+00:00 List-Id: Wes Groleau wrote: > You listed five steps, but your examples > only do one of the steps--invoke. Because I don't need those other four steps in Ada. > And I don't see either example as being more difficult than > Invoke (Name_Of_File); Um.... But that doesn't do the same thing. What do you think the semantics of "Invoke" are? Compiling a program and executing it? Note that both of my examples are basically the equivalent of "with" in Ada, not "system()" in C. > 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? Yes, because it doesn't do the same thing. > 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. Well, my point is all these things modify the currently-running program, so yeah, it is a lot harder. If you haven't done a lot of work with this type of scripting language, then I suspect you aren't really following what I'm saying here. The rest snipped, because I'm not sure you're making any sense. > 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? I disagree. Write a piece of Ada code that declares a new type at run-time based on a user's input, perhaps a derived type of a tagged type, and loads it into the currently running program, instantiates it, and sticks it into an array of heterogenous objects all derived from that type, dynamically dispatching to them. Note that "stop everything, rewrite the program, recompile, and start up again" is not acceptable. In scripting languages, this is done all the time. Roll-overs in Javascript get dynamically loaded into your web browser to pop up annoying windows. Tcl applications load the code for building database queries by querying the database and reading the code therefrom. Java interpreters suck new classes over the net. How would you do it in Ada? I don't believe that "save the state of the currently running program and invoke a new program so it starts up in the same place as the old one" can be made an Ada library. If it can, that would be really cool, because it would solve a problem I've been thinking about for a while in an unrelated field. But I haven't figured out any way of doing that without knowing what part of the program constitutes the "current state". There's a tremendous difference between linking to DLLs, generating code on the fly, and the "exec" system call. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. ** http://home.san.rr.com/dnew/DNResume.html ** ** http://images.fbrtech.com/dnew/ ** My brain needs a "back" button so I can remember where I left my coffee mug.