HNHacker News
TopNewBestAskShowJobs

heads

403 karma · joined December 2, 2023

submissionscomments
heads··on Teaching C (2016)
The thing that really got me into this subject was building my own virtual machine and then a compiler to turn a high level language into machine code.

It sounds complicated but the VM, in Python, is basically:

  r = {}
  mem = []
  boot(mem)
  pc = 0
  while True:
    op, args = decode(mem[pc++])
    if op == “+”:
      d, a, b = args
      r[d] = r[a] + b
    elif ...:
      ...
The “source” which gets “compiled” can also just be Python function calls that emit op codes — no need to get bogged down with lexing and parsing!

The thing you focus on is the semantics of representing a function call (and return) in machine code and how to manage the stack. It made C make a lot more sense e.g. defining locals up front so the compiler knows how much stack space to use. I wish I could remember more — this was all from teaching A-Level Computer Science a few years ago.

heads··on Carta doing unsolicited tender offer outreach to their customers' investors
Imagine you are planning a wedding and you use party.com as an easy way to manage the guest list. Maybe you give your friend two seats — him and a plus one — the Smith family four seats, and your diving club pals a whole table. Also, you’ve invited surprise guest auntie Beyoncé.

These are all people with whom you have entrusted important rights such as dressing nicely, staying relatively sober, and not poking the cake. Additionally, the wedding venue has a fire safety limit of 150 people. Any more than this and the authorities shut you down for abusing the privileges they give to small weddings.

Well now imagine that party.com has been emailing your neighbours and mortal enemies the Joneses saying the Smiths have two seats they want to sell and that Beyoncé is going to be there. They also help the diving sell half their table to what turn out to be classical music supremacists who show up protesting Beyoncé’s pop music. One of them also gets drunk and pokes the cake. Thanks a bunch party.com.

In real life, shareholders can do unhelpful things or act with downright hostility so you need people you know and who you trust to behave themselves.

The SEC also give you an exemption from having to register with them (and publish your accounts) but only if you have fewer than 500 shareholders. If a big shareholder splits their holding and sells to a bunch of random people then they risk pushing you over that limit.

Carta / party.com are abusing their position by marketing your shares / wedding invitations behind your back.

heads··on Hard disk LEDs and noisy machines
When I used to use macOS on Intel laptops I would be hit, every so often, by gpg’s smartcard pinentry getting stuck in a 100% loop. The only thing that ever notified me of it was the fan turning on!
heads··on The Curious Case of MD5
I can see the lawyers’ point. Any old checksum is good enough for spotting random data corruption. If you do happen to have a crooked lawyer who is submitting tampered evidence then you would hope that there are better systems in place to weed out this ethical corruption.

For instance: law school training to strengthen ethics, well known punishments to act as a deterrent, hiring processes to filter out unscrupulous actors, and whistleblower protections to encourage and reward vigilance.

It’s not an opinion that adheres to the cynical zeitgeist, but in my experience most members of this profession are extremely trustworthy. I’m sure they dislike the stereotype of lawyer=rotter just as much as hackers are tired of being typecast as Newman… sorry, Dennis from Jurassic Park!

heads··on Someone was breaking into Orange Spain RIPE account (and break their /12)
Maliciously changing a RIPE allocation would be like going into a pub and moving Geoff’s drink to one side so you and your mate can take his and Frank’s spot at the bar. While you may physically succeed at this, you will also find you don’t get served and you do get thrown out and barred.

I’ve always liked the professional level of collusion that makes the Internet work. One day it will all go wrong and we’ll have to set up something democratic, but until then the technocracy works well.

heads··on Double encryption: Analyzing the NSA/GCHQ arguments against hybrids
I’m very naive about the upcoming quantum cryptography switchover. Can anyone here recommend a good podcast to learn about it more?
heads··on Show HN: Resurrecting the Dillo browser
The world of low spec hardware really does need faster, lighter browsers. Too many times now have I configured an SBC, RPi, or even a laptop that’s just a few years old and been disappointed that, while everything else is wonderful and fast and smooth looking, it is browser performance that is the one thing holding me back.

