RISC-V Emulator in ClickHouse SQL: Running Programs Inside a Database
2025-06-04
This project builds a RISC-V emulator using ClickHouse SQL, making ClickHouse Turing complete. The emulator leverages ClickHouse's materialized views and Redis for memory, simulating CPU instruction execution through a series of SQL commands. While current performance is hampered by a bug in ClickHouse's KV storage engine, it can already run simple RISC-V programs and supports features like printing, file operations, and network communication. This offers a novel approach to running programs directly within a database, but performance bottlenecks need to be addressed.
Development