HN user

nickcw

4,609 karma

Maths, Science and Computing Geek. Currently having a lot of fun with Go.

For more info:

    Github:    https://github.com/ncw/
    Homepage:  https://www.craig-wood.com/nick/
    Rclone:    https://rclone.org
    Twitter/X: @njcw
    Email:     nick@craig-wood.com
Posts77
Comments481
View on HN
spf13.com 2mo ago

The Maintainer's Dilemma

nickcw
4pts0
www.zdnet.com 2mo ago

First look at Googlebook: A premium Chromebook alternative for Android users

nickcw
2pts0
www.theregister.com 3mo ago

Apple's chips are the core of a new landscape, but its biggest win is Windows

nickcw
4pts2
github.com 7mo ago

Revisiting Forth after 40 years for Advent of Code 2025

nickcw
3pts0
www.theregister.com 11mo ago

Faced with £40B budget hole, UK public sector commits £9B to Microsoft

nickcw
5pts0
www.infoworld.com 1y ago

TrapC proposal to fix C/C++ memory safety

nickcw
1pts0
en.wikipedia.org 1y ago

Zen and the Art of Motorcycle Maintenance

nickcw
1pts0
www.nicholashairs.com 2y ago

Summary of Major Changes Between Python Versions

nickcw
84pts22
www.drleilamasson.com 2y ago

The Arsenic-in-Rice Scare – 5 years on

nickcw
1pts0
www.theregister.com 2y ago

Microsoft pushes Bing, GPT-4 in Chrome pop-up adverts

nickcw
69pts40
www.businessinsider.com 2y ago

Look at That: Google Has Become a Cable Company

nickcw
2pts0
academic.oup.com 2y ago

From Vexing Uncertainty to Intellectual Humility

nickcw
1pts0
www.sevangelatos.com 2y ago

John Carmack on static code analysis (2018)

nickcw
5pts1
www.theregister.com 2y ago

X confuses the masses by removing all details from links

nickcw
90pts76
www.theregister.com 2y ago

NASA bosses admit SLS is unsustainable and unaffordable

nickcw
2pts0
arxiv.org 2y ago

Smooth Subsum Search: A heuristic for practical integer factorization

nickcw
1pts0
github.com 3y ago

A new data structure for ordered integer maps

nickcw
2pts0
scholarlycommons.pacific.edu 3y ago

Euler Found the First Binary Digit Extraction Formula for π in 1779

nickcw
3pts0
skarlso.github.io 3y ago

Forming the habit of analog journaling – Why digital format did not work for me

nickcw
1pts0
www.bbc.co.uk 3y ago

Elon Musk set to become number-one influencer on Twitter

nickcw
5pts0
www.theregister.com 3y ago

Intel reveals pay-to-play Xeon features with software-defined silicon

nickcw
1pts0
ag1le.blogspot.com 3y ago

Training a computer to listen and decode Morse code (2019)

nickcw
2pts1
webbtelescope.org 4y ago

Webb's First Deep Field (NIRCam Compass Image)

nickcw
1pts1
www.coalfire.com 4y ago

Hacking Ham Radio: WinAPRS

nickcw
3pts0
www.vox.com 4y ago

WeWork co-founder Adam Neumann’s carbon credit crypto project sounds like a scam

nickcw
3pts0
xkcd.com 4y ago

Xkcd: Weird Unicode Math Symbols

nickcw
11pts3
phys.org 4y ago

Could gravitons be viable dark matter candidates?

nickcw
4pts0
www.tomshardware.com 4y ago

Wafer Scale Quantum Chip Prototype Delivers 1M Qubits by 2024

nickcw
1pts0
scitechdaily.com 4y ago

Using the Moon’s Orbit as a Powerful New Gravitational Wave Detector

nickcw
1pts0
swtch.com 4y ago

Toward a new systems programming environment – Russ Cox [pdf]

nickcw
24pts3

I had a look through the code to see how it manages not to use a pile of C libraries with cgo like other Go GUI libraries.

