HNHacker News
TopNewBestAskShowJobs

SkiFire13

2,091 karma · joined March 10, 2021

submissionscomments
SkiFire13··on Reducing undefined behavior in the C language
> But I want to have loud warnings! Like WARNING: this conditional operator has been collapsed to one branch because earlier division by zero is UB.

What Every C Programmer Should Know About Undefined Behavior https://blog.llvm.org/2011/05/what-every-c-programmer-should...

SkiFire13··on Why isn't the industry freaking out about DeepSeek 4.1 Flash?
> The reason people aren’t freaking out is because most people are using heavily subsidized subscriptions.

My understanding is that enterprise plans don't offer those subscriptions, so they end up paying for API prices and models like these directly impact that revenue stream.

SkiFire13··on Reducing undefined behavior in the C language
> C is just "high level assembly" for systems programming

It is not, and that's the issue. If it was just "high level assembly" there would be no UB, and no need to have UB. Instead you have UB (although arguably not all of it is really needed) because you need optimizations, which in turn you need because otherwise C would be too slow for that "operating system" job.

> code which is called thousands of times per second

Scripting languages can easily have loops running thousand of times per second and even more. You're off by some order of magnitudes here if you want to describe operations that happen in operating systems.

SkiFire13··on Emitting metadata early makes building/checking Rust up to twice as fast
Two reasons:

- It would have been very annoying if it didn't work like this

- Auto-traits also leak through private fields, so you would have the same issue if you e.g. wrapped the concrete return type in a new type and returned that one instead.

SkiFire13··on Emitting metadata early makes building/checking Rust up to twice as fast
I wonder how this works when a crate's type checking does indeed depend on the bodies of one of its dependency. For example `-> impl Trait` return types famously leak the `Send`/`Sync`-ness of the type, so for type checking their uses you first need to resolve the concrete type behind and hence type checking the body of the function, which seems to go against the core idea of this proposal.

I guess you could type check the bodies of only these functions, or duplicating this work in the dependencies, but this will likely have further complications especially since this will also apply to all `async fn`s.

SkiFire13··on Emitting metadata early makes building/checking Rust up to twice as fast
Rust's AI policy does not strictly forbid AI generated code, but it does require it to be used in a kind of responsible way. What that means though it pretty abstract even to me.

As for whether this change will make it in, the devil is as always in the details and will depend on whether this solution can work for all the edge cases in the language.

SkiFire13··on Updates to Full Disk Access in macOS
That doesn't change the point. Sure, iOS is technically more secure, but it's also increadibly nerfed compared to desktop OSes.
SkiFire13··on Updates to Full Disk Access in macOS
> I think you need to move to a completely different model—like iOS for example—to meaningfully improve security controls without nerfing the OS.

How is moving to iOS's model not nerfing the OS?

SkiFire13··on Anatomy of a Lean proof for software engineers
> Surely “the proof is the one you think it is” is the whole ballgame?

No, the important part is that the proof is proving what you think it's proving, meaning you only care about the statement being proved (i.e. the signature/type of the proof term), not the proof itself. Generally the statement will be much smaller than the proof, so manually checking it (or manually writing it) is much more viable than checking/writing the proof.

> I have installed a Lean environment and it seems trivial to misname something, to mistake the order of arguments, to compare to the wrong value. There are infinitely many Lean programs that check but don’t do what they say they do, like every other language.

Sure, that's why you have the check that the statement being proven is what you want it to be. Then any error in the proof _will_ be captured by the type checker.

SkiFire13··on Anatomy of a Lean proof for software engineers
> inspect that code and come to the conclusion that it is faithfully reproducing the exact chain of proofs we think it is

The point is that you don't need to do that. It shouldn't matter whether the proof is the one you think it is or not, only that it is a proof.

> that has literally zero bugs, however strong the type system of the language it’s writing in.

If by "bug" you mean a logic error that makes the proof invalid then Lean will catch that. Some code successfully type checking in Lean is a guarantee there are no such "bugs" (modulo bugs in Lean itself, but Lean is human written, the core is rather small, and most of it was manually proven to be sound).

SkiFire13··on Banks and Credit Unions to Team Up Against Apple Pay Fees
See "What do Visa and Mastercard do?" https://news.ycombinator.com/item?id=49614280

It's not something irreplaceable but it's not trivial either.

SkiFire13··on Postgres SELECT DISTINCT Does Not Scale
The manual workaround is even documented in postgres' wiki https://wiki.postgresql.org/wiki/Loose_indexscan
SkiFire13··on Postgres SELECT DISTINCT Does Not Scale
> Why don't he use GROUP BY on indexed columns was my first thought also.

Because it has the same issue.

SELECT DISTINCT and GROUP BY are equivalent from a query planner perspective.

SkiFire13··on Swap, ZRAM, Zswap and Hibernate on NixOS
Is this considering RAM for disk cache too?
SkiFire13··on More floating point alternatives
> That makes me think that I can just plan ahead by storing the number of cents instead of dollars

That's what is generally suggested when handling money, at least for normal businesses (in finance related businesses you might have to handle a lot more decimal places for things like exchange rates, fractions of cryptos etc etc)

Be careful though that some currencies require more than 2 decimal places.

