HNHacker News
TopNewBestAskShowJobs

PeterWhittaker

2,356 karma · joined April 27, 2009

submissionscomments
PeterWhittaker··on John Carmack on Functional Programming in C++
Great summary of the motivation: A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in. In a multithreaded environment, the lack of understanding and the resulting problems are greatly amplified, almost to the point of panic if you are paying attention. Programming in a functional style makes the state presented to your code explicit, which makes it much easier to reason about, and, in a completely pure system, makes thread race conditions impossible.

That is prescient, clear, and worthy of great reflection.

PeterWhittaker··on NASA believes it understands why Ingenuity crashed on Mars
I'm not particularly surprised: they planned 5 missions, all short in time and distance. Since every gram has to be accounted for (how many grams of fuel to a gram of sensor to Mars?), my guess is they equipped it with the bare minimum sensor package for the 5, and hoped maybe to get a few more missions in.

My speculation is that the next one will have a host of sensors, given how much more likely double digit missions of greater length now seems.

PeterWhittaker··on Black Hat Rust
Apologies, my reference to python was unclear: I was referring to the python module system and the strength and depth of community contributions, not to the syntax and semantics of the language.

In both cases, the communities do so much good work that often someone else has at least a partial solution to problème-du-jour, so it can be relatively easy to get at least a prototype or PoC, and learn from it, and sometimes one gets a complete solution to at least part of the problem.

PeterWhittaker··on Black Hat Rust
Well, it's nice on this side of the line.

There is no party line, and there is no tone. There are over 30 years of experience with C, not all of it pleasant, though most of it productive, and, comparatively speaking, amazing recent experiences with Rust. I do have to shift my thinking from how I would solve problems in C, because the memory management paradigm is so different, but, thanks in part to deep dives into scoping in other languages in pursuit of pernicious bugs, once I make that shift, problems are easier to solve in Rust: The language and the compiler, hand in glove, do a lot of the work for you.

You can carp all you like, and that is all it is, carping, not criticism, we'll just happily work along getting a lot done in less time.

PeterWhittaker··on Black Hat Rust
We don't have a lot of place for religion in my industry, and safe, performant low level code is everything. Writing and debugging such code in Rust is just easier and faster than in C.

Two years ago I was casually learning Rust by night while by day I was extending a scheduler I had previously written in C. I kept wishing I could switch, because I kept having to handcraft in C things I would have gotten for nearly free in Rust.

Now, we're designing the Rust replacement for that C program, and it is taking all my will power not to start coding it: that job falls to someone else, and I am wistful about it. Not because I am going to miss the C code, but because it would just be so much fun to do in Rust.

PeterWhittaker··on Black Hat Rust
If you say so. Considering that you can define the basics of a memory and thread safety for free JSON parser in a single enum in Rust, and derive a lot of utility functions, where C would take a lot more code, and the code would be riskier, well, I'm just going to keep enjoying working in the language. It has a lovely balance of power and conciseness.

There is a huge learning curve to Rust, one that I am still climbing, but I haven't been as excited learning and working with a new language since 1987 when I learned C afters years of working with Pascal, Fortran, and a number of procedural job control systems.

In the years since, I've written large complex programs and systems in C, JS, bash, and PowrShell, and so far Rust feels like my new forever home, my defauly go to.

I'm glad of this, because my industry is heading to memory-safe, compiled languages, and the others I've experienced don't work for me. It's aesthetic, mostly, I guess, but Rust just makes sense.

PeterWhittaker··on Black Hat Rust
Sure, we can do those things in C, but they are easier and faster to do in Rust, and safer, largely because of Rust's enums (algebraic data types, not as simplistic as C's) and traits, and because of crates: a lot can be done in Rust by gluing together a few well maintained crates.

The only language that comes close, AFAICT, is python.

Add the fact that Rust's memory safety brings thread safety for free (once you've grokked Rust's memory management model) and yiu get quickly written type safe memory safe thread safe high perfomance code.

PeterWhittaker··on Ask HN: Does retro computing make you feel younger or older?
I feel the same about old HW as I do old cars: some deserve historical recognition for their importance, and I'm thankful for the uh, passionately committed people who maintain them against all odds and sometimes at ridiculous expense, so that these important historical icons remain, but they are the past, and I don't live there anymore.

