On Tue, Jun 16, 2020 at 6:16 PM Paul Sokolovsky <[email protected]> wrote: > There's a reason why even projects otherwise largely written in Python, > use a different language (like JavaScript) when they need > easy-for-users scripting capabilities. A random example is > https://github.com/frida/frida . That's because such projects want to > let their users write one-liners like: > > for_each_kaboom(function (kaboom) {print("here's kaboom", saboom); > for (sub in kaboom) print(sub); }) >
Actually there's another and a very important reason, unrelated to syntax. You can put untrusted code into a JS sandbox and expect it to be safe, but you can't easily sandbox Python code (especially not inside other Python code). That doesn't mean that JS is inherently better than Python; it just means that JS is the correct tool for that job. ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/SRUHIE3NPBKRDCTFV7LH6VRLHJ24JDE3/ Code of Conduct: http://python.org/psf/codeofconduct/
