comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Would an *AdaScript* language be a good / bad idea?
Date: 17 May 2002 12:58:06 -0400
Date: 2002-05-17T17:05:09+00:00	[thread overview]
Message-ID: <un0uyzp7l.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 3CE52E77.FC3FC588@san.rr.com

Darren New <dnew@san.rr.com> writes:

> <snip> 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. 

Right, Ada is not designed for this. Although the distributed annex
comes close; you could change out a partition without restarting the
other partitions.

You can also get close via DLLs on Windows (and shared libraries on
other OS's?), but not with full dispatching.

> In scripting languages, this is done all the time. 

Perhaps there is a better term for this than "scripting language". For
example, Java has this capability, and it is _not_ a "scripting
language" by your definition (at least, I don't think it is :). Lisp
has this feature; is that a "scripting language"?

And Ada compiled to the JVM would have this capability; that would be
interesting to play with.

Perhaps "dynamic code loading" is a good phrase for this feature.

> 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. 

For some set of Ada programs, you can clearly do this. Not for an
arbitrary one. Perhaps not for interesting programs :).

> 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".

I gather you want the "save the state" operation to be provided by the
compiler, not by the programmer. I guess that is true in the languages
that have "dynamic code loading". Clearly, if the user provides it,
you can solve a wider range of problems.

> There's a tremendous difference between linking to DLLs, generating
> code on the fly, and the "exec" system call.

Agreed.

-- 
-- Stephe



  parent reply	other threads:[~2002-05-17 16:58 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
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 [this message]
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