Re: Constructible Exceptions

On Sunday, 25 March 2012 at 17:48, Boris Zbarsky wrote:

> On 3/25/12 12:03 PM, Marcos Caceres wrote:
> > Right. Without getting too academic here, that kinda sucks as an "interface" is not really an "interface" (in the classical black-box sense)
> The only way to make it so is to make it so all operations on interface  
> objects are possible to perform solely using information presented in  
> the interface.
> In other words, no hidden state.
> Making that work in a world in which there's supposed to be security  
> sandboxing may be exciting in some cases. It may be possible with  
> careful design of the interfaces and the functionality exposed via said  
> interfaces and careful limitation of what the platform can actually  
> do... maybe.

Yes, I completely understand that (hence my not wanting to get too "academic" about it).  
> -Boris
> P.S. It would also be incredibly slow; to take the simple Node example,  
> a browser would not be able to assume that the DOM is a tree, or indeed  
> anything else about it (e.g. getting the parentNode of a node might  
> completely rearrange the DOM), which would significantly complicate  
> every single algorithm that has to deal with the DOM because it would  
> have to be made robust against that sort of thing.

Yeah, I get that too. I guess that is the trade off between the flexibility and security the Web platform provides and my ideal of all objects created equal. I guess an environment like Node.js would be more appropriate for this kind of thing (as it doesn't provide any platform DOM objects, hence there all object would be created equal… unless implemented in C++ and then exposed as platform objects:)).  

Thanks for the clarification, Boris.  

Kind regards,
Marcos Caceres

Received on Sunday, 25 March 2012 18:15:02 UTC