HNHacker News
TopNewBestAskShowJobs

henrikeh

807 karma · joined April 20, 2012

Contact: heh@optoceutics.com
submissionscomments
henrikeh··on Implications of Rewriting a Browser Component in Rust
>> [...] solves the same problems without a runtime, and about 3 times the performance.

I think you should look more into Ada. The only "runtime" is for the exception handling and bounds checking, both of which can be turned off if needed.

And I don't know where you got that "3 times" figure from? Do you have an example you are referring to?

henrikeh··on Formally Specifying UIs (2018)
You are right. That is the title :-)
henrikeh··on Formally Specifying UIs (2018)
Since you say “commercial” software I’m confused. Would that exclude medical software, aerospace software?

If what you are getting at is that it is not widely used/not used in anything “successful” and thus just a pipe dream, then I understand your concern. But that doesn’t mean it can’t be a useful strategy for some fields nor that it couldn’t produce more reliable systems.

henrikeh··on Formally Specifying UIs (2018)
Not OP, but I’m not really getting what you are asking for?
henrikeh··on Formally Specifying UIs (2018)
I recently read through “Designing the user interface with statecharts” by Horrocks. The arguments for are quite compelling, not just in terms of specifying, but also in terms of “designing”.

One illuminating example was a calculator application which had numerous errors and crashes which stemmed from intricacies of the UI implementation. By designing it as a statechart transitions are made visible and relationships are clear. The book provides three more examples.

In addition to the posted blog post, there are two more concepts in statecharts that I think are important: history and concurrency. They are not easy to explain in this comment, but the gist is that “history” allows for a simpler expression of returning to a previous state and “concurrency” formalizes the behavior of having concurrent states.

I’d recommend anyone to take a look at the book and I’d especially recommended to anyone who is a little skeptical of the idea of statecharts. I think the biggest argument against statecharts is that it requires you to specify your actual design, instead of just hacking on the code.

henrikeh··on Amazon cargo plane crashes in Texas
It is not about tools. It is about culture and process. Look at something like how SQLite for a real example of living up to the requirements of aviation software: 100 % branch coverage, extensive testing, multiple independent platforms in the test suite etc etc.

You don’t need anything fancy – but you do need to understand your requirements and thoroughly simulate and verify the intended behavior.

henrikeh··on FindChips – Get instant insight into any electronic component
>> But that's a different issue of a manufacturer not conforming to the spec they've published for their product. Same as a carabiner failing at a load of 100kg when it's rated for 500kg.

Package names are, in some fashion, marketing and branding. The manufacturers publish their own specs and do adhere to them. There are also standards (mentioned in other comments), but they are typically more general.

I’m not saying this is ideal – but that is simply the reality.

henrikeh··on FindChips – Get instant insight into any electronic component
An appendix.

A lot of good stuff has begun to happen in this regard. At least KiCad has a large and pretty decent quality collection of footprints; I think other tools are making similar efforts.

However, I wish they would make it easy to adjust these footprints or make derivatives of them, without having to essentially redraw them.

For a looong time I’ve wanted to apply geometric constraint solving to drawing footprints. This would allow for having a base footprint which defines the constraints and then parameter files could introduce the specific dimensions needed. I’ve been working on it at https://github.com/henrikh/footwork-ecad and the parts are there, but I’d love to collaborate on it with someone :-)

henrikeh··on FindChips – Get instant insight into any electronic component
It might seem wasted, but the reality is that a “standard” footprint does not really make sense. Soldering and assembly is not a perfect craft and it requires hundreds of considerations to methods used, environment of use, desired reliability etc. for example look up the footprint differences for wave soldering compared to hand soldering. For aerospace use reliability is king, for mobile devices space is a premium.

Furthermore, there aren’t really any standards for packages and hence it is difficult to trust foorprints. A TSOP package from one manufacturer manufacturer is not necessarily the same as a TSOP package from another. This is not a hypothetical — I’ve been bitten by this.

There are tools to assist in and automate a lot of this, but since most of the time is spend on other parts of a product it simply isn’t very critical.

henrikeh··on About V, the language Volt is written in
In Ada, procedure and function arguments must be annotated with whether they are “in”, “out”, “in out”. “In” can never be modified, “out” has no initial value and “in out” has both initial value and can be modified.

Overall if you don’t know Ada I’d recommend that you take a look at the features of it. It has very similar design goals as your V.

