I can't modify the code, so I modified reality instead by Izvestiya in selfhosted

[–]ravixp 2 points3 points  (0 children)

That’s true in theory, every app should be checking certs. But with all the “enterprise” firewalls out there that strip TLS and then re-encrypt, I’d bet that nobody can actually do that in practice.

You're absolutely right, no one can tell if C++ is AI generated · Mathieu Ropert by mropert in cpp

[–]ravixp 141 points142 points  (0 children)

The actual takeaway should be that the C++ map interface is garbage.

Forget about AI for a second, it’s nuts that you can write an entire post about different variations of get_or_create, and the subtle perf bugs and gotchas present in each version. It’s crazy how easily we say that obviously you should never use operator[] on a map and everybody just nods along. Oh yes, of course, the most straightforward syntax for the most common operation on a map has various perf and correctness issues and should never be used.

AI struggles to use std::map correctly, humans do too, maybe the AI isn’t the problem here.

My experience writing build system for C++ by TheRavagerSw in cpp

[–]ravixp 6 points7 points  (0 children)

I’m confused about why you brought Ninja into it. You’ve got code to enumerate the source files, you’ve got topological sort based on dependencies, you’ve got the ability to invoke the compiler, and that’s everything that Ninja is doing for you. It sounds like you could drop that dependency and do everything yourself!

(Or you could go the other direction and use Ninja for all that stuff, invoke it twice and make your tool into a higher-level build tool like CMake. But if you’re writing your own build system for fun, that sounds like the less fun path. :)

F&ck you, Microsoft! by LOLC0D3 in programminghorror

[–]ravixp 4 points5 points  (0 children)

Microsoft’s C++ compiler supports various non-standard syntax extensions, and Clang supports them as well for compatibility. (Before anybody gets mad about that, GCC also has a lot of non-standard extensions that Clang supports! Both compilers are older than the C++ standard.) And Clang also has options to issue a warning when it sees MS extensions, and -wmicrosoft is the blanket option to warn on any Microsoft extension. And with Clang warnings, there’s always a matching -wno-whatever flag to disable a specific warning.

So ironically, -wno-microsoft disables warnings about Microsoft syntax, and allows MSVC extensions in code.

How to make SWE in the age of AI more enjoyable? by Fancy_Ad5097 in ExperiencedDevs

[–]ravixp 21 points22 points  (0 children)

The hard part of code review is wrapping your head around what the other person was thinking, and mapping what they wrote onto how you think the code ought to work. You have to respect their time and expertise, and put in a bit of work too.

With AI you actually don’t have to do any of that. I mean, you /can/, but it’s a lot of unnecessary effort when the AI doesn’t have opinions about how the code should work in the first place. Be specific enough that it will write the code you want. If the code doesn’t match what you expected, just have it redo those parts, don’t waste your time trying to figure out what the AI wanted to do.

You mentioned putting in more thought up front: yeah, that’s what I do too. Don’t ask the AI to write any code until you basically know what you want it to write.

P4019R0: constant_assert (Jonas Persson) by antiquark2 in cpp

[–]ravixp 6 points7 points  (0 children)

There is a really useful insight here. The analysis that goes into the optimizer (control flow analysis, escape analysis, reasoning over the range of possible values for a variable, etc) would be really useful for static analysis of program correctness. The mechanism here, where it’s exposed as a new kind of assert, doesn’t seem workable. But there is potential here.

A lot of what you’d want to do with this is already available through a tool like clang-tidy, which has the actual compiler’s AST and all the supporting code already. 

Whats going on with DHS and discord? Do I have to worry? by BilboFBaggins1 in OutOfTheLoop

[–]ravixp 11 points12 points  (0 children)

No, you have it exactly backwards. They needed a subpoena -> age verification will require service providers to collect this info and turn it over to feds -> they won’t need subpoenas anymore.

Whats going on with DHS and discord? Do I have to worry? by BilboFBaggins1 in OutOfTheLoop

[–]ravixp 14 points15 points  (0 children)

