Safe domain specific language implementation

Greeting All,

I am trying to write code that will interpret user submitted scripts in
a secure way. I have a limited set of functions that they should be
able to call to change various states. I also need the usual branching,
loping, and local variable assignment types of things. (see example
code) I hoped to be able to use Ruby’s safe mode for this is ways
similar to

I have a few questions in this regard:

1). Are there any websites/articles that deal with how to use $SAFE
(particularly level 4)

2). In light of is this a
feature that is still in development? (please also see

3). What are some implementation options? What would be required in
terms of programming?


J.F. Miller


Example code

#entrusted user script

#call this function when a power shortage is detected
def power_shortfall
  pl = get_power_reading
  if pl<100

Posted via