SkiFire13··on Will Open Source Survive the Agents That Replaced It?
> This week I replaced my home security camera system with open source Frigate, because I was able to use AI to take the source code, replace the object detection models that were included with the code with something that was a better fit for my machine, customize how the videos were stored and under what circumstances. There's a lot more that I can do with it that I haven't yet as well. > > I couldn't do that with the proprietary system.

You also didn't give anything to opensource. This shows that AI can allow open source to be used in more cases and in more flexible ways, but in no way does this mean that open source (and especially the good high quality one) will explode.

If anything we saw an explosion of open source projects, most of them low quality slop, and even the ones that used to be high quality are slowly degrading.

SkiFire13··on More floating point alternatives
> Another way is to think of it as an interval of real numbers between the next lowest and highest intervals. Under this latter interpretation, it makes sense to discuss shortest decimal string within the interval, 0.3 in this case.

Note that the result of 0.1+0.2 does not lie in the interval containing 0.3, which is was confuses most people. The issue is that there is some imprecision in representing 0.1 and 0.2 too, and that compounds when summing, resulting in something that does not actually correspond to 0.3 (hence the classic 0.1+0.2!=0.3)

SkiFire13··on More floating point alternatives
> deterministic answers

> 0.2+0.1

0.2+0.1 with floating point numbers _is_ deterministic, as you'll always get the same answer.

I suspect you might instead mean exact calculations/answers (in the example above, neither 0.1, 0.2 nor 0.3 have exact representations using floating point numbers).

And just to be clear, there are non-determinism-like issues with floating point numbers, but those are much rarer/niche and _can_ be fixed. For example parallel summation depends on the order the summation was made, so non-determinism in the parallel implementation ripples through the summation result. Some non-basic operations (e.g. trigonometric operations) have platform dependent implementations with different roundings, so you might experience different result based on the platform you're on.

SkiFire13··on In September, AI generated code has made up 17.25% of all Linux Kernel patches
> with AI it can be done cheaper and faster

And they are probably right. But they are probably also missing that this will translate to worse quality. You know, the classic "you can only pick two among good, cheap and fast"

SkiFire13··on The Google Play app review process now regularly takes longer than a week
> usually within 24 hours

I have never seen Apple approving within 24 hours

SkiFire13··on Stabilizing Rust's Never Type
Not only that, if you have `trait Foo: Iterator<Item = u8>` and `trait Bar: Iterator<Item = i32>` how could `!` implement both of them? It would simply make the language incoherent.
SkiFire13··on GrapheneOS' rewritten Messages app is released
Both are for for different niches, but their intersection is relatively big.
SkiFire13··on Neki – Sharded Postgres
That page doesn't mention how joins between tables using different split keys work, or how indexes work.
SkiFire13··on Blizzard Workers Win Historic Union Contract
Remember that correlation != causation.

They might also have unionized due to the bad conditions while developing GTA 6, which could also lead to it being a bad game. Who knows though.

SkiFire13··on What do Visa and Mastercard do? An intro to card networks
I reached the midpoint of the podcast without seeing a proper argument against this then I gave up.

It tries to argue that higher reward rates are necessary to attrach customers that pay a lot (for credit card companies) and that lower income people are generally subsidized by taxes (obvious but unrelated), but at no point (until where I read) it seems to address the issue of merchants having to generally increase prices due to these cards.

SkiFire13··on What do Visa and Mastercard do? An intro to card networks
> credit card providers

The article did an awesome job explaining what are the parties involved and you choose to use a generic term instead.

> dealing with fraud and chargebacks

A lot of that is offloaded to the merchant, which instead has to pay them on top of what they already pay to the issuer bank.

SkiFire13··on Alberta (Canada) slaps punitive tax on solar panels
> it’s a $14 fee per solar panel

Note that usually you mount many solar panels, not just one, so this will stack relatively quickly.

SkiFire13··on Visualizing Rust's Vtables: How dyn Trait Works In Memory
The vtable contains at least the following informations:

- the size of the pointed type - the alignment of the pointed type - a function pointer for its drop glue

That's already quite big to inline to save on indirection, and this is before adding more methods.

SkiFire13··on Visualizing Rust's Vtables: How dyn Trait Works In Memory
> for some reason

Just to expand on this: which vtables will be needed is not known before running codegen. At that point however multiple codegen units might generate the same vtable, and that might not get deduplicated by a later pass.

Moreover with dynamic linking (especially on Windows) it's impossible to guarantee that such vtables will be unique.

SkiFire13··on Visualizing Rust's Vtables: How dyn Trait Works In Memory
> This is possible in C++ too, but it may require extra work.

Everything is possible, what matters is how much work you have to do to achieve and maintain it.

> You have identical memory overhead in Rust and C++ if you store a single pointer to a polymorphic object. But if more than one such pointer is stored (if it's shared), Rust uses more memory, since it stores N virtual table pointers (together with each object pointer), where C++ stores exactly one virtual table pointer within the object itself.

On the other hand Rust uses less memory if you store 0 polymorphic pointers, while C++ still pays the cost of storing a vtable pointer for each object instance.

Effectively C++ choose a design that optimizes for having a lot of polymorphic pointers, while Rust optimized for supporting polymorphism for all objects at no extra cost if you don't use it.

← PreviousPage 3 of 31Next →