While we can learn from them and their inventors/creators, if we choose, I'm much happier with my rock solid highly reliable five year old RAM and my new MacBook Pro. I've driven a lot of the Jeeps ever made, and off-road I'll take my JKU Rubicon over any of them (except maybe the 2004 "LJ") any day. It's a beast to maintain mostly because I am beastly to it, and the older ones are worse for that.

I don’t rush after the newest and shiniest (my M3 replaced a 2013 Air), but when it's time, the RAM and JKU will be replaced with new.

PeterWhittaker··on Biggest shell programs
OK, so JOOC I ran wc against the main binary and supporting libraries for a project I did last year: It's a script to manage linear assured pipelines implemented as a series of containers (an input protocol adapter, one or more filters, an output protocol adapter). The whole thing was intended to be useful for people who aren't necessarily experts in either containers or protocols, but who have an idea of how they want to filter/transform files as they transit the pipeline.

It's 6224 lines, so far.

There is a top-level binary with sub-functions, sort of like how

   git [ git options ] < git action> [action options]
or

  systemctl [etc.[
work.

There is a sub command to add a new sub command, which creates the necessary libraries and pre-populates function definitions from a template; the template includes short and long usage functions, so that

  cbap -h
or

  cbap pipeline -h
give useful and reasonable advice.

There are subcommands for manipulating base images, components (which are images with specific properties for use as containers in the pipelines), and pipelines themselves. A LOT of code is for testing, to make sure that the component and pipeline definitions are correctly formatted. (Pipelines are specified in something-almost-TOML, so there is code to parse toml, convert sections to arrays, etc., while components are specified as simple key=value files, so there is code to parse those, extract LHS and RHS, perform schema validation, etc.).

Since pipeline components can share properties, there is code to find common properties in var and etc files, specify component properties, etc.

There are a lot user and group and directory and FIFO manipulation functions tailored to the security requirements: When a pipeline is setup, users and groups and SEL types and MCS categories are generated and applied, then mapped into to the service files that start the components (so there is a lot of systemd manipulation as well).

Probably the single biggest set of calls are the functions that get/set component properties (which are really container properties) and allow us to use data-driven container definitions, with each property having a get function, a validation function, and an inline (in a pipeline) version, for maximum flexibility.

Finally, there is code that uses a lot of bash references to set variables either from files, the environment, or the command line, so that we can test rapidly.

It also support four levels of user, from maintainer (people who work on the code itself), developer (people who develop component definitions), integrators (people who build pipelines from components), and operators (people who install pipelines), with the ability to copy and package itself for export to users at any of those levels (there is a lot of data-driven, limited recursive stuff happening therein).

Since target systems can be any Linux, it uses makeself to package and extract itself.

For example, an integrator can create a pipeline definition, which will produce a makeself file that, when run on the target system, will create all users, groups, directories, FIFOs (the inter-component IPC), apply DAC and MAC, create systemd files, copy images to each user, and launch the pipeline - with a delete option to undo all of that.

There is some seccomp in there as well, but we've paused that as we need to find the right balance between allow- and deny- listing.

(Yes, I use shellcheck. Religiously. :->)

PeterWhittaker··on Biggest shell programs
Thanks for the clarification. It was so long ago, it’s all a bit hazy.

Other than the COLUMNS thing. That is burnt into my memory forever.

PeterWhittaker··on Biggest shell programs
dspillett was exactly right: ps, e.g., truncated its output at $COLUMNS and there was no horizontal scroll.

As suggested above, it did this even when called from a script.

The fix was easy, set COLUMNS ridiculously large if DEC Unix, but it took days of WTF apparent UB before I realized how simple was what was happening. It just seemed haphazard: I'd reposition and resize a window so I could run the script in one while manually running the commands in another, get inconsistent results, rinse, repeat...

...and eventually realize the common element in each test was me, and the variations I was introducing were window size.

I cursed their engineers for trying to be "helpful" and keep things "pretty".

PeterWhittaker··on Biggest shell programs
Oh, yes, I think it was Digital Unix. IIRC, we toyed with OSF/1, but there wasn't much call for it.
PeterWhittaker··on Biggest shell programs
Oh, no, now I have to go dig out some of mine....

The first really big one I wrote was the ~7000 line installer for the Enrust CA and directory, which ran on, well, all Unixes at that time. It didn't initially, of course, but it grew with customer demand.

The installation itself wasn't especially complicated, but upgrades were, a little, and this was back when every utility on every Unix had slight variations.

Much of the script was figuring out and managing those differences, much was error detection and recovery and rollback, some was a very primitive form of package and dependency management....

DEC's Unix (the other one, not Ultrix) was the most baffling. It took me days to realize that all command line utilities truncated their output at column width. Every single one. Over 30 years later and that one still stands out.

Every release of HP-UX had breaking changes, and we covered 6.5 to 11, IIRC. I barely remember Ultrix or the Novell one or Next, or Sequent. I do remember AIX as being weird but I don't remember why. And of course even Sun's three/four OS's had their differences (SunOS pre 4.1.3; 4.1.3; Solaris pre 2; and 2+) but they had great FMs. The best.

PeterWhittaker··on RAII and the Rust/Linux Drama
I'm even less sure what to make of this article after developments over the past two weeks and especially this past weekend: It seems to be mostly Rust FUD wrapped in a screed against RAII, implying that somehow Rust will harm the kernel, maybe. But in the past two weeks...

16 Nov, Linux 6.13 Introducing New Rust File Abstractions, https://www.phoronix.com/news/Linux-6.13-Rust-File-Abstract

26 Nov, 3K Lines Of New Rust Infrastructure Code Head Into Linux 6.13, https://www.phoronix.com/news/Linux-6.13-Rust

30 Nov, Linux 6.13 Hits A "Tipping Point" With More Rust Drivers Expected Soon, https://www.phoronix.com/news/Linux-6.13-char-misc-More-Rust

That last one is particularly interesting, with the following quote from Greg K-H: "rust misc driver bindings and other rust changes to make misc drivers actually possible. I think this is the tipping point, expect to see way more rust drivers going forward now that these bindings are present. Next merge window hopefully we will have pci and platform drivers working, which will fully enable almost all driver subsystems to start accepting (or at least getting) rust drivers. This is the end result of a lot of work from a lot of people, congrats to all of them for getting this far, you've proved many of us wrong in the best way possible, working code :)"

PeterWhittaker··on Rust: Tools (early access edition)
Hmm, hard to read on mobile (in portrait), had to zoom in a bit (but then text went out the window, so it was a bit of a balancing act)...

...so I rotate my phone.

DON'T DO THAT!

I'm directing that at both HN readers (you're welcome) and at the web author/admin (dude, TF?): a sudden explosion of additional content that I could not find a way to dismiss, when all I wanted to do was see the excerpts properly.

Seconding other comments re the poor quality crab, when your presentation is that poorly thought out and your prose that amateurish, it makes me want to save even more and dismiss this from my mind.

So thank you? I think?

PeterWhittaker··on Goodbye, Rust. I wish you success but I'm back to C++ (sorry, it is a rant)
Another commenter mentioned the NSA and safe languages, which is what prompted our move...

...and I have to say, Rust is fantastic. I was reading the O'Reilly book when I was doing some gnarly three-star C work and I kept thinking that it would likely be far easier and safer in Rust.

We're now at the point where all new work is Rust and that gnarly, performant AF piece of C that just flies will be replaced with a simpler, safer Rust version.

Another commenter mentioned speed of prototyping. That was a concern for me, too, but so far real life has shown me the opposite: prototyping is only slightly slower, mostly because I am having to learn various Crates instead of using system calls and their libc variants I've known for years, but incremental debelopment from proto to poc to mvp to product is faster because there is far less dumb at each step: if it built, it is safe(r) to extend.

Maybe it is because so much of what we do is low level high performance system programming, I dunno, but, after 37 years, I may soon have invoked a C compiler for the last time.

PeterWhittaker··on Researchers discover first UEFI bootkit malware for Linux
Honest question: how do you assess the risk to MBR as lower?

Related: How many hardware platforms are currently available with "pure" MBR support, that is, completely lacking in UEFI? My understanding is that all relatively recent systems have only UEFI and some have a hybrid mode through which they can recognize and load MBR.

PeterWhittaker··on Show HN: Clean Your Mac with a Script
And half of that is parsing the options and processing the dry run...

The script is clean and straightforward.

PeterWhittaker··on The OSI Model Revisited (2023)
Love the diagrams, will be directing people this way as needed.

Like the wise page/coconut-horse once said, "it's only a model".

PeterWhittaker··on The 'Return to Office' Lies
My daughter, SIL, and I are 100% remote (three different companies, all located in different places). RTO was an important but not deciding factor in her recent job change, but 100% remote made the new spot all that much more attractive.

She's a marketing event manager, he's an accountant manager, and I'm a, well, it depends on the day; let's say senior systems architect and programmer across our HW-and-container-based security products.

Of the three, mine needs the most in person time, which we mostly satisfy with ad-hoc whiteboarding sessions, but we've gotten good at doing even that in video calls.

When we do get together, it's for team lunches, mini-golf tournaments, etc.

It's great.

My co has people in TO, NYC, London, with most of us around but not necessarily in Ottawa.

PeterWhittaker··on Against the Dark Forest
I remember. We took a deep breath and said "here we go again"... ...I finally released that breath, but it hurt. The Dumb! So much dumb....
PeterWhittaker··on The Surprising Benefits of Talking Out Loud to Yourself
It depends if you are really talking aloud or just sort of hum-mumble vocalizing.

I shared an office with a good friend until his office was ready. When he moved, he said he would miss the buzzy hum coming from my chair.

PeterWhittaker··on Is the 80 character line limit still relevant? (2008)
I simply find spaces easier to navigate. I don't always use vim-golf-winning movements, and when I am being lazy using hl or arrow keys, I expect to move a space at a time. Tabs violate that expectation.

It's a visceral rather than a rational thing (which I suppose is implied by the word "hate" :->). I also have trailing spaces and all tabs highlighted for similar reasons.

PeterWhittaker··on Is the 80 character line limit still relevant? (2008)
> formatting tennis

That's a paddling.

Seriously, professionals do this? If someone else wrote it and it does what it is supposed to do, it is not, NOT (no apologies for shouty emphasis), my job to change that.

(I hate tabs, but will never :retab someone else's code.)

My job is either/both to fix bugs and add new capabilities, not to be precious about, well, anything.

I would have serious reservations about any team member who wasted all our time on that.

PeterWhittaker··on Undergrad thought he had mastered Unix in weeks. Then he discovered rm -rf
Been there. Thought I was in a subordinate directory, forgot I was in /dev. When my tty went funky, I realized the scope of my error, hit ctrl-C, and with great luck managed to remember the mknod incantation for tty.

With the tty restored, the rest was painful but doable.

PeterWhittaker··on Show HN: Nova JavaScript Engine
Do you plan on supporting TCO? I was disappointed to learn a few years ago that V8 wouldn't, on the grounds that, IIRC, it would confuse developers.

True tail call recursion and lazy evaluation would enable truly functional JS.

PeterWhittaker··on Why your house is a terrible investment
Perfect for me, but I run kablock and wipr....
PeterWhittaker··on Half of Young Voters Say They've Lied about Which Candidates They Support
Much of what you cite, being able to have and share opinions, etc., has been illegal in much of the world for at least parts of the twentieth century, e.g., Germany from sometime in the late twenties or early thirties, and definitely from the mid thirties on, until 1945; the Soviet Union for much of its existence; Mao's China; Khmer Cambodia; etc.

Democratic politics with free association and free elections with secret ballots are what it possible for you to hold and share your opinions, especially the unpopular ones.

PeterWhittaker··on CIL: C Intermediate Language
Not to mention SELinux CIL, Common Intermediate Language, https://selinuxproject.org/page/PolicyLanguage
PeterWhittaker··on Should JavaScript be split into two languages?
Oh, duh! Good catch! Apologies!
← PreviousPage 6 of 34Next →