← All projects
Project record10 mentions
Originally shared on Hacker News

Circuitscript

A Python-inspired language for describing electronic schematics as code rather than clicking around graphical CAD tools, with a browser-based Bench IDE for trying it out. Recent additions include initial ngspice netlist export so a Circuitscript design can be simulated from the same source file, and bus support for less tedious connection of wide parallel lines like I2C and SPI. Nested for-loops were used to generate and test a 161-LED charlieplexed array without hand copy-pasting LEDs and connections.

Last shared For Electronics designers and hobbyists frustrated with graphical schematic CAD tools, including KiCad users looking to convert existing designs.
01 / The problem

What it addresses

Designing schematics by clicking around graphical CAD tools (KiCad, Allegro, Altium) is tedious; the project lets designers express circuit intent as code that is clear and reviewable in text.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Circuitscript

    A Python-inspired language for describing electronic schematics as code rather than clicking around graphical CAD tools, with a browser-based Bench IDE for trying it out. Recent additions include initial ngspice netlist export so a Circuitscript design can be simulated from the same source file, and bus support for less tedious connection of wide parallel lines like I2C and SPI. Nested for-loops were used to generate and test a 161-LED charlieplexed array without hand copy-pasting LEDs and connections.

    Problem: Designing schematics by clicking around graphical CAD tools (KiCad, Allegro, Altium) is tedious; the project lets designers express circuit intent as code that is clear and reviewable in text.

    Audience: Electronics designers and hobbyists frustrated with graphical schematic CAD tools, including KiCad users looking to convert existing designs.

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    still making progress on Circuitscript, a Python-inspired language for describing electronic schematics: https://circuitscript.net/. You can try it in the browser via the Bench IDE: https://bench.circuitscript.net/
  2. Circuitscript

    Circuitscript is a Python-based language for describing electronic schematics as code instead of through graphical CAD UIs, making design intentions explicit and reviewable. It ships with a basic online IDE (the Bench) for trying the language. Recent work added more ERC rules (pin type compatibility checks), initial net class support, and backslash line continuation like Python. The author used it to complete a 161-LED charlieplexed array design driven by nested for-loops, which is currently in production.

    Problem: Graphical schematic CAD packages (Allegro, Altium, KiCad) force designers to fiddle with GUIs rather than think about the design itself; Circuitscript lets schematics be written as code so design intentions are explicit and reviewable.

    Audience: Electronics designers frustrated with graphical schematic tools; the author also invites KiCad users who want to convert their designs

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Hi HN, I am making progress working on Circuitscript, a language based on python to describe electronic schematics: https://circuitscript.net/. A basic IDE (called the Bench) to try Circuitscript is available online: https://bench.circuitscript.net/
  3. CircuitScript

    CircuitScript is a Python-like language for describing electronic schematics as code, usable through an online IDE. Recent additions include export to the KiCad .kicad_sch format (multi-sheet designs exported as one file per sheet) and updated KiCad-like pin types to better support ERC rules, including a new power_reference pin type for GND symbols.

    Problem: Graphical schematic CAD tools require fiddling with GUIs, leaving less time to think about the schematic design itself; code makes design intentions explicit and reviewable.

    Audience: Circuit designers and engineers frustrated with graphical schematic CAD tools (Allegro, Altium, KiCAD).

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Having some progress on CircuitScript, a python like language for describing electronic schematics as code: https://circuitscript.net. Try the language through the online IDE at https://bench.circuitscript.net
  4. Circuitscript

    Circuitscript is a Python-based language for describing electronic schematics as code instead of through graphical CAD UIs. It ships with an online IDE called the Bench for trying it out. Recent additions include support for KiCad schematic libraries, which are converted into Circuitscript format and can be imported directly into Circuitscript code, with improved import functionality and caching to handle the large number of components.

    Problem: Graphical schematic CAD packages (Allegro, Altium, KiCAD) require fiddling with GUIs; the author wanted to describe schematics in code to spend more time thinking about the design itself.

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Hi HN, I am still working on Circuitscript, a language based on python to describe electronic schematics: https://circuitscript.net/. A basic IDE (called the Bench) to try Circuitscript is available online: https://bench.circuitscript.net/
  5. Circuitscript

    A Python-based language for describing electronic schematics as code, with a basic online IDE called the Bench for trying it in the browser. Schematics written in Circuitscript can be exported as netlists for PCB tools such as KiCad pcbnew; the author validated the workflow by designing a working USB-UART board with it.

    Problem: Graphical schematic CAD packages (Allegro, Altium, KiCAD) get in the way of the design; the author wanted to describe schematics in code to spend more time thinking about the schematic design itself rather than fiddling with GUIs, and text makes diffing complex circuit changes easier since it captures intent better.

    Audience: Electronics designers and hobbyists

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Hi HN, I am working on Circuitscript, a language based on python to describe electronic schematics: https://circuitscript.net/. A basic IDE (called the Bench) to try Circuitscript is available online: https://bench.circuitscript.net/
  6. Circuitscript

    Circuitscript is a Python-based language for describing electronic schematics as code rather than through graphical CAD UIs. It ships with the Bench, an online IDE for trying the language. Recent features include automatic stable refdes annotations, parameter assignment rules for easy part number assignment, and ERC rules, which support turning a schematic into a usable BOM and PCB layout.

    Problem: Graphical schematic CAD packages (Allegro, Altium, KiCAD) force time spent fiddling with GUIs; the author wanted to describe schematics in code and spend more time thinking about the schematic design itself.

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Hi HN, I am working on Circuitscript, a language based on python to describe electronic schematics: https://circuitscript.net/. A basic IDE (called the Bench) to try Circuitscript is available online: https://bench.circuitscript.net/
  7. Circuitscript

    A Python-based language for describing electronic schematics as code instead of using graphical schematic-capture UIs. Includes the Bench, a web-based IDE for trying Circuitscript online. It generates graphical schematics from code, supports code reuse, and can export netlists to PCB tools like pcbnew; the author produced the first PCB designed entirely with Circuitscript.

    Problem: Graphical schematic CAD packages require fiddling with GUIs; the author wanted to describe schematics in code to spend more time thinking about the design itself.

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    I am working on Circuitscript, a language based on python to describe electronic schematics: https://circuitscript.net/. A basic IDE (called the Bench) to try Circuitscript is available online: https://bench.circuitscript.net/
  8. Circuitscript

    Circuitscript is a Python-based language for describing electronic schematics and circuits as code rather than through graphical CAD UIs. It includes a desktop CLI tool that generates KiCAD netlists importable into PCBnew, and the Bench, a web IDE for trying Circuitscript online. Language goals are ease of writing and reasoning, designer-controlled graphical layout (via wire commands) since schematic layout is part of the design process, and code reuse. Planned next steps include building more example schematics to test the language and generating PCB designs with KiCAD.

    Problem: Graphical schematic-capture CAD packages (Allegro, Altium, KiCAD) require fiddling with GUIs; the author wanted to describe schematics in code and spend more time thinking about the schematic design itself.

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Hi HN, I am working on Circuitscript, a language based on python to describe electronic schematics/circuits: https://circuitscript.net/ Recently, I have released a simple IDE (called the Bench) to try Circuitscript online: https://bench.circuitscript.net/
  9. Circuitscript

    A Python-based language for describing electronic schematics and circuits as code rather than through graphical CAD UIs. It generates graphical schematics laid out according to the designer's wishes and encourages code reuse; documentation improvements and an online IDE are in progress.

    Problem: Designers spend too much time fiddling with graphical CAD GUIs instead of thinking about the schematic design itself.

    Audience: Electronics designers who currently work with graphical CAD packages (Allegro, Altium, KiCAD)

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Working on Circuitscript, a language based on python to describe electronic schematics/circuits: https://circuitscript.net/
  10. Circuitscript

    A programming language for describing electronic schematics and circuits as text code instead of drawing them in graphical UIs. Text-based schematics make it easier to track changes and use version control, generated graphical schematics are displayed according to how the designer wishes, and the language aims to be easy to write and reason about while encouraging code reuse.

    Problem: Describing schematics through graphical CAD UIs makes it hard to track changes and version control, and time gets spent fiddling with GUIs instead of thinking about the schematic design itself.

    Posted by @liu3hao · Original source ↗

    Source text · @liu3hao · · Source ↗

    Working on Circuitscript, a language based on python to describe electronic schematics/circuits: https://circuitscript.net/