Why use dictionaries rather than an interface description language like Protocol Buffers? #396
Replies: 1 comment
-
Interface description languages like Protocol Buffers are strongly typed: they formally specify a data exchange format that has to be written down and maintained, but brings benefits like versioning or breaking-change detection. In Upkie's software, on the other hand, we follow a weakly-typed, self-describing approach that is better suited to prototyping with rapidly-changing APIs: the spec is in the code. If an agent and spine communicate with incompatible/incomplete actions/observations, execution will break, begging for developers to fix it. Upkie's code is primarily designed for prototyping: it strives to eliminate intermediaries when it can, and keep a low barrier of entry. Python bindings bring the benefits of typing and are a good choice in production contexts, but like interface description languages, they also add overhead in terms of developer training, bookkeeping code and compilation time. Upkie's software rather goes for a crash-early approach: fast changes, fast blunders (interface errors raise exceptions that end execution), fast fixes (know immediately when an error was introduced). |
Beta Was this translation helpful? Give feedback.
-
Why use dictionaries rather than an interface description language like Protocol Buffers?
Beta Was this translation helpful? Give feedback.
All reactions