HNHacker News
TopNewBestAskShowJobs

kahlonel

482 karma · joined January 11, 2017

Embedded Software Architect
submissionscomments
kahlonel··on Extremely disillusioned with technology. Please help
I feel fortunate to have chosen embedded software as the career path. 10 years in industry now and never had a dull moment (though I've had some bad colleagues/clients). I work inside a terminal all day, no GUI (even use GDB TUI), and somehow never get bored of it. I think having a physical entity responding to your code immediately (blinking LED for example) keeps the programmer interested.
kahlonel··on Getting started with bare-metal assembly
I recommend anyone just starting with bare-metal assembly to get an STM32F0 board and write assembly programs for it. I'm just gonna plug my super small toy RTOS I wrote for Cortex-M0 a while ago.

https://github.com/kahlonel/rt0s

kahlonel··on Ask HN: How do I learn C properly?
> C is too low level for writing any substantial code.

Do people not realize that projects like Linux and pretty much every car's ECU software (pretty "substantial" in my opinion) is written in C before claiming this? I'm not saying these software are 100% bug free, but this claim isn't accurate either. You _can_ write substantial C code when you have a good understanding of the tooling around it. Mere learning the syntax isn't enough.

kahlonel··on Avoiding and identifying false sharing among threads (2011)
I saw your top comment on this thread. I didn't read the article, but I wonder why MacOS doesn't have the invalidation problem?
kahlonel··on Ask HN: What's the most valuable thing you can learn in an hour?
Learn how to do rear naked chokehold. You’ll probably use it once in your lifetime, but learning it is worth it.
kahlonel··on Ask HN: Best Noise Canceling Headphones
Sony WH-1000XM3: I've used several ANC headphones before. None of those come close to this. Sound quality is extremely good too. Good battery life. A 15 minutes charge gives me 5 hours of playback. On the negatives: A bit heavier than Bose headphones but not by much. The "touch control" is sometimes annoying to use.
kahlonel··on Facebook iOS app has camera active during use
I don’t know why would anyone install the FB app on their iPhone. The mobile version is sufficiently good, given the fact that their app doesn’t even support messaging.
kahlonel··on Principles for C Programming
> Do not use fixed size buffers with variable sized data - always calculate how much space you’ll need and allocate it.

Actually, sometimes it is best to have a fixed size buffer, sized appropriately for the maximum data-bytes allowed as per design. Especially true for embedded systems where dynamic allocation is usually frowned upon.

kahlonel··on On Safety Critical Software
It’s not “safety critical” unless there’s a chance of someone dying as a direct result of the system’s failure. Stop trying to mix two totally different ideas together.
kahlonel··on Apple Releases macOS X Catalina
Still waiting for the macos with true color terminal.
kahlonel··on Why is Rust slightly slower than C?
> it does not suffer from the pointer aliasing faults C has.

There's a `restrict` keyword in C99.

> const really means const, where in C the compiler has to assume any pointer-to-const might be use to write through

Lookup what `const int *const ptr` does in C.

kahlonel··on Why Ada Is the Language You Want to Be Programming Your Systems With
As a side note for people like me who have no option other than C for their safety critical projects, remember there's a MISRA-C standard. If that feels too much, [1] is a good starting point.

[1] http://pixelscommander.com/wp-content/uploads/2014/12/P10.pd...

kahlonel··on Ask HN: What slows you down most when starting new programming projects?
Trying to figure out the project name. I name my projects no matter how small they are. It somehow makes the project important enough for me to come back to it a few days later.
kahlonel··on Ask HN: What are you learning in 2019?
Learning to play a guitar, and some basic music theory. I wish I had started it earlier, but I guess it is never too late :)
kahlonel··on AI startup claims to automate app making but actually just uses humans
Smells like Theranos. It's surprising how easy it is to fool VCs these days.
kahlonel··on What Does a Coder Do If They Can't Type?
Kudos to this guy’s bravery; he is living my worst nightmare. My biggest fear is losing eyesight or ability to use hands, and articles like this confirm my beliefs that our current technology is no way near mature enough where disability isn’t a concern anymore. And these doctors, what can I say about them. It looks like they are getting worse, or just lazy, with every passing day. If you are a doctor and you don’t want to do anything that requires more effort than prescribing painkillers, do this world a favor and get retired because you are actually damaging the medical industry.
kahlonel··on Ask HN: The most useful Mac keyboard shortcuts?
Ctrl+Left and Ctrl+Right for desktop switching without using mouse.
kahlonel··on Dark Matter Developers: The Unseen 99% (2012)
> The Dark Matter Developer will never read this blog post because they are getting work done using tech from ten years ago and that's totally OK

