Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
clappski
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
clappski
1mo ago
I’ve had more difficulty building http1.1 implementations that broadly work, still a lot of weird stuff like incorrect chucked message parsing you have to handle on the server side. Yeah plain TCP is obviously simpler but you can’t consume
2.
▲
by
clappski
1mo ago
You can genuinely implement the protocol with good performance in 150/200 lines, from memory; 1. Read the opcode 2. If PING, send PONG. If binary or text, continue 3. Read the header size 4. Read the payload size (which is a variable-w
3.
▲
by
clappski
1mo ago
In my experience (building things like realtime trade monitoring front ends), client side processing sucks. You have 10 or 20 data sources that need joining up in a client defined set of ways (think viewing X price feed with Y trade feed an
4.
▲
by
clappski
1mo ago
The claim I was rebutting was specifically about latency. Of course you can make a mess of it, no different than you can with request/response based protocols. On the other hand, you are going to struggle to implement bidirectional eve
5.
▲
by
clappski
1mo ago
Yes, WebSockets are very simple to implement a server or a client for. It’s a small variable size header, 5 or so frame types and a typically constant mask over the contents.
6.
▲
by
clappski
1mo ago
> The latency is the same because modern browsers multiplex HTTP requests over a single TCP connection that is left open. In my experience this isn’t true; firstly you’re relying on an implementation detail of the platform that you’re e
7.
▲
by
clappski
4mo ago
At least in that case you can refactor the stored proc to be more performant without pushing application changes.
8.
▲
by
clappski
4mo ago
Not at all, for example at secondary/high school you would address male teachers interchangeable as ‘sir’ and ‘mr. Last name’.
9.
▲
by
clappski
8mo ago
The mistake is that you did a system update when you wanted to use the computer. Not implying that system updates should be a dangerous thing to do, but just something learnt from experience - I’ve had similar issues, especially with Nvide
10.
▲
by
clappski
9mo ago
I like the priorities. I think a core thing that's missing is that code that performs well is (IME) also the simplest version of the thing. By that, I mean you'll be; - Avoiding virtual/dynamic dispatch - Moving what you can
11.
▲
by
clappski
1y ago
You'd have an error about an incomplete type - see https://godbolt.org/z/G4Gsfn7MT > a pointer, whose size is always known Yeah, this is exactly how it works. You work with a pointer that acts like a void* in y
12.
▲
by
clappski
1y ago
When we're talking about opaque it's really in relation to an individual translation unit - somewhere in the binary or its linked libraries the definition has to exist for the code that uses the opaque type.
13.
▲
by
clappski
3y ago
Reminds me of the shadow paging used in LMDB, which is effectively the same but at the page level rather than the whole tree and allows each reader their own context to read from, rather than a shared reader context.
14.
▲
by
clappski
3y ago
f" something { my_dict['key'] } something else " This works in Python already, allowing for nesting is a big QoL improvement
15.
▲
by
clappski
4y ago
C++ has two types of polymorphism; - Templates (compile time), which are generic bits of code that are monomorphized over every combination of template parameters that they're used with. - Virtualization (runtime), classic OO style pol
16.
▲
by
clappski
4y ago
> haven't seen depth info past the best bid/offer (maybe exists? I'm not an expert) Most exchanges will provide arbitrary depth in way of a pure order feed. From that you can construct your price book, which gives you the
17.
▲
by
clappski
4y ago
So are you arguing that genocide and slavery aren't objectively bad?
18.
▲
by
clappski
4y ago
By sharing the load, we have a #reviews channel that anyone can put something in to get peer review. If there's something that needs attention from a specific person then arranging a call to walk through is a good approach where both r
19.
▲
by
clappski
4y ago
There's much more reason to do a greenfield project in C++ than Rust - experienced C++ hiring is still considerably easier! Not everything has a purely technical motivator.
20.
▲
by
clappski
4y ago
> Is it boring? Was I right about that? > who uses programming as a problem solving tool Programming can be boring, software development is much more exciting! All software is solving a problem, same as the software that’s the output
21.
▲
by
clappski
4y ago
The ship had sailed on > WFH is a rare, once a month kind of thing years ago for tech in London, way before 2020 for most businesses. You'd be better off looking outside of London in the commuter belt or further out if you actually
22.
▲
by
clappski
4y ago
In practise shared_ptr should only be used when you need to actually share ownership of some dynamically allocated object. You get around it by using it in the right place. You’re correct on the refcounting being a performance issue. Codeba
23.
▲
by
clappski
4y ago
Sometimes you might use bits in an integer to encode data, e.g.; - A bitset index - Bitflags (e.g. to represent logging levels) - Feature flags `bit_count` (aka `popcount`) gives you an efficient way to figure out how many bits within those
24.
▲
by
clappski
5y ago
Something to bare in mind when you're looking at both of those is the price is highly dependent on a number of factors; - Type of generation, looking at the NY data they have a huge hydro generation, obviously the UK grid has much less
25.
▲
by
clappski
5y ago
Wouldn't `Count` ( https://docs.microsoft.com/en-us/dotnet/api/system.collectio... ) be the preferred way to check if a collection has values? `someCollection.Any()` is the same as Python's `any`
26.
▲
by
clappski
5y ago
> But wouldn't the ability to restrict arbitrary changes to a struct still be important? Typically immutability in C++ is at the interface scope rather than structural, e.g. prefer this struct MyType { int x_;
27.
▲
by
clappski
5y ago
My comment wasn’t about buffered writing in a main thread, it was about moving the work out of your threads actually executing your program and having them push raw log actions into a queue for another thread to do the formatting and writes
28.
▲
by
clappski
5y ago
> logging to a synchronized output There's your performance issue, logging doesn't need to be persisted or even processed by your main program thread or any thread/process actually doing the work. Who's logging straig
29.
▲
by
clappski
5y ago
What you should be doing for checked arithmetic with GCC is use the builtins for those that aren’t aware; https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins...
30.
▲
by
clappski
5y ago
It’s only possible to do that if your positive integers are passed via template parameters. All your type traits/SFAINE/concepts/static_asserts happen at compile time, you can’t use them to do any checks on the value of a typ
More ›