realbasic-nug
[Top] [All Lists]

Re: Why is object passing across RBScript context, not safe?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Why is object passing across RBScript context, not safe?
From: Mars Saxman <mars at realsoftware dot com>
Date: Sat, 29 Jan 2005 15:01:37 -0800
Delivered-to: realbasic-nug at lists dot realsoftware dot com
delete at elfdata dot com wrote:

> Why is passing objects across RBScript contexts, not safe?

When a script ends, its data structures are freed, including its class
structures and executable code. If it were possible to pass a script object
back to the host app, the host app could hold on to the reference long after
the script had ended; at that point, almost anything you tried to do with
the orphaned object - including release it - would probably cause a crash.

Beyond that problem, there's another: an object reference is useless without
information about its class. The host app can only use a script object if it
inherits from a class the host app already knows about; the script can only
use a host app object if the host app passes some information about its
class to the RbScript compiler.

Beyond that, more problems still: allowing a script to see host app classes
would introduce a whole new set of security concerns. We have seen the
security problems certain popular apps have had with their scripting
engines, and as a result we have always put security ahead of convenience
when adding new features to RbScript. We will not allow scripts to access
host object classes until we can do so without compromising an app
developer's ability to keep script code safely contained in its sandbox.

All of these problems have solutions, but getting there from here will take
a non-trivial amount of development time.

> Will RB6 have an uncrippled RBScript?

Since by "crippled" you seem to mean "lacks some feature I wish it had", I'm
quite certain that no version of REALbasic will ever contain an "uncrippled"
RbScript.

Mars Saxman
REAL Software
-- 
REAL World 2005 - The REALbasic User Conference
March 23rd - 25th, 2005, Austin, Texas
<http://www.realsoftware.com/realworld>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>