From: Wes Groleau <wesgroleau@despammed.com>
Subject: Re: Would an *AdaScript* language be a good / bad idea?
Date: Fri, 17 May 2002 09:33:49 -0500
Date: 2002-05-17T09:33:49-05:00 [thread overview]
Message-ID: <3CE514CD.DC9C679@despammed.com> (raw)
In-Reply-To: 3CE3FFE7.775E5103@san.rr.com
> 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
next prev parent reply other threads:[~2002-05-17 14:33 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-14 4:51 Would an *AdaScript* language be a good / bad idea? James Ross
2002-05-14 5:15 ` James Ross
2002-05-14 8:47 ` Ingo Marks
2002-05-14 14:21 ` Robert Dewar
2002-05-14 19:24 ` Ingo Marks
2002-05-15 5:32 ` Robert Dewar
2002-05-14 9:03 ` Preben Randhol
2002-05-14 14:18 ` Robert Dewar
2002-05-14 15:25 ` Larry Kilgallen
2002-05-14 16:45 ` Preben Randhol
2002-05-15 6:33 ` Per Sandbergs
2002-05-15 8:52 ` Preben Randhol
2002-05-15 11:35 ` Marc A. Criley
2002-05-15 12:56 ` Steve Doiel
2002-05-15 14:28 ` Preben Randhol
2002-05-16 2:46 ` Robert Dewar
2002-05-16 16:04 ` Darren New
2002-05-16 17:18 ` Wes Groleau
2002-05-16 18:52 ` Darren New
2002-05-17 14:33 ` Wes Groleau [this message]
2002-05-17 16:22 ` Darren New
2002-05-17 16:56 ` Darren New
2002-05-17 23:13 ` Wes Groleau
2002-05-17 23:20 ` Darren New
2002-05-17 16:58 ` Stephen Leake
2002-05-17 17:23 ` Darren New
2002-05-17 17:35 ` Pascal Obry
2002-05-17 17:44 ` Darren New
2002-05-17 18:02 ` Pascal Obry
2002-05-17 23:12 ` Wes Groleau
2002-05-17 23:27 ` Darren New
2002-05-18 2:54 ` Robert Dewar
2002-05-18 2:59 ` Robert Dewar
2002-05-28 0:31 ` David Thompson
2002-05-29 1:11 ` Robert Dewar
2002-05-21 20:48 ` Florian Weimer
2002-05-21 21:05 ` Preben Randhol
2002-05-22 7:17 ` Pascal Obry
2002-05-22 11:29 ` Preben Randhol
2002-05-21 20:35 ` Florian Weimer
2002-05-15 11:39 ` Bill Tate
2002-05-17 19:24 ` Gerhard Häring
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox