2 ms·
Last I looked, you are correct, but Python isn't designed as an embeddable language, either. Multiple VMs usually isn't something you'd have any desire to do sp
by cheald 12y ago
Last I looked, you are correct, but Python isn't designed as an embeddable language, either. Multiple VMs usually isn't something you'd have any desire to do specifically because you can achieve multithreading from within the language itself.
If you need multiple, separate VMs (ie, to drive multiple isolated scripting engines in a game), then v8 isolates or Lua contexts will do you just fine, but that's a different use case than most places where you'd want to use concurrent Python.
- nostrademons 12y agoPython totally is designed as an embeddable language; that's why there's a giant section called "Embedding Python in Another Application" in the reference manual: https://docs.python.org/2/extending/embedding.html https://docs.python.org/2/extending/embedding.html It's just that at the time Python was created, multithreading was not something you generally did in a C program. The POSIX thread standard didn't come out until 1996. Python was started in 1989, first released in 1991, and reached 1.0 in 1994. Common rules of thumb for dealing with multithreaded programs (eg. "Avoid global or static data") didn't really become popularized until the 2000s, and many programmers in less well-informed circles still don't know them.
- cheald 12y agoWhat I mean is that while Python's embeddable, it wasn't designed specifically as an embeddable language in the same way that Javascript or Lua were.