Another scripting language implemented into Python itself?
Jeff Shannon
jeff at ccvcorp.com
Mon Jan 24 20:38:21 EST 2005
Roy Smith wrote:
> In article <mailman.1231.1106610969.22381.python-list at python.org>,
> Quest Master <zainalam at gmail.com> wrote:
>
>>So, my question is simply this: is there an implementation of another
>>scripting language into Python?
>
> Python *is* a scripting language. Why not just let your users write
> Python modules which you them import and execute via some defined API?
Because you cannot make Python secure against a malicious (or
ignorant) user -- there's too much flexibility to be able to guard
against every possible way in which user-code could harm the system.
Parsing your own (limited) scripting language allows much better
control over what user-code is capable of doing, and therefore allows
(at least some measure of) security against malicious code.
To the O.P.: Yes, people have implemented other languages in Python.
For example, I believe that Danny Yoo has written a Scheme
interpreter in Python (Google tells me it should be at
http://hkn.eecs.berkeley.edu/~dyoo/python/pyscheme but I'm getting no
response from that host right now), but I don't know whether Scheme
counts as a scripting language. ;)
However, if you're using a fully-featured language for these user
scripts, you'll probably have the same security issues I mentioned for
Python. Unless you really need that level of features, you may be
better off designing your own limited language. Check into the docs
for pyparsing for a starter...
Jeff Shannon
Technician/Programmer
Credit International
More information about the Python-list
mailing list