Remix.run Logo
liu3hao 3 days ago

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/

The next steps are to create more schematics with Circuitscript as examples to test the limitations of the language and to generate PCB designs with KiCAD. The Circuitscript tool (currently only the desktop cli tool) is able to generate KiCAD netlists and this can be imported into PCBnew.

The motivation for creating Circuitscript is to describe schematics in terms of code rather than graphical UIs after using different CAD packages extensively (Allegro, Altium, KiCAD) in the past. I 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 (because this is also part of the design process) and to encourage code reuse.

Please check it out and I look forward to your feedback, especially from electronics designers/hobbyists. Thanks!

foft 3 days ago | parent | next [-]

As a big openscad fan I love the idea of designing circuits with code.

I do wonder though about designing circuits vs designing schematics. I see you have ‘wire down 100’ making it a more visual language than defining the nets. Be interesting to separate the schematic layout from the nets, so rule base schematic layout can then be applied.

liu3hao 2 days ago | parent [-]

You can actually skip all the wire commands and still generate a valid netlist, however the schematic might be a bit hard to decipher if there are many components!

I did explore automated layout algorithms for components in the schematics, however the readability and flow of the schematics might not be ideal, depending on what the algorithm prioritizes.

In the end, I realized that the actual layout and arrangement of the schematic itself was critical in the overall understanding. That was when I decided to add the "wire" command and give more control back to the schematic designer.

In the future, I do plan to add some automated way to generate these "wire" commands for automated layout. If the designer ever chooses to edit this automated schematic layout, he would be able to edit the wire commands for finer control.

In the end, I do believe that the visual part of the schematic plays an important role in understanding it. I, too, have spent hours puzzling/being misled by poorly drawn/disorganized schematics. Especially during troubleshooting or creating an updated revision, having a good understanding of the schematic saves time.

One of the aims of Circuitscript is to make the visual part easier, so at least more time can be spent thinking and organizing the schematic itself.

jsd1982 3 days ago | parent | prev | next [-]

I love this idea! Just wanted to send a note of encouragement. Keep at it!

liu3hao 3 days ago | parent [-]

Thank you very much!

random_ind_dude a day ago | parent | prev | next [-]

I think it may be a good idea to either enable auto-save or remind the user that there are unsaved changes before navigating away from the page.

liu3hao 11 hours ago | parent [-]

Yes, that's true, right now you have to manually press on the Save button. I will update the online editor to auto-save after some time and probably also prompt the user to save before navigating as well too. Thank you very much for your feedback!

healthymomo 3 days ago | parent | prev [-]

Hey I am a embedded sw / hw engineer. looks pretty neat. would love to talk to you about it

liu3hao 3 days ago | parent [-]

Sure, let's talk! Please contact me at my email in my profile. Thanks!