henrikeh··on A Mini-Introduction to Information Theory
First of all, we have protocol data such as headers and framing which we might never properly get rid of. People might also send uncompressed data. All practical concerns, but for analysis independent (and even uniform) is not wrong, just rough.

Second, you might (will) not be able to completely compress the data. A picture might be worth a thousand words, but they still take out a megabyte or so on disk. That makes for about 1000 bytes per word ;) So the entropy/information of a picture might be very small ("A dog jumping into water"), but we have no chance of truly understanding a general source (reality) and expressing its full machinery.

Think about the difference between JPEG and PNG (or GZIP and a JavaScript minifier). They are designed for completely different assumptions about the source and even receiver. JPEG assumes that the most important part of an image is the human-visual understand; PNG is lossless, but assumes high inter-pixel dependence. GZIP assumes general bytes (I think); JS minification assumes that a there is a more fundamental representation of the source without noise (formatting, comments, reasonable names, dead functions).

henrikeh··on A Mini-Introduction to Information Theory
Ph.d. student in information theory and signal processing here.

It is actually a very reasonable assumption for almost all kinds of data -- given that suitable compression is applied. Data, which is well-compressed, is essentially uniformly random.

When p('a') = p and p('b') = 1 - p, it means that the probability of 'a' and 'b' do not depend on anything. The probabilities must sum to 1, since it is the certain event, so p('a') + p('b') = p('a' + 'b') = p + 1 - p = 1. That is when we assume that only the symbols 'a' and 'b' are possible.

If there was a relationship between 'a' and 'b', say that 'b' always occurs after every 'aaa', then the when we receive 'aaa', we know that the next symbol is 'b' -- always.

So in this case the probability of 'b' has a relationship, a condition on the history, which would be written as p('b' | hist = 'aaa') = 1. A much more useful framework for this is a Markov process the a history/memory of 3. A graph for such a process can be seen here: https://mermaidjs.github.io/mermaid-live-editor/#/view/eyJjb...

Each node is a state and the edges represent the possible outputs. The rul for such a graph is that the probabilities of the "leaving" edges must sum to 1 -- we must of course always leave the current state we are in. Notice that it takes a sequence of 'aaa' to enter node "D", afterwhich we _must_ output a 'b'. Using some matrix formulations it is possible to calculate the probabilities of 'a' and 'b' (the stationary distribution I think it is called).

And to return to the first point, why is independence a reasonable assumption. In the Markov process, in node D, we known that we must always output a 'b'. In terms of information theory, if we receive 'aaa' then the 'b' is given and provides no new information. There we can perfectly predict it and we could also remove it (compress the data), without _losing_ information.

'abaabbaaab'

contains the same information as

'abaabbaaa'

since we _know_ that there must be a 'b'.

I hope that explains why independence is reasonable.

henrikeh··on AdaCore Joins the RISC-V Foundation to Provide C and Ada Compilation Support
Not all of AdaCore’s libraries are in GPL: their drivers are for example in BSD-3: https://github.com/AdaCore/Ada_Drivers_Library/blob/master/R...
henrikeh··on Ask HN: What are your go-to checklists?
Thanks. The idea started since my co-workers each had their own private lists and it sure worked, but I figured that it would be much easier if I could just go to one website and have one solid list.

A bit challenge, I think, is that the current list is overwhelmingly big and it would really benefit from being more digestible/navigable. But there is only so much time in the world...

henrikeh··on Ask HN: What are your go-to checklists?
Thank you! I'm trying to find reasons/explanations behind as many items as possible in order to give more context. In general I'm striving for the list to help informed design, rather than just checking off items :)

If you find something which is unclear or could be better, then please tell.

henrikeh··on Ask HN: What are your go-to checklists?
I made http://pcbchecklist.com

For electronics there are a lot of small things which should be considered in each design. The must-haves are covered by standards and regulation, but there are many many other considerations which makes life easier or catches errors: checklists are an obvious choice.

So to make it easy for myself I bought http://pcbchecklist.com

It is mostly focused on being comprehensive, but every now and then I have some free time to expand on it.

henrikeh··on Embedded Rust Experiments: Is My STM32 MCU Running Fast?
Yes, Cube autogenerates a lot of code and will overwrite things that don’t follow the inserted markers.

The original article even includes an example of using Cube to configure the clocks and then use those configurations together with Rust.