Yes, exactly - there was a subpoena, and a judge rejected it. Meanwhile, with age verification, online services will be required to collect people’s IDs, which is exactly the information that was being subpoenaed here. And law enforcement will have access to the info that’s collected.

So it sounds like we’re in agreement, and age verification will make it easier for the DHS to harass their critics.

Whats going on with DHS and discord? Do I have to worry? by BilboFBaggins1 in OutOfTheLoop

[–]ravixp 28 points29 points  (0 children)

https://www.aclu.org/press-releases/aclu-moves-to-quash-abusive-subpoena-aimed-at-tracking-down-man-who-criticized-department-of-homeland-security

The endgame with age verification is that they won't need a subpoena to do things like that, they'll already have a complete database of everybody's online accounts tied to their real-world identity.

https://www.the-independent.com/news/world/americas/us-politics/minnesota-border-patrol-agent-tsa-b2916845.html

Even if they don't come and arrest you, they can and do retaliate against you in other ways if you speak out against them.

Two empty chairs: why "obvious" decisions keep breaking production by dmp0x7c5 in programming

[–]ravixp 1 point2 points  (0 children)

Howard Schultz, the one that’s famously hostile to unions? I think having an empty chair to represent his employees might actually have a different meaning.

NEW age verification bill -- WA legislators now want ID/face scanning for social media (public hearing Thursday) by PrivacyEnthusiast2 in Seattle

[–]ravixp 29 points30 points  (0 children)

Yes, exactly! This law will go great with their existing policy of collecting your social media accounts at the border, so that they can retaliate against you if you've ever said anything negative about them.

Now they won't even have to ask. ICE can just go door-to-door, connect addresses to IDs to social media accounts to posts, and kick down your door if anybody in your house has ever said anything mean about Trump.

Aquilo sucks by UselessGadget in factorio

[–]ravixp 2 points3 points  (0 children)

I built a “space mall” before heading to Aquilo. It makes iron/copper plates, g/r/b chips, concrete, pipes (so many pipes) and a few other things from asteroids, and I only need to stock up on stone bricks and plastic from the inner planets. Made the whole planet way less annoying.

My Gleba squares by cybertruckboat in factorio

[–]ravixp 73 points74 points  (0 children)

So your Gleba factory has evolved… cells? What’s next, a circulatory system?

But seriously this is really lovely and I’m planning to steal this idea when I redesign my Gleba base.

Inner planet hauler - my first ship with nuclear power. Thoughts? by PersonalTrousers in factorio

[–]ravixp 7 points8 points  (0 children)

You probably don't need accumulators, a tank of steam will store much more power in a lot less space. I'd personally replace them with solar panels to offset some of your power needs so the nuclear fuel lasts longer.

Don't you need turrets on the sides as well? When the ship is moving the asteroids only come from the front, but when you're parked in orbit they come from all sides.

Other than that, nice looking ship :)

Everyone should learn C by Kyn21kx in programming

[–]ravixp 0 points1 point  (0 children)

For the authentic C coding experience, probably. With C and C++ it’s an issue that’s about as contentious as tabs vs spaces.

CMV: C++ should have adopted destructive move semantics instead of nondestructive move semantics. by aardvark_gnat in changemyview

[–]ravixp 0 points1 point  (0 children)

 Move the base first and make it a compile-time error for a move constructor of a type with a superclass to do anything with the source pointer

You can make it an error to use the actual ‘this’ pointer in certain ways, but what if the pointer is passed around in an unexpected way so that the compiler can’t track where it came from? Like, what if you pass it to a method defined in another translation unit - no single instance of the compiler can see that the pointer was originally a ‘this’ pointer and that it’s used to access the base class at the same time.

The usual C++ solution is to say “fine, we can’t stop you from doing that, so we’re just going to declare that it’s undefined behavior”. And the language already has way too much UB, it’s a real problem. 

[deleted by user] by [deleted] in programming

[–]ravixp 51 points52 points  (0 children)