The answer is platform dependent:

Windows loads the relevant DLLs by hand and calls them. This is a well established technique in Go programs and due to the super stable DLL interface works well.

Linux has an x11 and Wayland backends and these implement (through a library) the wire protocols directly in Go which is nice and will make cross compilation and distribution easy.

macOS does appear to use cgo to access the cocoa libraries. macOS doesn't like statically linked Go programs anyway though as they don't use system name resolution so this isn't a bad compromise, but will mean macOS stuff needs to be built on macOS I think.

I didn't see Android or iOS support.

A nice innovative approach to GUI building. Since the lowest common denominator for the backends is an RGBA buffer, this will bypass all accessibility things the OS provides.

The above gleaned after a few minutes reading the source so may not be 100% accurate.

From the article:

This is essentially the observation Keyfitz made in his 1977 paper, “What Difference Would It Make if Cancer Were Eradicated?” Cancer is responsible for 18 percent of deaths, so does that mean eradicating it would increase lifespan by 18 percent, or around 13.6 years? Nope, Keyfitz says, it’s only 2.3 years.

A very interesting thought!

Show HN: 18 Words 13 days ago

I didn't realise at first that you could choose letters which weren't adjacent which made it very hard! Guess I've been playing too much https://zanagrams.com/ (which was also posted here recently).

The Droitwich transmitter used to transmit on exactly 200 kHz which I always thought was very cool, but it moved to 198 kHz in 1988 to better harmonize with European stations.

The program was mostly the same as BBC Radio 4 but it used to diverge at certain times of day. I used to be woken up at 5am every day by my parents clock radio with the farming news which was very dull, but easy to sleep through.

That is very very funny, and oh so plausible.

I enjoyed this bit a lot from the timeline

Karen Oyelaran finds the payload by reading the source code with her eyes and files a second issue. The triage assistant closes it as “duplicate of #8814.” Issue #8814 is a feature request for dark mode. Karen reopens it. The assistant closes it. Karen reopens it. Karen’s GitHub account is rate-limited for “patterns consistent with automated behaviour.”

And this - the final sentence is a perfect indictment of the timeline we are in.

Two AI review agents from competing vendors, both attached to a downstream pull request bumping foxhole-lz4, enter a disagreement loop over whether the package is malicious. After 340 comments and $41,255 in inference spend, Finance revokes both API keys; one vendor’s marketing team, cc’d on the cost anomaly alert, issues a press release citing “a 430% YoY increase in adversarial multi-agent security reasoning.” The stock opens up 6%.

I'm joining the goat farming waitlist ;-)

I love it :-)

Back in the distant past I wrote some really big ARM 32 assembly projects. 64 bit ARM is really very similar!

I had a look through the code. Some ENTRY/EXIT macros to help with the drudgery of save restore registers & stack frame would probably help. Also some register renaming would help readability (eg if a register points to incoming data throughout a subroutine rename it pdata).

I salute your effort and please enjoy the core dumps :-)

I have a copy of the shorter Oxford English Dictionary from 1970 which I inherited. It is two massive volumes and is only shorter in comparison to the full dictionary which is 12 volumes (more in more modern editions).

My shorter OED contains 163,000 words (compared to the 600,000 words of the longer).

According to this site I know 71,000 words... Let's test that against the OED. I should have about 43% chance if knowing a word picked at random.

In my totally scientific test (ha) I chose 50 words at random from the OED and discovered I knew 29 of them for a score of 58% which is more than two sigma from 43%, this disproving the hypothesis.

I forgot what that was now, but it was a fun experiment.

Ha ha! Yes I am in the weights apparently. Nearly all the models know what I do.

I suspect being in the Open Source world is a bit of a bubble as far as the weights are concerned.

Anyway it stroked my ego nicely even though it was totally artificial, like Zaphod Beeblebrox surviving the Total Perspective Vortex.

I'm not old enough to have used a PDP-11 so I read through the assembly code description with interest.