I am resigned to the fact that some of my requirements really do mean I need a Ryzen 7 with 16GB of RAM. Sadly my biggest compute loads are for MS Teams and webmail.

heads··on Vermont Attorney General's dog sniffs out electronic storage devices
The officers are busy. Last year nearly 800 cyber tips filtered through the National Center for Missing & Exploited Children. Officers are carrying out search warrants on a weekly basis and some electronic files have been spread so widely that officers know their hash value by heart.

It’s difficult to say whether sexual exploitation and the spread of sex abuse materials has actually increased dramatically in recent years.

This whole article feels like a cute dog story with barely any journalism about something that is very threatening to the Internet. Was it was submitted to trigger debate about propaganda rather than on the merits of the reporting?

I imagine there is a lot of useful statistical analysis to be done on the list of filenames, their metadata, and various content hashes which could absolutely answer some questions about the patterms of CSAM over the past decade.

heads··on Subject-First Commit Messages
Colour me old fashioned, but these tickets are usually web documents that can be located by a URL. It’s ok to use URLs for links!

They are too long to fit into a title but fit nicely into the body text…

  See https://bugs.com/8765309
…with the advantage that many tools already know how to make these magic strings into clickable links. No need to rely on parsing #<id> or !<id> or whatever.
heads··on PyPy has moved to Git, GitHub
When I want to see inside a piece of software I look for (1) the source code; (2) the git-blame; (3) the code review for significant commits. I have never wanted to see into the history before that point, namely how the developer drafted and polished their idea prior to the final code review approval.

What practical use case am I missing out on when these work-in-progress draft commits are lost? I can’t see one.

heads··on Fish shell 3.7.0 released, the last release branch before the full Rust rewrite
Both zsh and fish offer the same kinds of improvements over bash. The headline feature of these two is the auto completion user experience. They complete as you type, with fish for example showing suggestions in a muted colour ahead of your cursor which you can complete word by word or accept completely.

zsh is a much older project and carries with it a lot of baggage in terms of configuration. fish was designed later and straight out of the box.

Intelligent auto complete is extremely useful if you are constrained with your input either by disability or by using a suboptimal device. Switching to fish really helped for ssh-ing to hosts from my iPhone.

heads··on Git Things
There are plenty of good reasons for short line lengths. Two factors constrain the max line length down to something not much more than 80 columns: side-by-side diffs and waning eyesight.

In-line diffs mix the flow of change in with the flow of execution, both going down the page. Side-by-side diffs makes those two axes orthogonal. With decorations (either in a terminal or a code review tool) even 80 column code requires a fairly small font. Editing two panes of code only needs 161 columns but a decorated patch might be more like 170.

The point font size is its height in increments of 1/72”, and most fonts are half as wide as their point height. The largest font one can use on a 27” monitor (24” wide) is 20pt. My eyes get knackered at anything smaller than 18pt.

heads··on The Heart of a Language Server
Visiting and transforming trees is indeed a well trodden pattern. Here’s another kind of tree walking which I’ve enjoyed working with, this year:

https://libcst.readthedocs.io/en/latest/tutorial.html#Build-...

It is a little less pure than the functional XSLT, and also a lot more practical.

heads··on Coastline paradox
I was surprised to see that the real world example really does go up and up as the resolution of measurement increases:

https://en.m.wikipedia.org/wiki/File:Great-britain-coastline...

If stops at ~50m resolution. I imagine it could go even further.

heads··on DiffDebugging
The usual definition of “linear history” is equivalent to what you see with “git log --first-parent”. Linear history doesn’t mean that people share every “wip” commit from their private feature branch with everyone else.

With linear history you squash everything into a single, working commit which is applied to the tip of the shared branch. The rationale is that each change is like a published piece of writing: it will have been through multiple drafts and final versions as well as being edited and peer reviewed, but ultimately the only thing any of your peers care about is the finished work. None of the incomplete, broken, or unreviewed intermediate versions belong in the shared history and they can be thrown away.

Two counter points to this. First, the code review discussion is often recorded forever but in a social tool that’s kept separate from the code itself.

