HNHacker News
TopNewBestAskShowJobs

becurious

148 karma · joined October 16, 2020

submissionscomments
becurious··on Electric mountain: Power station that shows the beauty of infrastructure
You could also visit the Wylfa nuclear plant on Anglesey. Not sure when tours stopped (probably due to security) but you could see the reactor. All closed now.
becurious··on Atlassian Acquires Loom
I used to do that but you can record screen video with the Snipping Tool now. Works fine, mp4 file as output.
becurious··on What it takes to pass a file path to a Windows API in C++
When it was designed there was no UTF-8. You had to know the code point; and file systems like FAT did not encode the code point, so file names would be interpreted by whatever the current code point was.

So having a file system and other APIs support Unicode natively made a lot of sense at the time; it simplifies many things including deploying into organizations that have global users. This is now over 30 years ago. And the A vs the W suffixed APIs were not simple ascii; they were multi-byte, so to work with strings you still had to know the code page. Obviously UTF-8 is much simpler for that now, but that wasn’t the world when this was designed.

becurious··on GitHub Actions could be so much better
You’d think they could at least train GitHub Copilot to test run the workflow and point out immediate issues.

We have to add an action to kill duplicate runs on triggers.

The caching is marginal, at least on Windows runners because it takes forever to expand the tar ball. Not even sure from their docs / issues on the cache action if they did finally move it to use GNU tar.

Having some way to get an interactive shell on fail would be a big step up for debugging issues. Otherwise we are back to print debugging in the actions or uploading artifacts at each step so we can inspect them.

becurious··on New images and video confirm Austin-made Tesla model Y has cracked front casting
Would a part like this get x-ray inspected? I had a summer job working at a machine shop and structural castings would often get sent for x-ray inspection.
becurious··on 5 years ago Valve released Proton
You’re confusing a distribution with an ABI. They are not the same thing. Totally different philosophy.
becurious··on 5 years ago Valve released Proton
No, they don’t. They may bundle additional DLLs but all those DLLs call the win32 APIs.
becurious··on Assembler on Raspberry Pi
SWI is just software interrupt. Gets trapped by supervisor mode. Then the registers can be decoded by the kernel to implement the correct syscall. Old school real mode x86 equivalent would be an INT instruction.

