Re: Help finding right place for my questions

Boris Zbarsky <[email protected]> Sun, 10 Nov 2019 00:54:22 -0500
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On 11/9/19 4:16 PM, yun bao wrote:
> Right now I'm trying to better understand the general domain and discover if any
> there are any well known problems related to making a Python web browser
> engine.

Are you planning to do _just_ Python, or both Python and JavaScript?

In the latter case, there is one well-known problem: preventing leaks 
due to circular object graphs that span both the JS and Python heaps, 
because the JS garbage collector does not know about the Python side and 
vice versa.  This was a significant problem for PyXPCOM before we 
removed it.

In both cases, there is the issue that the core Python language is not 
really what anyone thinks of as "using Python"; people tend to assume 
that with the language comes the standard library.  And the Python 
standard library doesn't really have concepts of sandboxing, origins, 
etc, that the web browser environment relies on for safety.  This means 
that exposing parts of the standard library without introducing security 
holes might be complicated, depending on your threat model.

There are also various practical issues in terms of the browser 
internals assuming that objects have JS representations, parts of web 
APIs actually being very JS-specific (typed arrays, Promises, etc), and 
other JS dependencies, but the above are the two big conceptual problems 
I know of that people haven't really found solutions for in the past.

-Boris