4 ms·
Planned for 3.12 > Simple "JIT" compiler for small regions. Compile small regions of specialized code, using a relatively simple, fast compiler. https://githu
by nigma1337 4y ago
Planned for 3.12
> Simple "JIT" compiler for small regions. Compile small regions of specialized code, using a relatively simple, fast compiler.
https://github.com/markshannon/faster-cpython/blob/master/plan.md https://github.com/markshannon/faster-cpython/blob/master/pl...
- pjmlp 4y agoI guess better than nothing then.
- driscoll42 4y agoWhen you're dealing with one of the most popular languages in the world and the cost of getting it wrong and breaking things is astronomical, being risk adverse and starting small seems like the way to go.
- pjmlp 4y agoDoesn't seem to hinder JavaScript runtimes.
- Sol- 4y agoHasn't Microsoft experimented with disabling the JIT for security reasons?[1] Doesn't have much relevance for Python at the moment, but I'm just mentioning it to underline that a modern JIT can be very complex thing and keeping it simple for 3.11 seems like a very reasonable requirement. [1] Random google result as source: https://www.cyclonis.com/microsoft-edge-tests-disabling-javascript-jit-compiler-boost-security/ https://www.cyclonis.com/microsoft-edge-tests-disabling-java...
- pjmlp 4y agoThat isn't what is being discussed here, every JIT has a potential for eventually generating code patterns susceptible of exploits.
- acdha 4y agoJavaScript has multiple companies with valuations measured in billions of USD competing. Optimizing JavaScript is just as hard but they can throw massive development teams at the problem. Python isn’t without resources but the level of scale is dramatically different.
- pjmlp 4y agoBecause those investing into machine learning frameworks in Python rather spend their resources rewriting their libraries in C, C++ and Fortran while calling it "Python".
- acdha 4y agoSure, my point was just that the number of corporate investment in the core Python language is smaller. Investing in an ML framework isn’t a bad thing but it doesn’t support anyone working on the core language the way Google, Apple, Microsoft, Samsung, etc. contribute directly to Chromium/WebKit development.
- pjmlp 4y agoSome of those companies overlap both ecosystems.
- wheelerof4te 4y agoPython's ease of calling C libraries is both the blessing and a curse. My opinion is that it's mostly a curse, since you are hampering the language's evolution and growth for a mere temporary benefit. Not to mention the horror of distributing compiled libraries, which is one of the biggest reasons why packaging in Python is still such a nightmare. Making CPython faster by getting rid of the GIL will do wonders for this language and it's community. It will make it much more portable, too. Think of Java-level portability, but in a much nicer package.
- dragonwriter 4y ago> JavaScript has multiple companies with valuations measured in billions of USD competing. A couple of them have valuations in the trillions of USD, actually.
- chubot 4y agoJavaScript doesn’t have a C API, that makes all the difference
- brrrrrm 4y agowhat about NAPI? Or deno/buns JITed api? I’ve heard this “no C API” thing echoed by a couple people and it’s baffling. Do folks really think three major JS engines all written in C++ wouldn’t have an interface to interact with C?
- chubot 4y agoThe problem is evolving the interpreter in a way that doesn't break bazillions of third party bindings -- Win32, OpenGL, Fortran for NumPy/Pandas, databases, GPUs, every C and C++ library ever, etc. Python's C API exposes ref counting and the GIL. It's also very large JS doesn't have that problem -- more code is written in pure JS, there are no C/C++ bindings in the browser. There are C/C++ bindings in node.js for v8, but as far as I know they are discouraged and not used very much. The bindings are more "first party" in node.js than third party. They have issues, but not the same ones as CPython, because the API is very different JS VMs must be re-entrant because they're embedded in browsers. That was never the case for CPython
- deleted 4y ago[deleted]
- brrrrrm 4y ago> as far as I know they are discouraged Fwiw, this a fully stable and well documented API. It’s not even v8 exclusive, Bun cloned it for WebKit. https://nodejs.org/api/n-api.html https://nodejs.org/api/n-api.html
- 323 4y agoThe only C code JavaScript needs to interact with is 100% under the control of the browser implementing that JavaScript engine. JavaScript doesn't interact with random C libraries that the user might have, like Python does.