Motivations
Circuitscript exists to let you describe schematics in code instead of clicking around a graphical UI. A few reasons that follow well from this:
- Spend more time thinking about the schematic, and less time fiddling with a GUI.
- Track changes and review diffs with real version control, since the schematic is just text.
- Generate schematics you can hand off to layout programs like KiCad.
Target audience
Circuitscript is for electronics engineers and hobbyists who want to explore a code-based way to describe circuits instead of graphical user interfaces (GUIs). It is another tool in the toolbelt, not a replacement for existing GUI-based schematic capture tools.
Why a new language?
The original aim was to write schematics in code so I could focus on thinking about the circuit rather than fiddling with a GUI. The closest thing I found was skidl, a Python library with a lot of great ideas. But because it extends Python, the code for a schematic always felt clunky to me.
A language designed purely for describing circuits would be better, because it gets to define exactly the concepts and commands the problem needs. There is a known risk here: the creator of skidl has mentioned that earlier attempts at circuit-specific languages tended to fail precisely because they invented something new instead of building on a popular existing language. Circuitscript tries to avoid that trap by borrowing Python's readability and feel wherever it can.
Language goals
- Easy to reason about, write, and read — with readability inspired by Python.
- Let the designer control how the generated schematic is laid out and displayed (within limits).
- Encourage code reuse.
Why schematic layout is deliberate, not automatic
Circuitscript has no auto-layout feature. Every wire and component position comes from what you write; there is no solver placing things for you.
In software, the order and grouping of statements inside a function carries meaning. Related lines kept adjacent tell the reader they belong together, and a function that reads top-to-bottom as a sequence of steps communicates intent. Two functions with identical logic but different arrangement may not be equally understandable.
Schematic layout works the same way, just in two dimensions instead of one. Where a component sits, which direction a signal flows, how a power rail is drawn, which parts are grouped together: all of it encodes signal flow, power/ground convention, and functional grouping, information the netlist alone doesn't carry. A schematic that's automatically laid out can ignore all of that, and the result is hard to follow.
Circuitscript's turtle-style routing (wire down 100 right 100, add res(100), to gnd) puts that judgment back in your hands. You describe connections and arrangement together the way you'd write code.
Roadmap
What Circuitscript can do today:
- ✅ Schematic output (SVG, PDF) for visualization.
- ✅ KiCad netlist output for pcbnew (KiCad's board layout tool) integration.
- ✅ BOM mapping and generation (CSV).
Planned:
- SPICE integration.
- Testable and queryable circuits.
- Footprint generation for pcbnew.
Inspiration
Circuitscript is inspired by the following projects:
Open-source
Circuitscript is MIT licensed and will always remain free to use!