Another scripting language implemented into Python itself?
Roy Smith
roy at panix.com
Mon Jan 24 21:17:24 EST 2005
Rocco Moretti <roccomoretti at hotpop.com> wrote:
> The OP doesn't mention his application, but there is something to be
> said about domain specific scripting languages. A well designed
> domain-specific scripting language(*) with the appropriate high level
> constructs can make script writing simpler.
This is a bit of a sore point with me.
I've been involved with several projects where people felt the need to
invent their own scripting languages. It usually starts with "we don't
need the power of a full programming language, we only need to be able
to do X, Y, and Z". So they write a little language which lets them do
X, Y, and Z.
Then they discover they need more complex data structures than they
originally thought. And nested loops. And functions. And more
sophisticated variable scoping rules. And a regex library. And 47
other things. So they duct-tape all those into the system.
A few years later, you end up with most of a real programming language,
except with a whole bunch of warts.
The syntax is usually quirky (the one I'm working with today does not
allow any space before the open paren of a function call, but requires
it before the opening paren of an "if" statement). It generally has
poor error reporting. It doesn't have the whole family of free tools
that grow up around any real language (editor customization packages,
syntax checkers, debuggers, extensions, etc). You doesn't have a gaggle
of tutorial books written about it that you can buy from your favorite
on-line bookseller.
Worse, when you need more brains/bodies on the project, you can't put an
add on Hot Jobs for "experienced OurOwnScriptingLanguage programmer" and
expect to get anybody who can be productive quickly.
What it does have is a body of code dependent on it which is now so
large that porting it to something else is an unthinkably large task.
And it's got a small cadre of language gurus who spend all day defending
the language with answers like, "But, it was never *intended* that
people would do stuff like this with it".
Anyway, that's my little rant on inventing your own scripting language.
Imbed Python, or Perl, or TCL, or Ruby, or PHP, or Java, or whatever
floats your boat. Almost any choice has got to be better than rolling
your own. Invest your intellectual capital doing what you can do best,
and don't get bogged down developing a new language.
More information about the Python-list
mailing list