by liu3hao · 1y ago · 0 comments
The main motivation for creating Circuitscript is to describe schematics in terms of code rather than graphical UIs. This makes it easier to track changes and version control with a text based schematic. I have used different CAD packages extensively (Allegro, Altium, KiCAD) in the past and wanted to spend more time thinking about the schematic design itself rather than fiddling around with GUIs.
The main language goals are to be easy to write and reason, generated graphical schematics should be displayed according to how the designer wishes so and to encourage code reuse.
There are a few others in this space, often using Python as their base.
I was inspired by skidl (https://devbisme.github.io/skidl/)'s python usage and did explore that direction. However, it felt strange and clunky to try and fit the circuit drawing concepts I had in mind into python via a domain specific language (DSL). The user would require a decent understanding of python and the DSL to create circuits. This would complicate my original aim of creating a language/tool that allows electronics engineers to focus on the circuits that they would like to design.
By creating a new language, I was not limited by python's syntax/grammar. I could craft the language closer to what was needed for schematic design and maintain simplicity. Overall, it was a great learning experience on language design and also using ANTLR for the implementation.