2 ms·
> KiCad has a scripting engine for automating boring repetitive tasks - it's Python. This is actually a giant sore point for me as a programmer. Let me ask th
by bsder 6y ago
> KiCad has a scripting engine for automating boring repetitive tasks - it's Python.
This is actually a giant sore point for me as a programmer. Let me ask the HN collective for advice:
How do you set up an interface for a scripting language in a larger application?
Most applications like KiCad or Blender have their own Python baked very deeply into the software architecture. It works ... mostly ... but it seems to me like its suboptimal
1) you have to jump through an enormous amount of hoops to try to connect your "normal" development environment to the "captive" scripting engine.
2) controlling UI elements from the scripting language is a real PITA
3) you don't have a choice of scripting language
It seems like there ought to be a better way to do this, but I always wind up sort of landing on "open a socket and talk RPC" which has it's own failure modes (for example: how do you expose everything (including the UI) and how do you handle concurrent access).
What is the solution to this?
- bmn__ 6y agoI'm also interested in this topic and have surveyed the existing and am sad to report there is no excellent and universal solution, merely good enough ones. Adopting DBus goes a long way because it gives you introspection, GUI control and concurrent access for free. The way forward seems to be to stick to a single blessed extension language and try to reduce the pain points when integrating with IDE, debuggers etc.