Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ynik
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
ynik
10mo ago
`s[0] == 'h'` isn't sufficient to guarantee that `s[3]` can be access without a segfault, so the compiler is not allowed to perform this optimization. If you use `&` instead of `&&` (so that all array elements are
2.
▲
by
ynik
10mo ago
C# doesn't erase all generics; but there's also some type erasure happening: nullable reference types, tuple element names, and the object/dynamic distinction are all not present in .NET bytecode; these are only stored in att
3.
▲
by
ynik
10mo ago
Windows NT started supporting unicode before UTF-8 was invented, back when Unicode was fundamentally 16-bit. As a result, in Microsoft world, WCHAR meant "supports unicode" and CHAR meant "doesn't support unicode yet&quo
4.
▲
by
ynik
11mo ago
Autovectorization / unrolling can maybe still be handed with a couple of additional tests. The main problem I see with doing branch coverage on compiled machine code is inlining: instead of two tests for one branch, you now need two te
5.
▲
by
ynik
1y ago
Using a second partition D: is already twice as fast at small-file-writes compared to the system partition C:. This was on Windows 10 with both partitions using NTFS on the same SSD, and everything else on default settings. This is because
6.
▲
by
ynik
1y ago
Only if you measure the life cycle starting from the initial release. Windows 10 dropped out of support only 3 years after its successor (Win11) was available; when Windows 8.1 still had 7 more years of support after its successor (Win10) w
7.
▲
by
ynik
1y ago
Python 3 internally uses UTF-32. When exchanging data with the outside world, it uses the "default encoding" which it derives from various system settings. This usually ends up being UTF-8 on non-Windows systems, but on weird enou
8.
▲
by
ynik
1y ago
You are not testing what you think you are testing. "let &mut a2 = &mut a;" is pattern-matching away the reference, so it's equivalent to "let a2 = a;". You're not actually casting a mutable reference t
9.
▲
by
ynik
1y ago
But adding 1 to a pointer will add sizeof(T) to the underlying value, so you actually need to reserve more than two addresses if you want to distinguish the "past-the-end" pointer for every object from NULL. -- While it's rar
10.
▲
by
ynik
1y ago
Under your interpretation, neither gcc nor clang are POSIX compliant. Because in practice all these optimizing compilers will reorder memory accesses without bothering to prove that the pointers involved are valid -- the compiler just assum
11.
▲
by
ynik
1y ago
That applies only if you take "memory model" to mean modeling the effects of concurrent accesses in multithreaded programs. But the term could also be used more generally to include stuff like pointer provenance, Rust's "
12.
▲
by
ynik
1y ago
Bytecode instructions have never been atomic in Python's past. It was always possible for the GIL to be temporarily released, then reacquired, in the middle of operations implemented in C. This happens because C code is often manipulat
13.
▲
by
ynik
1y ago
Are there any embedded compilers left that try to implement their own C++ frontend? To me it looks like everyone gave up on that and uses the clang/gcc/EDG frontends.
14.
▲
by
ynik
1y ago
At least on Debian, installing the `atop` package will automatically install a background service running atop as root. (by default, logging some stats to /var/log/atop/ every ten minutes)
15.
▲
by
ynik
2y ago
Destructors/drop have issues though: * cannot return errors/throw exceptions * cannot take additional parameters (and thus do not play well with "access token" concepts like pyo3's `Python` token that proves the GI
16.
▲
by
ynik
2y ago
Even the trivial specification "given a valid input, the program exits successfully with some arbitrary output" will already get you very far: to prove this trivial specification as correct, you need to prove the absence of panics
17.
▲
by
ynik
2y ago
Codegen bugs are not particularly rare either; but you usually run into them if doing "weird stuff" (which hits an edge case somewhere within the compiler). And the first instinct of most C++ programmers when seeing weird compiler
18.
▲
by
ynik
2y ago
The crucial bit for Vec::drain is in these two lines of code, which the article lists but does not discuss: // set self.vec length's to start, to be safe in case Drain is leaked self.set_len(start); You c
19.
▲
by
ynik
2y ago
The big differences are: 1. Rust closures are by-value structs; whereas Java closures are heap objects. 2. Rust generics are monomorphized; whereas Java type-erases them -> lots of virtual call overhead when passing a closure to a generi
20.
▲
by
ynik
2y ago
Probably because they did not think of this special case when writing the standard, or did not find it important enough to consider complicating the standard text for. In C89, there's just a general provision for all standard library f
21.
▲
by
ynik
2y ago
You misunderstood. N, M are supposed to be integers (const generics); in your example code you've made them types. Also, your `type Output = Foo<<N as Add<M>>::Output>;` just means "multiplication has the same re
22.
▲
by
ynik
2y ago
That only works for C++ code using C++20 modules (i.e. for approximately nothing). With textual includes, you need to be able to switch back and forth the edition within a single compilation unit.
23.
▲
by
ynik
2y ago
The main big philosophical difference regarding templates is that Rust wants to guarantee that generic instantiation always succeeds; whereas C++ is happy with instantiation-time compiler errors. The C++ approach does make life a fair bit e
24.
▲
by
ynik
2y ago
The really horrible bufferfloat usually happens when the upload bandwidth is saturated -- upload bandwidth tends to be lower so it'll cause more latency for the same buffer size. I used to have issues with my cable modem, where occasio
25.
▲
by
ynik
2y ago
> You can send half-random input in and then send more half-random input in until you’re satisfied that the RNG has gotten a suitable amount of entropy. This does not actually work. If an attacker can observe output of the CSPRNG, and kn
26.
▲
by
ynik
2y ago
Not sure if you dropped a "/s". In my experience, C++ template usage will always expand until all reasonably available compile time is consumed. Rust doesn't have C++'s header/implementation separation, so it&#
27.
▲
by
ynik
2y ago
Even cooler is that it's possible to create an infinite-layer gzip file: https://honno.dev/gzip-quine/
28.
▲
by
ynik
2y ago
You can still install Windows 11 without a Microsoft account. It requires configuring the installation before you boot from the USB stick. I use https://rufus.ie/en/ when creating bootable USB sticks, and it turns ou
29.
▲
by
ynik
2y ago
Does anyone know what the technical change in this patch is? I think of branch prediction as being something the CPU does internally; where does the operating system come into play?
30.
▲
by
ynik
2y ago
However Windows has stacks that commit on-demand, which is kinda similar to overcommit. It can result in programs terminating on any random function call (if that call requires allocating a new page of stack). https://learn.micro
More ›