I thought I was a “Dark Matter Dev” until this. But then it’s weekend so maybe I still am.

kahlonel··on Apple Updates Air, Pro Laptops, Kills Off the MacBook
Did Lenovo fix the suspend issue yet, or did you apply the BIOS patch manually?
kahlonel··on It’s Time for Caps Lock to Die
As a programmer of C language, where macros are conventionally all-caps long strings, CAPS lock is really important for me.
kahlonel··on How to write idempotent Bash scripts
> An easy way to cover that is to have the script create a file, which you check at the start of the script and if present you exit.

This does sound a good solution on paper, but "checking at the start" and "creating a file" are two different steps (i.e. not atomic) and will cause trouble eventually if your system has the tendency to run the script twice. A better solution is to use the `flock` command before creating the flag file. For example,

  exec 999>/var/lock/my.lock
  flock -n 999 || exit 1
  if [ ! -f flag_file ]; then
    echo "script not ran before, running"
    touch flag_file
  else
    echo " already ran, exiting"
    exit 1
  fi
  # do stuff here
kahlonel··on So you think you know C? (2016)
Pro tip: avoid `int`s as much as possible in your C code. Use <stdint.h> defined macros instead.
kahlonel··on Boeing's 737 Max software outsourced to lower-paid engineers
It is a hardware design issue. There's a concept of N+1 redundancy in safety-critical systems, a hardware design decision. This basic philosophy was missing from the MCAS system[1]. You can argue that the software could just ignore bad sensor readings, but that's just software making up for hardware deficiencies.

1. https://www.seattletimes.com/business/boeing-aerospace/a-lac...

kahlonel··on Ask HN: Which headphones are you using?
Sony WH-1000XM3: I've used several ANC headphones before. None of those come close to this. Sound quality is extremely good too. Good battery life. A 15 minutes charge gives me 5 hours of playback.

On the negatives: A bit heavier than Bose headphones but not by much. The "touch control" is sometimes annoying to use.

kahlonel··on A Teenager's IoT worm is bricking thousands of devices
Funny how they believe that he is actually a teenager. Like the creator will reveal his real age.
kahlonel··on From Python to Go to Rust: an opinionated journey (2018)
If the author had explained a real reason for abandoning Python in favor of Go, it would've made a lot more sense to write this article. "Not feeling it right" isn't how engineers choose their tools. He could've said that he wanted to try something other than Python, and I would have respected that.

On top of it, his reason to switch from Go to Rust is laughable at best.

kahlonel··on Why we chose Rust
If you're gathering data through multiple sensors data from one end, and pushing it out to network from another, the performance of the 4-core ARM CPU should be the least of your concerns. You are never going to reach 100% CPU utilization unless you're doing something very wrong. Contemporary sensor protocols are slow, to say the least. Same for the network end. You'll saturate atleast one of those two ends before running out of CPU power. Use Python. It is easy, fast and has a ton of library support for numerical analysis. Stop buying into the hype please.
kahlonel··on Smoltcp: A small TCP/IP stack in Rust
Any idea what would it take to write this without using _any_ C library function?
kahlonel··on BonziBuddy
I liked the green parrot version more.
kahlonel··on Sealed Rust: A plan to bring Rust to safety critical software domains
Where did you get this 80%/20% figures from?
← PreviousPage 3 of 7Next →