1 pointby cykim88116 hours ago2 comments
  • cykim88116 hours ago
    A CPython 3.11 bytecode VM that runs entirely inside PostgreSQL. No extensions, no foreign languages — just PL/pgSQL stored procedures and tables. Every Python object is a row in a table. Type slots (tp_call, nb_add, sq_length, etc.) are stored procedure references. The interpreter loop is a single PL/pgSQL function that reads 2-byte wordcode instructions and dispatches to per-opcode handler functions. It supports int, float, str, list, dict, set, tuple, classes with inheritance, closures, try/except, and 80+ opcodes. There are 87 test suites covering these. The Python-side script (pgthon.py) just compiles source to CPython 3.11 bytecode and sends it over — the actual execution happens in SQL.
  • 5fc3b46 hours ago
    [dead]