Skip to content

Q2Py Forge

From q to Python. See every step.

Translate supported Q/kdb+ expressions into Python, inspect the compiler pipeline, and validate results against authored expectations.

Translator preview

2*3+4

q.mul(q.long(2), q.add(q.long(3), q.long(4)))

  1. Lex
  2. Parse
  3. Semantic
  4. IR
  5. Codegen
  6. Compile

Execute and Compare stay not run until Validate.

How it works

  1. Step 1

    Write or load Q

    Type a supported expression, open the example, or upload a .q file.

  2. Step 2

    Inspect the translation

    Read the generated Python and the outcome of each compiler stage.

  3. Step 3

    Validate the result

    Run the program and compare it with an authored expectation when one exists.

What you get

  • Each stage is visible

    Lex, parse, semantic analysis, IR, codegen, and compile report their own outcome.

  • Python you can read

    Supported translations can be copied or downloaded from Studio.

  • Checks you can trace

    Validate compares a corpus case with the value or signal written on that record.

  • Limits stay explicit

    Unsupported syntax stops with a diagnostic. Skipped stages stay marked not run.

A supported example

Q has no operator precedence, so 2*3+4 is 2*(3+4). This is the Python the current translator emits. It is not an execution result and not a live q check.

Open in Studio
Q source
2*3+4
Generated Python
import q2py.runtime as q

def q2py_program():
    env = q.Env()
    _v1 = q.mul(q.long(2), q.add(q.long(3), q.long(4)))
    return _v1

Measured against authored expectations

Holdout agreement is a comparison with values and signals written for this corpus. Docs describe the supported subset, the sandbox boundary, and what this build does not claim.

Built by Himaja Paturi

An independent engineering project for Q/kdb+ to Python translation, compiler inspection, and systematic checks of generated code.

Connect on LinkedIn