[DGD] system() command
Noah Gibbs
angelbob at monkeyspeak.com
Sun Jun 2 18:58:21 CEST 2002
On Sun, 2 Jun 2002, Lord Lerkista wrote:
> There's some way to use the system() comand to get the result to the
> mud??
>
> For example system("ls"); and get the output to a variable in the mud
If you think about it, this can't really be possible in core DGD, for
the same reason that callout to most languages can't be possible. Yeah,
I know, everything's possible. But hear me out.
DGD has the limits() construct and atomic functions, both of which
impose pretty unusual conditions on the entire language. Dworkin has been
excellent at keeping DGD from *seeming* limited, but once you do callout
to C, you have a problem -- you can't count ticks, you can't make stuff
properly interruptable (try it, it's *hard*). The system() command is
basically callout to the shell, and has the same problem. It has an
advantage over C since you're killing the shell afterwards. So if you
interrupt it, it doesn't leave all your data structures in an inconsistent
state. But it's still not atomic, so you'd have to avoid using it in
atomic functions, just like any other kind of language callout.
Folks recommended a servlet-based method to get around this, which
works. Since it's based on network I/O, you'll notice you still can't use
it in atomic functions, and you'll have to be very careful to keep it from
getting confused if it's interrupted for lack of ticks. DGD's LPC is a
very carefully designed language, and getting it to work at full power
with other (less careful) languages is more difficult than it looks.
Sometimes I'll describe DGD to various friends, especially the
limits() and atomic function features of the language. I measure how much
they've thought about these issues by how far their jaw drops when they
hear about what DGD does.
--
angelbob at monkeyspeak.com
See my page of DGD documentation at
"http://phantasmal.sourceforge.net/DGD/"
If you post to the DGD list, you may see yourself there!
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list