Wow, it seems so modern. I've used a lot of assembly languages over the years but I'd feel immediately at home here. Nice sensible orthogonal instruction set with enough registers and a stack pointer. It reminded me immediately of ARM assembly - what a breath of fresh air that was when it came it.

I never realised quite how much influence the PDP-11 had on computer architecture. I knew about it's software legacy but I suspect that was enabled by it's ground breaking architecture.

And so, because I don’t want to hold Fn every time I want to press an F-key for its intended purpose, I used the arcane shortcut Fn+Caps to “lock” the keyboard into “standard” mode, where multipurpose F-keys remain multipurpose F-keys unless I hold down the special magic button that transforms them into rarely-used single-purpose special function keys.

But here’s where the problem occurs. If the batteries get changed, or if the keyboard gets turned-off for an extended period, or sometimes – seemingly – just randomly… that function-lock gets switched off.

I have this problem with my Microsoft Natural keyboard; my favourite ever Microsoft product which helps me keep my RSI at bay.

Every now and again the Fn lock key gets pressed by accident. I then look very confused for some time as to why none of the Fn keys are working before I remember the dratted Fn lock key.

The Fn lock key is next to F12 so well in the range of accidental presses.

Maybe not many people drive their setup with function keys any more, I don't know.

Glad you enjoyed it :-)

If you want to see how the sausage was made, here is the source:

https://github.com/ncw/ioccc-gameboy

You'll find an unobfuscated version (kind-of) there too. This the the one I actually worked on then I had a program squash all the variable names and squeeze it into the gameboy shape

The size limit for the entry was the killer. You are allowed 2503 non white space characters (a simplification - the rules are complicated) in IOCCC entries and 4K total code size. This isn't a lot to fit a Z80 processor and a GameBoy hardware emulator in!

I first wrote a full Gameboy emulator in C. It started out at about 6000 non white space characters. I then spent about about 100 hours work trying to get it to fit into the 2503 limit. For a long time I wasn't sure it was going to fit.

I decided making the emulator play Tetris (which is a fairly simple game) was the target so I stripped out features like the half carry flag in the Z80 emulator and the windowing system in the Gameboy emulation which Tetris didn't need. I also abused the C code terribly doing things with implicit int I can never un-see. I also got creative with the IOCCC rules which are implemented in a C program which checks your source and I spent some time reverse engineering that looking for loopholes! I discovered that the operators defined in <iso646.h> only count for one token which was very useful.

Once I had it small enough I had to supply some games to run with it. I created 4, a test program written in z80 assembler, a pi calculator (written in assembler), a 3d tic tac toe game (written in C with gbdk-2020) and a chess program also written in C. I discovered that quite a few open source games ran on the emulator too so I added a downloader for those where I could. Apparently not many games use BCD arithmetic - who would have thought!

It was a fun project.

Link local addresses are exactly that. They don't route and they are for low level stuff like adding stuff to the routing table or BGP.

If you want to do this properly then you configure a Unique Local Addresses (ULA) out of the range fc00::/7. These are the equivalent of 192.168 or 172.16 or 10. and they can be routed.

Trying to run services on fe80: addresses is a mistake IMHO

That brings back fond memories of my first employer in the early 90s.

They used to rent a single scan line (VBI) of the TV broadcast to use as a data transmission method encoded the same way Teletext was. IIRC you could fit 45 bytes in a single scan line, with 50 per second that gives you a nationwide data broadcast capability of something like 18 kbit/s. We had a 19,200 bits/second leased line to send the data.

That scan line was really really expensive I seem to remember! If your TV wasn't quite adjusted properly you could see the data scan lines at the top of the screen as flickering white dots and lines which was fun.

The data got sent to financial institutions for real time stock feeds and nationwide networks of shops.

I never worked on the code for that part of the business though - I worked on the replacement system which ran via satellite with much more bandwidth at much lower cost.

Eventually the internet killed that too :-)

