Barr Group

barrgroup.com · Company blog · on HN since 2015

Barr Group, an embedded systems consultancy, publishes articles on state machines, embedded C, coding standards and firmware design.

What HN saysHN commenters cite it for embedded C coding standards and state machine material, including Michael Barr's work. One links a post on AI agents finishing a novel.
19HN people shared it
9linked it in comments
13stories submitted
155story points
8 months agolast shared
2015people per year2026

Most-shared posts

  1. 1
    Introduction to Hierarchical State Machines (2016)
    4 people · 5 points · first shared 2020 · discussion on HN
  2. 2
    State Machines for Event Driven Systems (2016)
    2 people · 1 points · first shared 2020 · discussion on HN
  3. 3
    Introduction to Hierarchical State Machines
    1 people · 134 points · first shared 2017 · 12 comments on HN
  4. 4
    The Best Books about Embedded Systems Design
    1 people · 3 points · first shared 2015 · discussion on HN
  5. 5
    CRC Implementation Code in C/C++
    1 people · 3 points · first shared 2018 · discussion on HN
  6. 6
    How Network Processors Work
    1 people · 2 points · first shared 2023 · discussion on HN
  7. 7
  8. 8
  9. 9
  10. 10
    Mutexes and Semaphores Demystified
    1 people · 1 points · first shared 2017 · discussion on HN
  11. 11
    Embedded C Coding Standard
    1 people · 1 points · first shared 2023 · discussion on HN
  12. 12
    C Volatile Keyword
    1 people · first shared 2017
  13. 13
    Killer apps
    1 people · first shared 2015
  14. 14
    Case study patriot missile defects.pdf
    1 people · first shared 2021
  15. 15
    Barr c coding standard 2018.pdf
    1 people · first shared 2023

What HN people wrote when they linked it

FirmwareBurner · 2023-11-07
Might I suggest better alternatives as more pleasant alternatives to the stuffy MISRA C book: - "Embedded C Coding Standard" by Michael Barr[1], CTO and co-founder of Barr Group, the guy who inspected the ECU code and testified in Toyota's unintended acceleration lawsuit. Good stuff. - "Embedded System development Coding Reference guide" written by the Software Reliability Enhancement Center of Japan [2], which covers and expands on MISRA C and more. It's a joy in examples, explanations and eye-pleasing aesthetic. I love it. [1] https://barrgroup.com/sites/default/files/barr_c_coding_standard_2018.… [2] https://www.ipa.go.jp/publish/qv6pgp00000011mh-att/000065271.pdf
sokoloff · 2021-05-23
That was done via Airworthiness Directive (a mandatory prod patch for aviation), not by original engineering design intent. Similar story with the Patriot missile defense battery. * - https://www.federalregister.gov/documents/2020/03/23/2020-06092/airwor… * - https://barrgroup.com/sites/default/files/case-study-patriot-missile-d…
JohnHaugeland · 2021-04-06
> I'm mostly concerned about visualization Almost all of the finite state machines use the same underlying graphing tool, "GraphViz," to do their rendering. It sounds like you might want that. There is an emscripten transcompile for the web called viz.js. . > if you have actions/guards that don't appear on the visualization Actions do appear on the visualization. I'm still not sure what you mean by guards. . > imilarly, by recursion I meant putting states inside states (from a behavior perspective you would call them compound states); Both PlantUML and XState supports that. Parallel states [1] are compound states with multiple distinct regions It looks like one of XState or PlantUML tried to rename Heirarchical Orthogonal State Regions, and the other copied the first one. . What you're calling "recursion" is called a Heirarchical State Machine. It appears that XState uses the regular name for these: https://xstate.js.org/docs/guides/hierarchical.html External reference: https://barrgroup.com/embedded-systems/how-to/introduction-hierarchica… . What you're calling Parallel States is properly called an Orthogonal Region. It's problematic to call these parallel for exactly the following statement, where you suggest that this "doesn't necessarily imply threading;" this wrong name that XState and PlantUML has used has confused you. *All state machines are by definition single threaded single context. This may not and will never be implemented…
RossBencina · 2020-04-02
To these links I would also add Miro Samek's book "Practical UML Statecharts in C/C++," which covers details of implementing (hierarchical) statecharts. The book includes a chapter that analyses different ways of encoding extended state machines (Miro concludes a function pointer, with one event handler function per state is the best for C/C++. I don't think this is the encoding that the linked Rust article uses). A simple algorithm for implementing HSMs is described. A large portion of the book is devoted to what you might call "UML Statecharts -- The Good Parts," the parts of the UML statecharts spec that are easy to implement in a real-time setting, and idioms/patterns to achieve similar results as the parts of the spec that are not easy to implement. Some of Miro's online writings: https://barrgroup.com/embedded-systems/how-to/state-machines-event-dri… https://barrgroup.com/embedded-systems/how-to/introduction-hierarchica… https://www.drdobbs.com/who-moved-my-state/184401643 [Edit: clarity]
rramadass · 2026-03-18
How he wrote it: AI Agent Teams Finished My Sci-Fi Novel in 12 Hours - https://barrgroup.com/software-expert-witness/blog/ai-agents-finished-…
HorizonXP · 2017-03-26
You're correct. (https://barrgroup.com/Embedded-Systems/How-To/C-Volatile-Keyword) But again, you're telling the compiler that you know what you're doing, and to not perform its normal optimization. I'm not well-versed in compiler design, but I think that's the tradeoff you have to make between trusting the user's design choices, or not.
teleclimber · 2017-03-18
Thanks for the reply. My comment was in reference to the Visual Basic Calculator program described here: (perhaps "VBScript" was not accurate) https://barrgroup.com/Embedded-Systems/How-To/State-Machines-Event-Dri… That VB calculator is shown as an example of "The Problem" with event driven programming, but I just see it as an example of why poorly designed programs are hard to reason about and buggy. I did not see the coffeescript / Python calculator.
ArkyBeagle · 2015-04-28
Right. No smoking gun. There were multiple scenarios described in which such a failure was plausible. The story is nowhere as cut and dried as in the Therac or the Arianne cases. Here are his Embedded Systems Conference slides: http://www.barrgroup.com/killer-apps/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close