Second, if you end up being as famous for your code as Austen, Thackeray, Shakespeare or Da Vinci were for their literature then your “work in progress” commits and v0 drafts are very valuable and worth keeping. The amount of people this could apply to is not a large number.

heads··on Semantic versioning is a mistake
This headline is slightly dramatic*. The far worse thing with semantic versioning is that it became part of our company’s culture of collaboration. Semver sat too easily alongside multiple repositories, small uncouple components, and teams sitting in silos. There were only fifty of us!

You are beholden to use semantic versioning (and changelogs and READMEs) when there is only a one way communication channel with the consumers of your software. You can’t see their call sites so when you deprecate print_beermat() to manufacture_coaster(style=BEER), the best you can do is warn them both numerically and in writing**.

When you operate a business where all the developers are on the same team then it is crazy — unless you have thousands of SWEs — to communicate in this way. Much better to (1) rename the function (2) fix all the call sites and (3) put it up as an atomic changeset. You’d like to think I was preaching to the converted but I still see this practice happening occasionally.

* Their thesis is that authors of popular software change their APIs with reckless abandon, which semantic versioning enables.

** Or, as the original author says, just don’t delete the old print function.

heads··on Show HN: I built ContainerCVE – a web tool to scan public Docker images
It was directed at you as you seem to know what you are talking about!
heads··on Show HN: I built ContainerCVE – a web tool to scan public Docker images
(Not the author.) I’ve only really encountered CVEs when they have been mentioned on patches, usually Debian security updates.

Do vulnerabilities normally get a patch and are we expecting upcoming regulation to require the patches are installed? If action is required to be taken when vulns are published do we all have to just uninstall the thing until the bug gets fixed, lest we invalidate our corporate insurance policy?

Will I have to cease my current policy of running Trivy, reading the CVE output, and then declaring (and making a git commit saying) “while this stdlib library technically supports CORBA and our OS technically supports IPX, we don’t use CORBA or IPX… or networking… or this library… so I’m ignoring this!”

heads··on You've just been fucked by psyops [video]
Thank you CCC for giving us downloadable video and audio. I’ve just downloaded this for my flight today. (I’m a passenger, not the pilot.)
heads··on Quairading shire erects signs telling travellers to ignore Google Maps
Here is my entry, on the way to Cwmyoy in Llanthony:

https://maps.app.goo.gl/Q4verMiEmXk4ZZVs9?g_st=ic

There are “not suitable for motor vehicles” signs at each end but I completely missed them. I approached from the other end which is far less discouraging.

Quite fun really, and it led me to an invitation to the local history society and some beautiful old homes in the area. Cwmyoy still had a school and a pub after the war as well as, of course, the famous crooked church. The pub fell down, the school is a private home, but the church is still standing.

People used to live in the countryside. Now they just sleep there (or drive through it.)

heads··on Generation Junk
Alas even Rotring make crap these days, specifically their Rapid Pro lead holder:

https://www.jetpens.com/Rotring-Rapid-Pro-Lead-Holder-2-mm-B...

It cost me $40 and the red ring is part of a larger plastic component that connects the barrel to the front inch that you grip and it flexes and comes loose when I write. Rubbish design.

heads··on Book list for streetfighting computer scientists (2022)
Anderson, Security Engineering (Wiley) would make an excellent addition to this list.

(The blog post omitted anything infosec saying the field is “part of QA” but it’s not like this list is pure CS — a lot of engineering topics aka “applied computer science” are on the list already.)

Security economics is important when building real world software because one has to know one’s enemy in order to decide what to defend against. It is literally the most “street fighting” topic in the field.

heads··on Debian Statement on the Cyber Resilience Act
Not forgetting of course that Debian is available commercially:

Vendors of Debian Installation Media https://www.debian.org/CD/vendors/

They are hardly Adobe, but all it takes is one zealous lawyer on a crusade to force an interpretation that Debian and Adobe are equivalent organisations when it comes to the commercial production of software.

pizza points out that Commercial Activity is apparently a bit more carefully defined, in the act, than simply “money changing hands”: https://lwn.net/Articles/956191/