I found a similar vulnerability in the Zeus Web Server ( https://en.wikipedia.org/wiki/Zeus_Web_Server ) in January 2000.

Zeus had a great feature where you could set up virtual servers just by creating directories. So if you wanted to host www.example.com and www.anotherexample.com you just created two directories of those names like that and away you went.

I discovered that the if you sent `Host:` headers which started with `/` then you could use it to traverse the file system and read any file you wanted.

Plus ça change, plus c'est la même chose!

If you read the advisory and are wondering what starlette is, from it's web page: starlette is a lightweight ASGI framework/toolkit, which is ideal for building async web services in Python.

It's used a lot in the data heavy AI world for it's efficiency shipping large files. This includes lots and lots of production servers.

From the advisory: this includes LLM inference servers like vLLM, LLM proxy servers like LiteLLM, AI agent frameworks, MCP gateways, and custom APIs. MCP servers are especially at risk because the MCP spec mandates unauthenticated OAuth discovery endpoints, providing a reliable path for exploitation.

Go doesn't have colored functions due to its nice fat runtime hiding all the async magic away for us.

That makes it a pleasure to code concurrent stuff for IMHO.

It does have its own similar problems though - does a function return an error? If so you are going to need to plumb the error return through all the callers. Does a function need a context.Context? Ditto.

I guess you can't win them all :-)

LLMs are very prone to priming in my experience. That is the human psychology name for what you are describing; whether it should be applied to LLMs I don't know, but it describes the phenomenon perfectly.

I just merged a commit for exactly this in rclone

https://github.com/rclone/rclone/commit/ad8a108453f3ce983fb6...

It is interesting to dig into why.

There was a security vulnerability in golang.org/x/net/http2/h2c which meant govulncheck warned about it in the CI.

So I updated it and got a warning from the linter that the h2c sub package was deprecated in the latest version, so I removed it.

That is a lot of great tooling working to make things more secure in the Go ecosystem.

It does make work for maintainers though, and the Cambrian explosion of AI discovered security vulnerabilities has been particularly trying!

Great demo! Very interesting to see that if you wiggle the hunter (1) back and forth the accuracy improves.

I think this is expected but interesting to see as you see humans and animals doing exactly this to better gauge how far away something is.

The accuracy also improves (but not as much) if you wiggle the target (2) back and forth which I wasn't expecting.

The Z80 spawned the 64180 which was a Z80 with loads of stuff built in (from Wikipedia)

Execution and bus access clock rates up to 10 MHz

Memory Management Unit supporting 512K bytes of memory (one megabyte for the HD64180 packaged in a PLCC)

I/O space of 64K addresses

12 new instructions including 8 bit by 8 bit integer multiply, non-destructive AND and illegal instruction trap vector

Two channel Direct Memory Access Controller (DMAC)

Programmable wait state generator

Programmable DRAM refresh

Two channel Asynchronous Serial Communication Interface (ASCI)

Two channel 16-bit Programmable Reload Timer (PRT)

1-channel Clocked Serial I/O Port (CSI/O)

Programmable Vectored Interrupt Controller

As a consequence it was really popular in the 90s as an embedded processor just when I was starting my career. This lead to me writing thousands of lines of Z80 assembly. You could program it in C but the compiler was useless at making stuff go fast.

One of those things I wrote was an LZ77 decompressor used in a satellite broadcast system. It took me about a week to write it, test it and optimise it. Quite a challenge! I remember optimising it about the LDIR instruction to copy memory.

The compressor was written in C and ran on the PCs of the day.

Ha. When I was a teenager I used to build 555s into timers for the same purpose using a no PCB rats nest construction.

Though surprising the family at dinner with a small explosion was a much more innocent purpose.

I love photorec and dd rescue. I have recovered many many disks and memory cards with it.

I even recovered a card that had been off to professional recovery and deemed unrecoverable. I think half the memory chips in the card were fried so I used DD rescue to recover what data I could and then photorec to sift the wreckage. The owner was delighted to receive some of the photos.

If you ever have to do this, use DD rescue to image the source media as a first step. Sometimes you don't get a second read!