Anthony Shaw writes about Python internals, performance, the JIT compiler, sub-interpreters and running Python alongside .NET.
HN commenters link his post on the Python 3.13 JIT as a clear explanation of the copy-and-patch approach, and his CSnakes project for embedding Python in .NET.
A decade ago, https://pycpu.wordpress.com/ was a prototype that turned a small subset of Python bytecode, as well as the specifications for a system to run it, into VHDL/Verilog (via myhdl.org) to run on an FPGA. In theory, I imagine it would be possible to take this approach and transpile something like https://doc.pypy.org/en/latest/interpreter.html to an HDL.
But a more reasonable thing to do would be to look down the road that JIT's and other similar technologies are coming to mainline CPython, see e.g. https://tonybaloney.github.io/posts/python-gets-a-jit.html - and thus it might make sense to have some of the unique semantics of Python opcodes be adopted by specifications like ARM, similar to how ARM created the FJCVTZS opcode to exactly match Javascript's ToInt32 specification:
https://stackoverflow.com/questions/50966676/why-do-arm-chips-have-an-instruction-with-javascript-in-the-name-fjcvtzs -> https://tc39.es/ecma262/#sec-toint32
> There is so much pointer indirection internal to CPython.
This cannot be overstated. Really, truly, forget everything you know about cache locality when doing even basic "for-each: add numbers together"-type things in Python.
That's not an indictment; such indirection is par for the course for scripting languages, and enables a lot of features and dynamism. Additionally, the cost of that indirection may go down over time thanks to interpreter optimizations like the JIT: https://tonybaloney.github.io/posts/python-gets-a-jit.html
CSnakes integrates Python into .NET apps - https://tonybaloney.github.io/CSnakes/
https://www.youtube.com/watch?v=DqoxHNH9Iwo shows adding an LLM
There are several ways to manage migrations depending on the team structure and dev practices: SQL scripts, command line, bundles (single-file executables), and in-app. The team recommends SQL scripts since they can be reviewed, tuned, and managed by a DBA but take your pick. https://learn.microsoft.com/ef/core/managing-schemas/migrations/applying
It was a very interesting read, in the context of Python getting a copy-and-patch JIT compiler in the upcoming 3.13 release [1], to understand better the approach.
[1] https://tonybaloney.github.io/posts/python-gets-a-jit.html
Plug for csnakes.. https://tonybaloney.github.io/CSnakes/