I’ve never been a fan of the moral position that says certain laws only apply to commercial contracts. If two parties make an agreement (get married, have a child, adopt a cat, go fishing, etc.) then they ought to be held to that agreement. Whether or not money exchanged hands seems immaterial and considering whether it did or not, when trying to decide if someone acted in the right or in the wrong, feels dirty.

heads··on Amazon Prime Video starts showing ads in January unless you pay $2.99/month xtra
Thanks for checking my math and for doing a second run at it. I’ve edited to point out my mistake. It feels like there’s a mismatch but my numbers are pretty hand wavey so I can imagine it could be a lot closer than that.
heads··on Amazon Prime Video starts showing ads in January unless you pay $2.99/month xtra
How comparable is $3 a month to the ad revenue they might make from the shows?

Apparently Amazon Prime accounts get a median of 300 minutes per week of view time. That’s 20 hours of TV a month with (in the order of) a few hundred ad slots I am paying to not have to watch. Amazon are making a penny per unwatched-ad from me.

Contrast with broadcast TV: Good Morning Britain wants £4k for an ad slot in a show that has 500k to 800k viewers so that’s a CPM also in the order of a penny [edit: ahem, £5, not a penny] paid for by the advertiser, for 1000x views.

So, even taking into account Amazon’s targeted ads vs broadcast TV ads, they can indeed make a lot more money from withholding ads than if they show them?

We could call their bluff. Maybe they don’t have any ads to actually show for which advertisers are willing to pay significant fee. But if the business model is to get consumers to pay Amazon to make the pain go away then they’d probably just show 90 seconds of screaming at the start, middle and end of every episode of The Boys.

heads··on Using Make – writing less Makefile
Make is the grilling of the hacker world. You just want to light up some quality lumpwood charcoal and get a nice smokey crust on some steaks, cook up some hamburgers, and crisp up some chicken for your guests over the course of an afternoon…

…but oh no there is a constant stream of inquisitive folk coming over, beer in hand, suggesting cool adjustments / hacks / “improvements” to your setup. With grilling it’s actually pretty easy to defend oneself from this unsolicited advice. There’s only one grill after all. It’s not like it’s some company wide grill that anyone can make changes to solely by convincing one other person to sign off on their PR / MR / changeset.

I’ve seen some very “clever” makefiles (and cmake lists.txt) over the years. It is hacker catnip for all manner of Jackson Pollock ad hoc scripting rubbish and I lament every commit that did anything except make the makefile less complex! All new software engineers should be given a shiny ball to play with when they get bored with their day job, lest they decide to take out their playful creativity on the build system instead.

heads··on Fed court rules for retired engineer told by state to not talk about math
The thing I worry about with expert witness testimony is that if you assume a spherical cow then you can make all sorts of logical deduction work in your favour.

Something feels fundamentally uneasy about an expert bringing of supposedly rigorous scientific facts to only one side of a court argument. Cases that come to a court are based on much fuzzier, human condition concepts like “did they mean to do it?”, “was it in the heat of the moment?”, and “did they know what they were doing was wrong?”. Even more so when it comes to the sentence which is handed down.

I think it’s also the same sort of queasiness I feel when I see a paper that states that an exoplanet has butterflies due to the presence of a certain kind of Nitrogen molecule in its atmosphere. The science of the molecule detection is bang on but the inferred conclusion is not.

heads··on America lost the chestnut, its "perfect tree"
In a lot of parts of the countryside that I love, the ash trees have completely obscured all the best views over the past 30 years. It feels awful to say but I can’t wait for ash-die-back to wipe out this generation. We’ll be glad for the timber to use as fuel too, of course.
heads··on Mozilla sccache: ccache with cloud storage
We used this for a while at Speechmatics but our LM researchers have a well established workflow based on git working copies on NFS /home and we had a lot of instability between sccache and NFS.

Is sccache susceptible to cache misses when using full paths as cache keys? It would be very helpful if compiling “/home/heads/project/foo.c” could use the cached result of compiling “/home/thunderbong/project/foo.c”.

heads··on Unveiling the big leap in Ruby 3.3's IRB
I suppose you could run the unit test suite?
← PreviousPage 3 of 4Next →