Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from compiler import compile_codexbyte | |
| from codexbyte_vm import CodexByteVM | |
| vm = CodexByteVM() | |
| def run_codexbyte(source: str): | |
| try: | |
| program = compile_codexbyte(source.strip().splitlines()) | |
| ledger = vm.run(program) | |
| return { | |
| "registers": vm.reg, | |
| "memory": vm.mem, | |
| "omega_ledger": ledger | |
| } | |
| except Exception as e: | |
| return {"error": str(e)} | |
| gr.Interface( | |
| fn=run_codexbyte, | |
| inputs=gr.Textbox( | |
| lines=16, | |
| label="CodexByte Program", | |
| placeholder="LOAD_IMM 0 1000\nLOAD_MEM 1 0x20\nCMP 1 0\nJZ 10\nHALT" | |
| ), | |
| outputs=gr.JSON(label="Ω-State Proof"), | |
| title="CodexByte ΩΞ Runtime", | |
| description="Bytecode execution is enforcement. Execution trace is proof." | |
| ).launch() |