I agree that it isn’t ideal at all and kinda wonky. But more links in the datasheets would be nice.

henrikeh··on Embedded Rust Experiments: Is My STM32 MCU Running Fast?
Vendor tools for STM provide almost exactly what you wish for for the clock diagram.

Example: http://www.emcu.it/STM32clk/STM32clk.html

henrikeh··on Ask HN: How do you get over perfectionism/overthinking in hobby projects?
The datasheet for the components almost always describe the dimensions and often the recommended footprint (landing zone). Depending on the industry different additional standards apply (for example “space grade” have increased focus on reliability; mobile devices on area reduction; etc)

CAD packages ship with or have collections of common footprints, but be aware that there aren’t truly standards and two footprints might be named the same but have quite different dimensions (even within a single manufacturer). It is rare but it happens and thus it is worth checking.

KiCAD has a large repository of common footprint layouts which I believe is of a reasonable quality, but I have never used them myself.

henrikeh··on Ask HN: How do you organize everything you want to do?
The text mentions 2 minutes as the time for “just do it now” tasks.

However, Allen recommends finding a thresholds which fits your situation.

henrikeh··on Show HN: Trilium Notes – Scriptable note-taking application
One feature I’m sorely missing in pretty much all note taking apps is proper citation/reference handling. As in, working with actual bibliography indexes.
henrikeh··on Lessons from Running a Small-Scale Electronics Factory in My Guest Bedroom
Plugging my own thing: It is not a lot, but I have been compiling a design checklist for electronics design since summer.

Right now it is a tool for myself and my work, which puts a priority on being comprehensive; but the licensing is liberal and I’m open to input.

http://pcbchecklist.com

henrikeh··on Safe and Secure Drivers in High-Level Languages [video]
Paying for a compiler isn't really as crazy as it sounds. Companies pay for CI, static analyzers etc. etc. For non-commercial applications it is obviously different.*

Yet, I'm genuinely curious, why isn't GCC up to snuff?

* Edit: Which of course limits general adoption.

henrikeh··on Safe and Secure Drivers in High-Level Languages [video]
And it is very true -- Ada never truly gained any foothold in anything but situations where it truly delivered upon a requirement.

If anything, I can take solace in the fact that it is very much alive despite the exaggerated rumors of its death. I'd encourage everyone to try it out and steal all the ideas.

henrikeh··on Safe and Secure Drivers in High-Level Languages [video]
It is disappointing that Ada seems to be completely shunned from all discussions of safe high-level languages despite having both a track record (several successful safety critical systems) and a unique feature set (multiple compilers, provably correct subset, ranged subtypes).

Is it purely a matter of what is well-branded?

henrikeh··on An Introduction to Spacecraft Operations [video]
A few years back I attended a course on spacecraft operations at ESA. The instructor had a quite inspiring goal for operations: maximizing mission output.

He kind of touches upon it in the talk with the TV-SAt 1 situation where operations really got to be creative and find some solution to learn about the problem. Other great examples of this mindset are the quite successful Mars rovers, the Voyager spacecrafts and the Huygens probe.

henrikeh··on Ask HN: Books you plan to read in 2019?
On a tangent: I’d like to hear from someone who has studied law or similar with regards to how to break the ice on such topics? I’d personally love to have “knowledge of” something like copyright law, but I don’t even know how to approach it.
henrikeh··on Things I Don’t Know as of 2018
A really curious aspect of this list is the “scale”/depth of the various topics. Some are very specific: “Node backends”, “GraphQl”; some are very general: “algorithms”, “functional languages”.

It is well established that “knowing more” is not really a thing; we just learn to further understand relations and distinctions, feeding our ability to know of more things we have yet to learn.

henrikeh··on Ask HN: What is your goal for 2019?
My goal is to slow down to a more manageable pace and allow for more reflection and dreaming. 2018 was a hectic and eventful year and I am absolutely amazed by how much happened, but I can also feel that I completely neglected the importance of winding down.

I recently completed a biography[0] and the subject in question lost all his responsibility, in turn it let him suddenly have the time to pay attention to the small details relating to his former work. Now, I’m not interested in loosing my responsibilities, but I do want to give them the attention they deserve.

[0]: The Power Broker, Robert Caro

henrikeh··on Ask HN: What technologies did you learn in 2018?
I’m a PhD student in signal processing for fiber optics.
← PreviousPage 6 of 9Next →