Recent submissions

Comment · 6 years ago
Comment · 6 years ago
Also 0% with asthma, obesity, diabetes, etc.
Comment · 6 years ago
This is true for an isolated rural business.

In other cases, a business benefits from having customers park at neighboring businesses. If parking is provided, it will be taken by customers of other businesses.

Comment · 6 years ago
Your proposal does not work, at least when making the declarations binary compatible with older code.

Note that C is a pass-by-value language, so passing an array means that the called function can modify the content without the modifications being seen in the caller.

To sort of pass arrays in an ABI-compatible way, the version for older code would require putting the array inside a struct.

Even that doesn't fully work with any ABI that I've ever heard of. The struct doesn't really get passed. Disassemble the code if you have doubts. The caller allocates space for the struct, copies the struct there, and then passes a pointer to the struct. From the high-level view of the language, this is passing the struct, but the low level details are actually wrong.

Comment · 6 years ago
Those types should not be optional. CHAR_BIT needs to be 8. It is clearly possible to implement the types even on a 6502 or Alpha. From the early days of pre-ANSI C, the language supported types for which the hardware did not have appropriate word sizes. There was a 32-bit long on the 16-bit PDP-11 hardware.

I would go beyond that, requiring all sizes that are a multiple of 8 bits from 8-bit through 512-bit. This better supports cryptographic keys and vector registers.

Comment · 6 years ago
A horrifying case was multiplication in an x86 emulator. The opcode handler needed to multiply a pair of unsigned 16-bit values, then return a 64-bit result.

The uint16_t got promoted to an int for the multiplication, causing undefined behavior. (if I remember right, the result was assigned to a uint16_t as well, making the intent clear) The compiler then assumed that the 32-bit intermediate couldn't possibly have the sign bit set, so it wouldn't matter if promotion to a 64-bit value had sign extension or zero extension. Depending on the optimization level, the compiler would do one or the other.

This is truly awful behavior. It should not be permitted.

Comment · 6 years ago
It could be for function pointer type compatibility.

There is an array of pointers, or there is a callback interface, or something like that. The type is set in stone.

Comment · 6 years ago
C currently replaces my use of an array with a pointer. This sucks, because I'd have taken the address if I wanted that.

Your proposal replaces my use of an array with two things, a pointer (as before) and a length. This is not too helpful, because I already could have done that if I'd wanted to.

What is missing is the ability to pass an array. Sometimes I want to toss a few megabytes on the stack. Don't stop me. I should be able to do that. The called function then has a copy of the original array that it can modify without mangling the original array in the caller.

Comment · 6 years ago
C has strayed very far from the original intent because compiler authors prioritized benchmark results at the expense of real-world use cases. This bad trend needs to be reversed.

Consider signed integer overflow.

The intent wasn't that the compiler could generate nonsense code if the programmer overflowed an integer. The intent was the the programmer could determine what would happen by reading the hardware manual. You'd wrap around if the hardware naturally would do so. On some other hardware you might get saturation or an exception.

In other words, all modern computers should wrap. That includes x86, ARM, Power, Alpha, Itanium, SPARC, and just about everything else. I don't believe you can even buy non-wrapping hardware with a C99 or newer compiler. Since this is likely to remain true, there is no longer any justification for retaining undefined behavior that is getting abused to the detriment of C users.

Comment · 6 years ago
This is about gain-of-function research that the USA stopped in 2014 for safety reasons.

Gain-of-function is adding features to viruses. A goal of her research was to add functionality to coronaviruses that could infect humans. With funding stopped in the USA, she moved to Wuhan to continue her work.

The timeline runs for years, right up to December 2019. It includes a SARS coronavirus escape in 2017 that was caused when lab workers failed to properly inactivate the virus before taking it out of the BSL-4 high-containment facility.

Comment · 6 years ago
Any stay-at-home order which stopped religious services would be found in violation of the US Constitution's first amendment. It's possible a judge would throw out the whole stay-at-home order. To have a stay-at-home order that survives in court, exempting religious services is necessary.
Comment · 6 years ago
Were you required to remove stars already on the resume? If not, then I know just what to do.

Where on my resume should I put the two stars? Are those the traditional hand-written style, with the lines crossing to make a pentagon in the middle? What sort of pen or pencil should I use?

Comment · 6 years ago
Perhaps so, but:

The new ventilators might not last. They might be banned due to low quality after the emergency passes. Some will be damaged by use. Parts might become unavailable.

New companies may enter the ventilator business. We still have the ventilator business, even if the companies change.

The demand might remain high. The disease could stick around. This isn't the first respiratory disease to start spreading right next to a Chinese biohazard lab, and likely won't be the last.

Comment · 6 years ago
The equipment is excellent for the other diseases it can test for. I think the numbers I saw earlier today were 95% sure for negative and well over 99% sure for positive, but I can't find that source back anymore. Numbers for this specific virus would be poorly understood, but ought to be similar to the numbers for other viruses.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton