HN user

reynoldsbd

267 karma
Posts6
Comments44
View on HN

I’ve found that good logging/tracing discipline can play an important role here. For example, my team has a guideline to put a debug! message before blocks of code that are likely to fail. Then if something goes wrong, we can dial up the logging level and zero in on the problem fairly efficiently. With this model, we don’t find the need to use any third party error framework at all.

In the abstract, we are basically treating the error as a “separate thing” from the context in which it occurred. Both are of course strongly related, however the way some of these error libraries try to squash the concepts together can be quite opinionated and doesn’t always facilitate smooth interop.

Not saying this is the only way to deal with errors, but it’s just one way of thinking of the problem that I’ve had pretty good success with.

rust solves the issue of finding competent engineers

That's a very cynical take, but I think there's a kernel of truth in there somewhere. Rust does indeed make it much harder for less experienced programmers to make certain classes of mistakes. Why on earth would that be a bad thing?

you can't shortcut this by...

"Using Rust" and "understanding the hardware"/"good architecture" are not mutually exclusive, and Rust is not a shortcut. Embedded programming is still very hard. In some ways, Rust can make it even more difficult by forcing your code and architecture to follow additional rules.

cannot get around C or C++

Speaking from experience, this is false. It's perfectly possible to write embedded applications using only Rust and assembly, without a single line of C/C++. I do it every day.

I'm fortunate enough to have just landed on a new team working with embedded Rust. Here are some of my takes, in no particular order.

The language and ecosystem have come a long way in a very short time. It's easy to use safe `no_std` Rust on the stable toolchain for 98% of your code, and there are crates available for all kinds of things like memory management, register access, or even async runtimes.

Compared with C, Rust is absolutely a game changer in terms of reliability/safety/productivity. Every line of C code is a potential liability, because humans make mistakes. Having a compiler that smacks me down is invaluable; it results in a safer and more reliable program, and it helps me get it right the first time. Like many others, my experience with Rust is nearly always "if it compiles, it works". This is _especially_ valuable for embedded programming, because debugging is often way harder when working with hardware.

One major drawback is lack of support/engagement from hardware vendors. They pretty much assume you are using C, and all of their IDEs/SDKs/codegen tools/whatever are written with that assumption. This probably isn't going to change any time soon (ever?). What this means is that if you want to use Rust, you'll be on the hook for figuring out a lot of low-level things like linker scripts, boot sequence, or memory/clock initialization. Often this means reading or reverse-engineering the vendor's SDK to figure out how these work. If you're working at a big company on a serious product, you might have done this anyways. But for a hobbyist, this can be a huge barrier.

Counterexample: comedy central now has to work to redact all noncompliant programming.

Best practices are funny because context and history are important. Actual regulation is not so forgiving.

Definitely not true. GDPR significantly broadens the types of data subject to legal requirements. Whereas yesterday I only had to protect PII and content, now even telemetry and performance data becomes subject to new rules.

This is a huge problem for an org that relies on huge amounts of such data to keep our product running and uses systems which were never built with these new rules and classifications in mind.

Furthermore, there are huge complications surrounding "data processor" scenarios (in other words, Enterprise SaaS products). For example, what takes precedence, GDPR deletion or our contractual security/auditing obligations?

Again, I'm not saying that any of this isn't worth while, just that when you get down into the weeds things look a little different.

Absolutely! Anybody who does business in Europe or even has users in Europe is subject to this law.

The amount of effort being put into GDPR compliance within my organization is just staggering. It really makes me think about these kind of laws from a new perspective, because they cost businesses so much to implement.

(I'm not saying whether GDPR is right or wrong! Just that it's expensive.)

then you can't use .Net

That's just plain wrong. Not only might .NET be a good option for a backend system (which can, of course, communicate with any platform), but people have been using .NET on non-windows systems via Mono for many years

Not sure if it's already possible, but it would be nice to have nested navigation (like with drop-down sections).

Even without that, though, Min is really exactly what I think of when I need a lightweight framework that gets out of my way.

Maybe some better sea monster repellent? ;-)

Tabs are 8 characters...

The madman!

/s

Actually, now that I think about it, he has a point. Having a little more horizontal space seems like it would be easier on the eyes.

Thanks for reaching out! Just plain FireFox on Windows. Automatic updates are on, currently at version 51.0.1.

Let me know if there's anything I can do to help!

I don't even know where to begin debugging. My browser just locks up and has to be killed. Usually before the page with the REPL even starts rendering.

Weird.

For some reason, repl.it crashes my FireFox without fail every time I try to open a REPL.

It's a shame; there have been several occasions over the past few months where it would have been extremely useful, but instead brought things crashing down.

Thanks for your work on this! The addition and consistent improvement of the integrated terminal is the number one reason why VSCode is my daily driver.

Another great release!

Maybe I'm just squarely within the target audience of VSCode, but I'm consistently impressed by how many of my pain points just magically go away with each new iteration.

Skip lists are a hidden gem! I first learned about them from a GitHub developer at OSCon a few years ago, and at time they seemed like black magic.

It's a shame that universities (or at least mine) don't teach more interesting algorithms like this... it would make the algorithms/data structures coursework so much more interesting.