Better HN
topnewbestaskshowjobs
Log inSign up

affenape

36 karma · joined Dec 31, 2024 (1y ago) · 12 submissions

Submissions

comment 2mo ago · link · parent

It did for sure, but the problem with C++ is its heritage, specifically that structures can be self-referential. For instance, the Rust's url::Url type has to use usize offsets for tracking the location of each of its components. Conversely, in C++, someone could have already created a similar Url type that would use std::string for the buffer and char pointers for the component locations. As such, you cannot simply memcpy from one struct into another and forget the former as std::string could have its own in-place storage and that would invalidate all pointers - you'll need to define a move constructor instead.

comment 4mo ago · link · parent

I've tried using RustRover over WSL2 multiple times with every new release, but it's been a huge disappointment every time. My fans constantly spin like crazy, memory vanishes into thin air, and typing is super laggy - it even overwrites random sections of the file sometimes. On top of that, the built-in terminal is totally unusable because it craps out and freezes the app whenever there's a large output.

PyCharm, on the other hand, was always great to use. But since VS Code gives me pretty much everything I need for my daily work without demanding too much from my system, I've finally moved away from JetBrains.

comment 8mo ago · link · parent

From the proposal, I see a bunch of new keywords and rules - alright given the language's heritage. But what happens if I "relocate" a variable value - would a "shell" remain or how exactly C++ is supposed to handle this:

  auto value = create_value();
  if (some_cond) {
    consume_value(std::move(value)); // not sure whether it's move here, but I guess my point is clear
  }

  use_value(value);

comment 8mo ago · link · parent

Finally, reflection has arrived, five years after I last touched a line in c++. I wonder how long would it take the committee, if ever, to introduce destructing move.

comment 8mo ago · link · parent

Not necessarily. A coroutine encapsulates the entire state machine, which might pe a PITA to implement otherwise. Say, if I have a stateful network connection, that requires initialization and periodic encryption secret renewal, a coroutine implementation would be much slimmer than that of a state machine with explicit states.

comment 12mo ago · link · parent

> A %PRODUCTNAME% next generation editor/ide is released

> Look inside

> VS Code

comment 1y ago · link · parent

Can it run doom? Can it make doom come true?

comment 1y ago · link · parent

For something having 2024 in its name I expected a more consistent error handling, but guess what:

* some functions like fsRenderCreate return 0 or 1 depending on the operation result;

* some like fsMapViewCreate say that a value less than 0 is returned on error;

* fsIOOpen says you should also consult with the fsIOGetLastError function on failure.

Hope somebody considers adding the errno.

comment 1y ago · link · parent

Yikes... everything looks like jelly. Best served with Comic Sans MS.

comment 1y ago · link · parent

Would be really NICE.