• 3 Posts
  • 29 Comments
Joined 3 years ago
cake
Cake day: August 22nd, 2023

help-circle







  • ESPHome is by-and-large a build system to build bespoke C++ programs. The python files you’re seeing describe how that yaml file maps to the C++ files.

    The core idea is that end users (including people managing custom sensors) as much as possible only have to interact with the yaml file. The yaml file lists what components you want to run and their configurations. A component is in general a subdirectory of esphome/esphome and is intended to be independent of other components.

    Those github references in the yaml pull in external components from the community. It’s roughly equivalent to dropping another folder into the source tree (noting again that you shouldn’t usually need to have the source tree at all).

    Running esphome copies all used components into a separate source tree, with substitutions and variables set according to the yaml configuration (defined by the component’s python files) and builds a bespoke binary for you that will run on your device.

    If you want to include code that’s not already an ESPHome component, you will need to make it into one. You can do this in place in the source tree or by creating an external component yourself. You will want to use an existing component as a template for this. Have a look for if ESPHome itself or a community component already exists first because it will make your life so much easier.





  • Debian votes using the Schulze Method, which is a Condorcet method..

    Condorcet methods attempt to answer the question “who would win if we asked everyone to vote on every pair of candidates”. Most of the variations between methods deal vary only where there are cyclic preferences e.g. people vote B over A, A over C and C over B.

    They’re broadly considered the fairest voting systems available and they permit a candidate that everyone thinks is okay to win over polarising candidates (unlike first past the post and IRV, but like approval voting).

    Back to the numbers, the big table is the reconstruction of the pairwise votes (people actually vote by ranking candidates but the ordering is taken to show your pairwise preferences)

    Below that is the Schulze process steps being carried out. At the bottom the “Schwartz set” is the set of top, cyclic candidates. There is no cycle so there is only one candidate remaining and therefore a Condorcet candidate wins (the one people in general vote over everyone else).







  • Certainly for all. I was mostly thinking in terms of e.g. languages that (can) compile to LLVM, since you have the intermediate form already defined. But then languages layer quite a lot on top of LLVM in terms of abstractions and safety constraints that make it probably a bad intermediary even for that subset. Even just for one language, there must be something funuseful that can be done just by viewing the same code with different syntaxes.


  • I fundamentally disagree with the idea that “programming sucks” but there are some neat thoughts and tools in there.

    This bit in particular:

    We don’t even have to give up code! The GUI version of a program could merely be one of several human-editable representations. Just as some people love text-based interfaces to their operating systems, some people will continue to enjoy code-based interfaces to software editing. It just doesn’t have to be the default—or the only—option anymore.

    I’ve often thought about the idea that to an extent a programming syntax does not have to be married to a language. We could potentially have editors and syntaxes designed so that each developer can interact with the code in the syntax they’re most comfortable with, independent of the language. I don’t know how realisable this is, it may be underestimating how tightly coupled syntax and language is.

    I’m not a big fan of graphical programming in general, but there are times when I would like it just for a single function or class, for signal processing or control systems or state machines. I usually think of this in terms of editor plugins or external code gen tools rather than whole environments. Although every code gen tool I’ve used to date sucks.