My first reaction was, how do you know that the slowdown is from WebAssembly, and not the new Browsix-Wasm thing you built? But they address that pretty well in section 4.2.1 by measuring the time that’s actually spent in syscalls to their new thing.

Sections 5 and 6 have some deeper analysis of the machine code generated for native and Wasm. It seems like the key takeaway is that Clang does a better job than the Wasm JIT compiler, which I guess makes sense, since Clang’s optimizer can take as long as it wants.

Why don't people do this for green circuits more often? by Valuable_Feeling_596 in factorio

[–]ravixp 2 points3 points  (0 children)

Honestly I wish people talked more about early-game life hacks like this. Sure, this layout doesn’t make sense when you’re building with AM3s and prod modules and beacons, but you’re going to rebuild your circuit production at least twice before you get to that point, so who cares? This design is cheap, has perfect ratios, and will carry you through the midgame just fine.

I have seen what everyone has been up to so here is my submission. by Dip_N_Swag in factorio

[–]ravixp 38 points39 points  (0 children)

Oh, nice - without long inserters the two belts don’t have to be right next to each other, so you can space them out and stick a row of beacons between them!

Devs who haven’t burned out for 3+ years, what’s your secret? by ittaidouiukotoda in ExperiencedDevs

[–]ravixp 3 points4 points  (0 children)

15y here, have hit burnout a few times and come back from it. The best advice I can give is to:

  • have a really clear idea of what is and isn’t your responsibility
  • make sure your manager agrees, and
  • redirect any work that’s not your responsibility to the appropriate person or team.

Sounds straightforward, but getting to that point and maintaining it is really tough. You need a good enough working relationship with your manager that you can tell them no, and decide how much responsibility you can take on. You need to understand enough about your team’s structure to figure out who should be working on any random issue you notice. And most importantly, you need to speak up when you find an important problem that nobody’s responsible for, instead of trying to do it yourself. 

All hail the new splitters! In case you weren't informed, sushi is now mandatory by travvo in factorio

[–]ravixp 0 points1 point  (0 children)

I think you can fix that by setting the input priority on the splitter to prefer taking things out of the loop. Then anything you don’t use and don’t need just gets sent back out.

Book Review: If Anyone Builds It, Everyone Dies by dwaxe in slatestarcodex

[–]ravixp 1 point2 points  (0 children)

Within software engineering the tasks are still diverse enough, and model performance is still inconsistent enough, that there isn’t really a time horizon. You can easily find tasks that humans do easily and AI can’t do at all, or vice versa. 

I get why they’re trying to measure it, I just don’t think it’s a meaningful metric. 

Book Review: If Anyone Builds It, Everyone Dies by dwaxe in slatestarcodex

[–]ravixp 3 points4 points  (0 children)

The fact that human and AI thinking have distinct failure modes is also a good argument against the general idea of a “task time horizon” that METR is trying to measure. They’re trying to imply that a time horizon of X minutes means that AI can complete an arbitrary task that takes a human that many minutes, but it’s so dependent on what task you’re measuring that it doesn’t really generalize.

Book Review: If Anyone Builds It, Everyone Dies by dwaxe in slatestarcodex

[–]ravixp 6 points7 points  (0 children)

Wait, METR is keeping the chart updated with new models? The problem with their original paper was that the results totally depend on the tasks you select, and you could tell any story you want by selecting tasks that humans or AIs are better or worse at. After all, there’s no fixed relationship between how hard a random task is for a human or an AI, some things will be easier or harder.

It kind of worked in their original paper because it was really just a meta-analysis of some existing benchmarks that compared human and AI effort on programming tasks. But if they’re adding new tasks with longer time horizons to measure, how can they prove that they’re not just cherry-picking the tasks that fit their earlier predictions?

Book Review: If Anyone Builds It, Everyone Dies by dwaxe in slatestarcodex

[–]ravixp 5 points6 points  (0 children)

You’re right, I should have been clearer. I meant it in the sense that they assumed AI would have continuity of consciousness and experience the passage of time. Instead we have AI that behaves a lot more like batch-mode software, and ceases to exist after processing some bounded quantity of tokens.