Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Const-me
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
91.
▲
by
Const-me
1y ago
In C++, std::vector<bool> does pretty much the same thing under the hood. Sadly, C++ standard library API designers made it impossible to directly access the array of integers stored inside std::vector<bool>. This made serializa
92.
▲
by
Const-me
1y ago
The ISA extension tags are mostly incorrect. According to that web site, all SSE2, SSE3, SSSE3, and SSE4.1 intrinsics are part of SSE 4.2, and all FMA3 intrinsics are part of AVX2. BTW there’s one processor which supports AVX2 but lacks FMA
93.
▲
by
Const-me
1y ago
I’m using ChatGPT (enterprise version paid by my employer) quite a lot lately, and I find it a useful tool. Here’s what I learned over time. Don’t feed many pages of code to AI, it works best for isolated functions or small classes with lit
94.
▲
by
Const-me
1y ago
Couple months ago, I have replaced 3.5 years old HP Probook with XMG EVO 14. Specifically, I have ordered a configuration with Ryzen 7 8845HS, 64GB DDR5-5600, and no disks because I reused 4TB WD Red SN700 from the old laptop, and still hav
95.
▲
by
Const-me
1y ago
> which Intel or AMD cpu can be run fanless and perform well? For example, AMD Ryzen 7 8840U or 7840U can be configured for the same 15W TDP as Apple M1. At 15W, the overall performance going to be about the same as M1.
96.
▲
by
Const-me
1y ago
I think you made a mistake converting units, 28.9 USD/kg = $28900 per ton.
97.
▲
by
Const-me
1y ago
CPUs can’t do that, but legacy is irrelevant. They just don’t have enough parallelism to leverage all these extra transistors. Let’s compare the 486 with a modern GPU. Intel 80486 with 1.2M transistors delivered 0.128 flops / cycle. nV
98.
▲
by
Const-me
1y ago
I think writing assembly indeed offers no benefit for most developers. However, being able to read and understand assembly is generally useful. Enables debugging binaries and crash dumps without complete source codes, like DLLs shipped with
99.
▲
by
Const-me
1y ago
> because of the 16-bit character type That type is not for characters anymore; all these languages treat these values as UTF-16 units. Unlike C++, their standard libraries provide functions to convert strings between UTF-8 and UTF-16, a
100.
▲
by
Const-me
1y ago
> not something that can be supported in a standard library that cares about long-term backwards compatibility Standard libraries of Java, JavaScript, and C# are counter-examples. > you can just use that from C++ if you want to Techni
101.
▲
by
Const-me
1y ago
That particular class doesn’t depend on the COM-related pieces of the ATL library. It can be used in any C++ project which targets windows desktop platform. I think since VS2015 ATL is available even in the freeware community edition of the
102.
▲
by
Const-me
1y ago
I would not call that example production quality code. CreateFileA API thing is only available for compatibility with prehistoric software written for Win9x from the nineties. Also, the SDK comes with CAtlFile class which wraps CreateFileW
103.
▲
by
Const-me
1y ago
> probably one of the best algorithms and containers libraries in any language Mostly agree about the algorithms. Another good thing in C++ are low-level mathematic parts of the standard library in <cmath> and <complex>. Cont
104.
▲
by
Const-me
1y ago
Good article, but I’d add one more paragraph. If your data format contains multiple streams inside, consider ZIP for the container. Enables standard tools, and libraries available in all languages. The compression support is built-in but op
105.
▲
by
Const-me
1y ago
Cool trick, but I wouldn’t do that for the use case. The use case they had is saving minidumps when the app crashes. Windows error reporting OS component is flexible enough to support the feature without hacks, they just need to write coupl
106.
▲
by
Const-me
1y ago
There’s a recent promising development relevant to the GC pause issue. It seems couple weeks ago some smart developer working for Microsoft has made a version of GC called “Satori” which pretty much solved these GC pauses for many real-worl
107.
▲
by
Const-me
1y ago
> on some workloads, I found LTO to be a requirement for C code to match C# performance Yeah, I observed that too. As far as I remember, that code did many small memory allocations, and .NET GC was faster than malloc. However, last time
108.
▲
by
Const-me
1y ago
> quite a similar model Yeah, and that model is rather old: https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule In practice, complex software systems have been written in multiple languages for decades. The requi
109.
▲
by
Const-me
1y ago
I don’t use C++ for most of my applications. I only use C++ to build DLLs which implement CPU-bound performance sensitive numeric stuff, and sometimes to consume C++ APIs and third-party libraries. Most of my applications are written in C#.
110.
▲
by
Const-me
1y ago
Interestingly, CPU-bound high-performance systems are also incompatible with Rust’s model. Ownership for them is unambiguous, but Rust has another issue, doesn’t support multiple writeable references of the same memory accessed by multiple
111.
▲
by
Const-me
1y ago
> I've been using it in C# One reason why async-await is trivial in .NET is garbage collector. C# rewrites async functions into a state machine, typically heap allocated. Garbage collector automagically manages lifetimes of method a
112.
▲
by
Const-me
1y ago
> it is possible to make C code run quickly but only by spending thousands of person-years building a sufficiently smart compiler Just because some of the C++ code I write heavily relies on ISA-specific SIMD intrinsics doesn’t replace th
113.
▲
by
Const-me
1y ago
> such as time.h and string.h In Windows, the APIs provided by the OS are IMO better than these C standard headers. WinAPI date/time is more precise, the kernel keeps int64 number of 100 nanosecond ticks. WinAPI supports arbitrary t
114.
▲
by
Const-me
1y ago
The libraries you listed are too specialized. And they require integration with asset pipeline which is well outside of scope of a programming language. As for the generic things, I think C# is the only mainstream language which has small v
115.
▲
by
Const-me
1y ago
The .NET runtime is cross-platform, the lower level asp-net infrastructure is included in the runtime. The higher level CoreWCF RPC library OP uses is written fully in C#. I would expect it to run in all environments supported by the .NET r
116.
▲
by
Const-me
1y ago
> because they're terribly asked and probably duplicates Not all questions which seem duplicate to a non-expert are actual duplicates. An example question which took 2 lines to answer, then a page of text in that answer to restore t
117.
▲
by
Const-me
1y ago
Almost any hardware, .NET runs on x86, AMD64, ARMv7 and ARM64 processors. Almost any desktop or server OS, .NET runs on reasonably modern versions of Windows, Linux and MacOS. The complete source code of the server is in the question.
118.
▲
by
Const-me
1y ago
Not sure it’s the main issue, but your infinite random stream implementation is broken due to integer overflow. Stream.Position is using int64 for a reason, but your _sequence field is int32 which wraps after 2GB. BTW C# compiler has a sett
119.
▲
by
Const-me
1y ago
There’s a useful but non-obvious property of these filters. If you have two Bloom filters which use same set of possible keys and same filter setup, you can compute intersection of their represented sets with a bitwise AND operation over th
120.
▲
by
Const-me
1y ago
Bricks and cobblestones don’t handle high traffic well, require too much maintenance i.e. too expensive. Cobblestones are only good for areas with heavily restricted or banned vehicle traffic. For roads and higher traffic streets, asphalt i
More ›