Better HN
topnewbestaskshowjobs
Log inSign up

creata

2,965 karma · joined Sep 19, 2020 (6y ago) · 1,349 submissions

only a fool would take anything posted here as fact
Submissions

comment 3w ago · link · parent

If you're going to ask Claude to write a library with a web version, can you also ask Claude to write a web playground?

comment 4w ago · link · parent

I don't think so. In both Rust and C, the solution is the same - make the function explicitly fallible, instead of trying to preserve backward compatibility. In C, the function would probably just look like this, returning zero on success and negative on failure:

    int crypt2(const char *phrase, const char *setting, char *out);
You can call such a signature "insane" if you want, and that's fine, but it would have averted the bug that is the topic of discussion.

comment 4w ago · link · parent

I don't think so. Even in a language with a good type system like Rust, somebody could have made this API:

    /// Hash the phrase with the given setting.
    fn crypt(phrase: &[u8], setting: &[u8]) -> [u8; CRYPT_OUTPUT_SIZE];
Then, in a later version, `crypt` needs to become fallible, so they need to signal errors somehow. But because they really want to preserve backward compatibility, they can't change the output type to `Result<..., ...>`. And so they end up doing the same thing that was done in libcrypt - they output some error value and hackily make sure it's not equal to the `setting` string, under the mistaken assumption that the output of `crypt` would only ever be compared to the `setting` string. And then someone creates the exact same bug.

Maybe I'm wrong, but it looks to me like the exact same incentives and means to screw things up exist in C and in Rust for this particular bug.

comment 4w ago · link · parent

I don't think that's the problem. The man page for crypt clearly says that erroring is a possibility and that it's not standardized how it errors:

> The behavior of crypt on errors isn't well standardized. Some implementations simply can't fail (except by crashing the program), others return a null pointer or a fixed string. Most implementations don't set errno, but some do. POSIX specifies returning a null pointer and setting errno, but it defines only one possible error, ENOSYS, in the case where crypt is not supported at all.

In my opinion the problem is that the behavior of crypt is underspecified - it isn't even specified how it signals failure, which is shocking.

Another disturbing decision that crypt's signature takes in the hash its output is supposed to be compared against - if it weren't for that, this half-baked "on error the output won't compare equal to the input" measure that crypt and crypt_* use wouldn't have been possible.

You can't check errno to see if there was a failure because, as the man page says, the value of errno is unspecified when crypt succeeds.

comment 4w ago · link · parent

> One of the small but important significances of Rust is that it very often gets to have the same machine code as a correct "in-band error signalling" strategy from C but with source code that the maintainers can actually understand.

But aside from NonZero- and NonNull-based layout optimizations, I don't think Rust is doing anything special to obtain that machine code - it's just relying on LLVM to optimize things.

comment 4w ago · link · parent

It is extremely unidiomatic to use tagged unions in C for error handling. It's definitely possible, but awkward, and the compiler doesn't check that you checked the tag.

comment 4w ago · link · parent

Decades of human research and mountains of work used without permission. Not that they legally did or didn't need that permission, but ethically, kind of a dick move.

comment 4w ago · link · parent

If a coding agent is writing code for you, telling it what language to use is micromanaging. It might use Rust, it might use C++, it might use both. If it's writing the code, it probably has a better idea than you have for what's appropriate for that code.

comment 4w ago · link · parent

The Wikipedia page of PyTorch does list C++ as a language. And you can just check the code. It's C++.

comment 1mo ago · link · parent

But you haven't linked those details about the training process with "AI won't replace software developers".

comment 1mo ago · link · parent

I often wonder why someone would write comments like yours. Who are all these people itching to bat for AI, and why do they always seem so aggressive and personally invested in it?

comment 1mo ago · link · parent

Condescension aside, why are you tying their hands like that? If a manager wants to replace a human with an LLM, they're not going to limit it so much. They're going to give it access to everything they can.

comment 1mo ago · link · parent

Unlike Postgres, the average product isn't written in C or C++, so it's probably better. People (even the Rust fans) underestimate how many footguns are everywhere in C and C++. Even the best developers write security bugs not infrequently.

And the average product is solving much easier problems (in terms of low-level programming, which is where the worst bugs tend to be) than a high-performance database.

comment 1mo ago · link · parent

How do you expect mathematicians to "embrace" OpenAI having unreleased models that are much better at solving big-ticket problems than they are?

Maybe some math departments could pay OpenAI for access to their models, but I doubt OpenAI would want to deal with most of them.

comment 1mo ago · link · parent

> The coding is the intellectual work!

Yes, and the machines can do intellectual work now.

It's funny to see some commenters here cheer as the leopard eats the mathematicians' faces, when we can all see that the software developers are next in line.

comment 1mo ago · link · parent

> Even the security argument has evaporated: AIs now hack better then people.

They hack better (faster, at least) than humans if you have thousands of dollars to spend.

Can you afford to spend that money regularly pentesting all the code you have your AI to write for you, though?

And if you can't, then what link is there between being good at hacking, and being good at writing secure code?

(Those aren't rhetorical questions.)

Another one: When will Bun (at this point a mostly Claude-written project, managed by Anthropic themselves) become at least as secure or reliable as Node.js (a mostly human-written project)? If you're right, it should be any day now. And maybe you are right - maybe by tomorrow Claude will have written a formal proof that Bun is memory-safe and it'll never segfault again.

comment 1mo ago · link · parent

I'm confused by the scenarios in this thread. How is the machine on the other side receiving this information? How is it measuring voltages on the mains supply, or receiving radio waves emitted by RAM?

comment 1mo ago · link · parent

> Bots can use async or virtual threads and not even have to hold on to a stack while they are waiting for this bullshit, clicking on buses, etc.

Don't the bots still need to do the proof of work for Anubis? They can't "async" their way out of that work.

> Another web is possible but web populists don't really believe it.

How? Sharing knowledge with the world used to be an obviously good thing. Now it's a way to help tech companies replace people with machines. What alternative web could change this state of things?

comment 1mo ago · link · parent

> Not to sound snarky but why don't you go outside and meet people, exercise, play sports, explore nature?

For many people it's shame. Feeling like you're mentally a child while everyone around you is an adult can't be a good feeling.

comment 1mo ago · link · parent

They've already "checked out" in reality (NEETs, etc.) but they're still "lowest on the totem pole". The people who feel superior to them seem content to do so from afar, to belittle them from the comfort of social media.

comment 1mo ago · link · parent

> Whoever is in charge could try to drag those people back into the real world by force

But why would you even want that? They like it in the simulation, and nobody really wants to deal with them outside the simulation.

comment 1mo ago · link · parent

> Why is cooking enjoyable?

Maybe it's about the joy of learning something new every time you cook. Having Michelin star restaurants in your neighborhood would add to that joy, not take away from it.

> I would like to believe that many people will still choose reality and real relationships.

Why would you like to believe that?

comment 1mo ago · link · parent

> what GenZ is doing these days is professional complaining

We are watching machines rapidly match and surpass humans at countless skills that were considered uniquely human mere months ago - skills that demanded a lot of creativity and insight. Some of our oldest fields of study (e.g., mathematics) are turning into a game of who can spend the most tokens.

I think the humans are entitled to complain a little.

12345
45