HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
niekbouman
commelec-api
C++2015–2015
niekbouman / commelec-api

commelec-api

API for the Commelec Smart Grid control platform

2Distinct people
3Mentions
0Explicit recommenders
18GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

API for the Commelec Smart Grid control platform

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour3 dated mentions

Observed mentions: 2015-08-15 09:57:16 UTC to 2015-08-15 19:32:08 UTC.

0122015-08-15 09:00:00 UTC to 2015-08-15 10:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsAug 15, 09:002015-08-15 10:00:00 UTC to 2015-08-15 11:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 11:00:00 UTC to 2015-08-15 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 12:00:00 UTC to 2015-08-15 13:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 13:00:00 UTC to 2015-08-15 14:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 14:00:00 UTC to 2015-08-15 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsAug 15, 14:002015-08-15 15:00:00 UTC to 2015-08-15 16:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 16:00:00 UTC to 2015-08-15 17:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 17:00:00 UTC to 2015-08-15 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 18:00:00 UTC to 2015-08-15 19:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-15 19:00:00 UTC to 2015-08-15 20:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsAug 15, 19:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Aug 15, 09:002015-08-15 09:00:00 UTC2015-08-15 10:00:00 UTC110
Aug 15, 10:002015-08-15 10:00:00 UTC2015-08-15 11:00:00 UTC000
Aug 15, 11:002015-08-15 11:00:00 UTC2015-08-15 12:00:00 UTC000
Aug 15, 12:002015-08-15 12:00:00 UTC2015-08-15 13:00:00 UTC000
Aug 15, 13:002015-08-15 13:00:00 UTC2015-08-15 14:00:00 UTC000
Aug 15, 14:002015-08-15 14:00:00 UTC2015-08-15 15:00:00 UTC000
Aug 15, 15:002015-08-15 15:00:00 UTC2015-08-15 16:00:00 UTC000
Aug 15, 16:002015-08-15 16:00:00 UTC2015-08-15 17:00:00 UTC000
Aug 15, 17:002015-08-15 17:00:00 UTC2015-08-15 18:00:00 UTC000
Aug 15, 18:002015-08-15 18:00:00 UTC2015-08-15 19:00:00 UTC000
Aug 15, 19:002015-08-15 19:00:00 UTC2015-08-15 20:00:00 UTC202

What Hacker News says

3 sources
>> the advantage of the approach taken in this project (essentially, sending an >> abstract syntax tree encoded in capnproto) over just sending a string, is that >> there is no parsing-step needed at the receiver, which saves time. (It is a >> real-time system) even though cap'n'proto advertises itself as a "zero copy" serialization scheme that doesn't necessarily need to copy the data when reading it, it still needs to "parse" the incoming message. and the way your interpreter is implemented I think you still need to switch()/recurse over everything in the proto tree. So I think the main difference here would be switching() over an enum vs throwing an extra strncmp/hashmap access in there when loading the expression from the incoming network buffer. I think cutting that one strncmp per symbol could be a perfomance upside, bu
Read the rest
t I reckon this would be _tiny_ compared to all the networking and evaluation overhead (think low microseconds for a few compares on strings that all fit within the SSO). But might be an interesting thing to benchmark nonetheless, maybe even against another solution that goes all the way and implements a proper micro vm so it can execute "bytecode" directly from the incoming networking buffer without any intermediate at all. EDIT / side note: just had another look and saw that you are actually storing some symbols as strings in the capnprot messages and then do a lookup in the eval loop, too --- and the symbol lookup is implemented in O(N) by doing a linear scan over the symbol list and comparing the subject with each possible candidate here -- if you care about speed/micro-optimizing I think you can improve this to O(1) or at least logn using a hashmap/multiset -> https://github.com/niekbouman/commelec-api/blob/master/comme... another thing if you want to microoptmize: you should try to pass stuff by reference instead of copy in your eval loop wherever possible -- removing as many mallocs() as possible from the inner interpreter eval loop should be one of the most low hanging fruits. what stuck out to me was esp. your use of the auto keyword in the eval code -- some thoughts regarding that: - the "auto" keyword does not automatically take a reference. a plain "auto" may create a copy. use "auto&" or "const auto&" to take a reference - esp. in the new range based for loops: in the places where you are currently using (for auto item : collection) you are performing a copy of all the items while iterating -- for (const auto& item : collection) will eliminate those copies EDIT2: Skimmed your paper and saw it included some benchmarks regarding message size. However you are benchmarking your cap'n'proto solution ONLY against MathML, an XML encoded representation (lol). So I tried one example from your paper -- am I missing something here? Expression: "P-10+q^2" - Your capnproto encoding with packing: 82bytes (value from your paper) - Your capnproto encoding without packing: 280 bytes (value from your paper, actually larger than XML...) - mathml (xml) without packing: 196 bytes (value from your paper) - mathml (xml) without packing: 164 bytes (value from your paper) - string encoding of the same expression ("P-10+q^2"): 9 bytes [ Hope I am not coming across as too negative, but since you put it in a paper and published it I think it is fair to do some peer review ]
In Show HN: Serializable Math Expressions Using Cap'n Proto
Hi Paul/Paula, The software is part of a smart (electricity) grid control platform. I agree that on the github project there is also quite some code that is unrelated to the title of this Show HN post. The particular thing I wanted to highlight is explained concretely here: https://github.com/niekbouman/commelec-api/blob/master/docs/... The application of the code is a networked control system, where, roughly speaking, many resources send messages to a central controller. In the light of this "many-to-one" topology, the advantage of the approach taken in this project (essentially, sending an abstract syntax tree encoded in capnproto) over just sending a string, is that there is no parsing-step needed at the receiver, which saves time. (It is a real-time system) The server program (I assume that you're referring to daemon.cpp), was added
Read the rest
as a bridge between the more-powerful capnproto-based message format and a less-flexible but easier-to-use-for-non-experts (JSON-based) interface. However, what happens in this daemon should not be viewed as part of this Show HN topic. For more details about the project, you could have a look at the following paper (open access) https://infoscience.epfl.ch/record/210555?ln=en
In Show HN: Serializable Math Expressions Using Cap'n Proto

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.