If you want to do straight to the hardware bare metal then you need to do something like this (https://www.rpi4os.com/part5-framebuffer/) but you’re going to have to do all the other system init work that a modern system needs. Old computers were simpler!

becurious··on Assembler on Raspberry Pi
Direct to the hardware would be initializing the frame buffer and writing there. Which means that you need to have all the glyphs and then look them up and write them into the frame buffer.

This is what we used to do with 8 bit computers that didn’t have a hardware text mode. You might be able to look up the bitmaps in the ROM, otherwise it’s time to define them all yourself.

Using a direct system call would be like calling a ROM routine or an OS routine to print characters. You’d either call the routine or invoke a software interrupt.

becurious··on Chuck E. Cheese's 1982 Annual Report For Kids [pdf]
Being called Randolph would be worse.
becurious··on Windows 11 Insider Preview Build 25905 brings a bit of Rust in the kernel
WIL is user mode, for applications. Drivers will use Kernel Mode Driver Framework or User Mode Driver Framework. UMDF has a COM style API.

C++ has been usable in the Windows kernel for a long time but you need to make sure that code ends up in the correct PE segment types for pageable and non pageable code and that there are no hidden gotchas for features like exception unwinding and that new can use paged or non paged pool appropriately. Same for Rust: getting to a nostd etc that is compatible with kernel use.

I think there’s a strong case that many drivers could be written with either a user mode driver framework or a small VM. Most of the hardware devices I’ve worked with we just need fast transfers of data to user mode buffers so our application can handle it, and the code is mostly boilerplate framework code plus setting up device registers to set up DMA transfers. I don’t see why that couldn’t be handled with say an EBPF or WASM equivalent byte code.

becurious··on Threads: The BBC drama which affected a generation of viewers
I think the woman urinating (she was on The Moor I think) was when RAF Finningley was nuked first, but I don’t remember for sure. It is one of the abiding memories from it. I was only about nine when it was shown and only got to watch half of it. It was so bleak, and worse for living in Sheffield. I watched it all about ten years ago and it is still absolutely horrifying.
becurious··on Rivian embraces Tesla's charging standard for EVs
But you would charge overnight, when the Air conditioner isn’t running.
becurious··on California bill would require high schools to hand out free condoms
It’s not, because like compliance with taking say a contraceptive pill, people don’t manage to abstain. They get caught up in the heat of the moment, or pressured, or a thousand other things.

When you compare to other methods of birth control, it’s not effective for teens.

becurious··on The British computer magazine cover tape
If I remember correctly when the 128K Spectrum came out they changed some bytes in the top end of the 16K ROM that had been used frequently by games as an Interrupt Mode 2 vector table (point I register to be the high byte of the address) so that they could page in and out between the old and new ROM.

Elite was affected so Firebird (subsidiary of British Telecom) would let you get a new tape that fixed this bug but it also removed the LensLok protection code.

becurious··on The British computer magazine cover tape
LensLok!

http://www.computinghistory.org.uk/det/56946/Lenslok-Softwar...

Trying to play Elite on Christmas Day and repeatedly failing to enter the correct two letters!

becurious··on How Async/Await Works in C#
The message map macros were the equivalent of the switch statement in a WndProc. They couldn’t add every Windows message as a virtual override because every derived class would have needed thousands of vtable entries. At the time memory was still very limited (4MB systems for Windows 95 and they also had support for 16 bit Windows where it would have been even worse).

Also the template support in the compiler was limited at the time. Later on there were other libraries that used templates like ATL and WTL.

You did get a lot for free from MFC when implementing document editing applications for OLE support, but that was an increasingly small portion of development.

I think Borland went a different way with compiler extensions for producing a Win32 application with their OWL library.

becurious··on 3dfx: So powerful it’s kind of ridiculous
It’s a COM based API and so everything is an interface described via an IDL. You add a new member or change the parameters to a method, you must create a new version of the interface with a new GUID descriptor. You can query any interface for other interfaces it supports, so it’s easy for clients to check for newer functionality on incremental versions of DirectX.

In practice for DirectX you just use the header files that are in the SDK.

becurious··on Inmos and the Transputer (1998)
Worked with a transputer based piece of life sciences instrumentation for a few years. The way you could pass program code over the links to boot each transputer was neat. The people procuring parts (not just the transputers but also the parallel to serial transceivers) must have done some epic work to find parts once Inmos was defunct. We did a project to make a USB to Link protocol interface once the ISA bus became less available and this also saved a transputer that was on the ISA card that did nothing but route messages to the transputers on the instrument.
becurious··on Faster than the filesystem (2021)
Zip stores all its metadata at the end of the file.
becurious··on The Windows Subsystem for Android now runs Android 13 in beta
Project Astoria to allow Android apps to run on Windows Phone. Though WSL2 is not a classic NT kernel subsystem in the way WSL1 was.
becurious··on Ask HN: Have you “downgraded” from 2 monitors to 1, and if so, why?
Dell 38 UltraWide at work and a 40 at home.

I used dual monitors back from when it first became an option with 17” CRT monitors 25 years ago but you end up with a primary monitor and then other apps off to the side. The UltraWide is just easier - I can snap code and docs side by side, or two windows of code, or I can have code centered and in focus.

It’s not really a ‘downgrade’ because it’s considerably more expensive than two separate monitors but the ergonomics are so much better.

becurious··on A secret Apple Silicon extension to accommodate an Intel 8080 artifact
You’re going to love the ARM64EC ABI target on Windows.
becurious··on ZX Spectrum BASIC programming (1983)
The description of the trig functions on page 69 taught me those way before we encountered them in school.

The manual has those clear memory maps and it even describes the way numbers are encoded in the tokenized BASIC program memory, with the exponent sign and mantissa encoding. This really was a remarkable book.

becurious··on Ask HN: What software do you miss that no longer runs on modern hardware?
Being able to directly access sectors of a floppy disk on Windows. You could to this and read floppies with different file systems. Went away somewhere around Windows 2000 and modern external USB floppy disk drives just implement mass storage device class and you can’t access sectors or differently formatted drives.
becurious··on Simulating protected mode in the Z80 [video]
Using M1 plus the address lines was used to trap on certain addresses on expansion devices for the Spectrum such as Interface 1 or the +D. Then they’d use a line on the expansion bus to disable the standard ROM and substitute their own ROM / static RAM until some other trigger such as an OUT to a port would page the ROM back in.

I guess it’s a short step to looking up memory addresses against a bitmap for validation. I couldn’t tell from the video if this is what he did. Cutting the addresses into pages would let you save or add more levels and I guess you could implement a TLB similarly.

becurious··on Ask HN: Have you ever heard of users demonstrating against software?
Diversion of painkillers is unfortunately a thing and so those are often now in computer controlled cabinets that track dispensing. It’s the right thing to do because if a HCP is doing this they need help.
becurious··on Why modern software is slow
Scanning for id3 tags at the end of files in case they’re mp3? Except doing it by scanning from the start rather than seeking from the end?
becurious··on It's time to halt starting any new projects in C/C++
I tried to spin up a project with the Microsoft Rust bindings but for what I needed (DirectX12) there’s a lot of necessary helpers in the header files that haven’t got ported over there. And working from one of the samples it was nowhere near as reliable as the C++ version. Beyond ‘oh the C++ code isn’t catching errors’ - every HRESULT was checked as it was using the WinRT bindings.

Kenny Kerr has done an excellent job with both the C++ and Rust bindings, but the Rust one isn’t there yet.

What I’d like to see is more use of a WinMD style metadata for the ABI for functions in DLLs you create. It would be quite simple to define a Span type that could then be imported and called safely from a diverse range of FFIs. I really shouldn’t be having to declare the ABI all over again with ctypes in Python.

becurious··on Someone’s Been Messing with My Subnormals
Had this exact same problem. It was a specific color inkjet driver doing this, my guess is to enable dithering or something similar. It’s one of those things that infects everything in the code base because the way you print with GDI is to progressively draw parts of the page - so you have to call in and out of code that talks to the printer DC. We also had to render one item using Direct3D retained mode and that added to the fp control word complexity. Things seemed to be more robust on NT based OSes.
← PreviousPage 2 of 3Next →