[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ::scr cross over media



On Mon, Sep 16, 2002 at 03:14:38PM +0100, Rob Chatley said:
> With object-oriented programming we've supposedly been trying to make the
> "things" we use in programs more closely aligned to the problem domain. If
> we could change the "dialect" of the language that we programmed in as
> befit the problem in hand, would that make it easier to write the 
> program? Or easier to read it afterwards? Perhaps yes and perhaps no.

Domain Specific languages are interesting. On the one hand they can make
doing tasks really easy. Say for example, a hypothetical language for
doing 3D.


shape = Cube  (side=5, x=0, y=0, colour=red);
light = Light (strength=5, x=0, y=10, dir=20, colour=blue);
add  shape;
add  light;
spin shape;

and in 5 lines you've got a red cube with sides 5 units long, spinning
on the center point of the world with a string blue light pointing at
it.

Dead easy to program and dead easy to understand. However, unless you're
always working in the same domain then you're going to have to learn a
bunch, if not dozens of these languages.

Currently we make a compromise by have a few different programming
paradigms (procedural, OO, functional, logical) and then introducing
librarys which subtly munge the grammar of the language, temporarily, to
make it slightly more domain specific. For example :

#!perl
use LWP::Simple;

print get("http://thegestalt.org";);


prints out the HTML of possibly the least exiting (but still XHTML
compliant) web page ever. Simply by importing the LWP::Simple module I
provided myself with a new but powerful verb [0] that is simple to
understand but hides lots of complexity.

OO localises that domain specifity even more by tying it to objects.
Kind of like having a different language to talk about the different
things in your room. Of course you try and make similar actions have the
same name - move, copy et al. I'm in danger or heading off on a tangent
wondering what this sort of stuff would mean to IAs and what things like
tied objects in Perl, FIFOs in Unix and data serialization like Pixie
mean. If anything at all.

I should shut up now.

Simon

[0] This has interesting seuges (sp?) into jargon which explicityly
conjures up concepts in very concise terms. However it has been oft
noted that Jargon is used as a exclusion mechanism to prevent
'outsiders' from gaining access to inner secrets.

... I'm a bit pissed so excuse me if this is badly spelled or quite
random.