Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ynik
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
17 ms
·
121.
▲
by
ynik
4y ago
asan/ubsan are great for finding language-level undefined behavior. But apart from some functions like memcpy that asan is hooking, they cannot find library-level undefined behavior such as the pop_back() on the empty vector. (That
122.
▲
by
ynik
4y ago
If you take the address of different functions, the standard requires those to compare unequal. However if you merely call functions and never take their address, the standard doesn't put any requirements on that, so inlining etc. is l
123.
▲
by
ynik
4y ago
Idle time doesn't count as user-time unless it's a spinlock (please don't do those in user-mode). I suspect the answer is: Perfect scaling doesn't happen on real CPUs. Turboboost lets a single thread go to higher frequen
124.
▲
by
ynik
4y ago
It fails if someone merges main into their feature branch, and then performs a fast-forward merge of their feature branch to main. Now the two parents are in the opposite of the expected order, and --first-parent will follow along the featu
125.
▲
by
ynik
4y ago
A single-bit bitfield has only a sign bit, no value bits. Prior to C23 there was no guarantee of two's complement, so it was possible that such a field could only hold the value 0.
126.
▲
by
ynik
4y ago
There's a massive difference to multiprocessing: the different sub-interpreters can use a C(++)/Rust extension module to talk to shared state. In the current multi-processing world, the whole C++/Rust state needs to be duplic
127.
▲
by
ynik
4y ago
Looks like they did a force-push that replaced the PR's from-branch (septicmk/v6d:main) with the state of the target branch. This effectively removes all commits from the PR, leaving the PR with zero remaining commits. All of the
128.
▲
by
ynik
4y ago
Entanglement doesn't involve any form of communication. Only the imaginary "wave function collapse" is faster than light. But collapse isn't actually part of quantum mechanics: there's no formula that would tell you
129.
▲
by
ynik
4y ago
Because of relativity. The speed of light is also the speed of causality. Assuming the theory of relativity isn't totally wrong, then if faster-than-light communication is possible, then so must be time travel. http://www.ph
130.
▲
by
ynik
4y ago
The debugger interface is open (it's part of the CLR itself), and so is the debug symbol file format. However the debugger interface is low-level, making writing a debugger engine from scratch fairly complex. The complaint is that Micr
131.
▲
by
ynik
4y ago
> If at the end of your Ctrl+C signal handler you exit() as expected exit() is not signal-safe; signal handlers are expected to call quick_exit() or _Exit() instead.
132.
▲
by
ynik
4y ago
You can't use sizeof in #if, but you can use C11 static_assert instead. Also this doesn't just apply "in the future" -- integer types larger than intmax_t already exist, C23 just updates the standard to match reality.
133.
▲
by
ynik
4y ago
Big-O/Theta/etc. are just tools for analyzing functions. But it also matters which function you are analyzing. Typically a program is evaluated in terms of something like the "Random-access machine" where every instructi
134.
▲
by
ynik
4y ago
I don't know about multithreaded processes -- the program I use it is single-threaded. My main use case is not to make the crashes reproducible (they usually already are), but to understand where a bogus value is coming from. (memory b
135.
▲
by
ynik
4y ago
gdb's reverse execution is incredibly slow. Performance overhead of reverse debuggers: * gdb: >1000x (note: I never tested this one myself; just heard about this overhead in a HN comment a long time ago) * Microsoft WinDbg TimeTrave
136.
▲
by
ynik
4y ago
We know what to do, but no single developer is in a position to do it -- POSIX file locking requires global coordination between all developers of code running inside a single process. This is fundamentally incompatible with the use of libr
137.
▲
by
ynik
4y ago
Consensus of the order of transactions. A could sign two messages: "I, A, send my bitcoin to B" and "I, A, send my bitcoin to C". There needs to be global consensus whether the bitcoin ends up with B or C, otherwise the
138.
▲
by
ynik
5y ago
In a world without generic programming, NaN not being equal to itself makes a certain amount of sense for some kinds of numeric code. But in a world with reusable generic algorithms the calculation changes -- here equality/ordering rel
139.
▲
by
ynik
5y ago
You seem to be getting downvoted for being too vague, so I will post the solution: The snippet breaks for paths starting with a minus, as mkdir will interpret those as another option. The solution is: subprocess.run(["mkdir"
140.
▲
by
ynik
5y ago
Generalized capture is primarily useful for move semantics: std::function<int()> make_func(std::unique_ptr<int> ptr) { return [p = std::move(ptr)]() { return *p; } } Without generalized capture syntax, there
141.
▲
by
ynik
5y ago
> 1918 flu lasted 26 months. We are at 21 months with masks, vaccines and lock downs and no ending in sight. Do you think masks and lock downs were intended to reduce the duration of the pandemic? The opposite is the case: they're i
142.
▲
by
ynik
5y ago
Don't forget that other languages also have community drama. Just because Rust's drama made it to the HN front page this day doesn't mean that other languages are any better in the drama department -- I think it just means th
143.
▲
by
ynik
5y ago
The "(no dead keys)" variant to US-International solves that problem. Windows unfortunately doesn't have it out of the box (Ubuntu does). But you can make your own layout with "Microsoft Keyboard Layout Creator". An
144.
▲
by
ynik
5y ago
In the company I'm working for, we had to spent more engineer time on GIL workarounds (dealing with the extra complexity caused by multiprocessing, e.g. patching C++ libraries to put all their state into shared memory) than we needed f
145.
▲
by
ynik
5y ago
The GIL doesn't really help Python code though, because the interpreter may switch threads between any two opcodes. It only protects the state of the Python interpreter and that of C/Cython extension modules. Though even there, yo
146.
▲
by
ynik
5y ago
Currently, dictionary updates are atomic only if the keys are primitive types. `dict.update()` will call methods like `__eq__`, and those methods (if implemented in Python) may temporarily release the GIL.
147.
▲
by
ynik
5y ago
Fun fact: all those approaches use multiple dict lookups, just of different dicts. First approach is looking for `get` in `type(some_dict).__dict__` and then for `key` in `some_dict`. Second approach is looking for `key` in `some_dict`, and
148.
▲
by
ynik
5y ago
While that's true at the Python language level, there are already special optimizations for this in CPython: `tp_iternext` is not required to set an exception. If it returns NULL without setting an exception, that's taken to be th
149.
▲
by
ynik
5y ago
I don't think it's possible without breaking changes. But if we're willing to accept some changes to the C API, it's at least possible to make the GIL less global. It really should be obvious that it's possible to h
150.
▲
by
ynik
5y ago
You can only have a single core running Python code per process . You can also have a single Python process running multiple threads in parallel, as long as all but one of those threads are currently running C code (numpy, system calls, ..
More ›