Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
viega
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
DockTalk: Two AIs Gossiping Across the Namespace Wall
(lasthumanity.com)
5 points
by
viega
4mo ago
|
0 comments
2.
▲
by
viega
5mo ago
Interesting; while I knew about `preserve_all` and `preserve_most` attributes, I didn't have an inkling that they've added `preserve_none`. But that's much cleaner that the traditional `setjmp()` or custom asm (which I'v
3.
▲
by
viega
7mo ago
.* does NOT match newlines, so always will stop a match at the end of a line.
4.
▲
by
viega
9mo ago
For me, I’ve got use cases where it’s valuable to keep event data interleaved because it will also get used in flight. It works well enough I also use it for things where it’s not necessary like in memory debug rings (which requires a bit o
5.
▲
by
viega
9mo ago
BTW, should be noted that the need to issue a cache line lock on x86 does seem to slow down 128-bit CAS quite a bit on x86-64 platforms. On arm64, there's no reason to skimp with a 64-bit CAS.
6.
▲
by
viega
9mo ago
You can use a 64-bit CAS if you want to use a 32-bit epoch and a pointer compression scheme of any kind, or just a 32-bit index into regions that are thread specific. I think I did the later when I did the original work, using the core prim
7.
▲
by
viega
9mo ago
Yes, I meant to clarify the memory model discussion; I had tried to simplify and did a poor job; I got similar feedback after it was published, and never remembered to get to it. Will try to do it soon, though it's about the worst time
8.
▲
by
viega
9mo ago
So that work came after mine, and seems to be a FIFO not a ring buffer. The library I built at the time also had FIFOs and LIFOs that were tweaks on previous algorithms, but nothing earth shaking. I'll check this one out when I can tho
9.
▲
by
viega
9mo ago
I don't think I even saw this until I published the article. I don't think it was academically published, or googled well back in 2000. Nor did it match my needs for a ring buffer at the time, which was to drop stale data (I think
10.
▲
by
viega
9mo ago
Well, when I was doing the original work on it (about 5 years ago now), I spent a lot of time trying to find something else in the literature. I couldn't find anything that wasn't SPMC or MPSC, unless it had severe limitations, li
11.
▲
by
viega
10mo ago
Agreed that this is not a critical problem, and the cooperative side channel can be useful in otherwise uncooperative environments. The article does mention wanting to coordinate across multiple identical processes running on the same node
12.
▲
Fun-reliable side-channels for cross-container communication
(h4x0r.org)
17 points
by
viega
10mo ago
|
6 comments
13.
▲
by
viega
10mo ago
By the way, the run-time type checking is one of the use cases where I really would like to have a tractable interface for hashing at compile time, preventing unbounded strcmps, and turning them into an integer compare (without having to ma
14.
▲
by
viega
10mo ago
Oh, this is very good. Some of the stuff you're doing in the library I've also been doing recently, and has been working well, like using the string of the type name to allow for run-time checking of, what I would called "mix
15.
▲
by
viega
10mo ago
No, should have said '50'. Have fixed that, thanks.
16.
▲
by
viega
10mo ago
From my read, that article doesn't have anything in it that isn't standards compliant C. My memory is getting worse as I get older, but I'd say by C17 all that was standard, and definitely in C23. I've noticed many peopl
17.
▲
by
viega
11mo ago
It is-- if you click in to their full list, you should see it near the top in their "above the water" section, under `#pragma once`. I suspect it was added after the meme image was produced. But, if it weren't on the iceberg
18.
▲
by
viega
11mo ago
To be clear, the example I provided for the other person explains the bit you're missing where the names aren't working... if you carefully follow the rules, the # and ## operators don't allow expansion on their arguments, so
19.
▲
by
viega
11mo ago
If my google fu is that bad, it's pretty much impossible to be.
20.
▲
by
viega
11mo ago
Thanks. Also, per another person in the thread, here are the two annotations he or she was asking for, heavily annotated. They are both only a couple lines, but it deals with things like the fact that you've got one more argument than
21.
▲
by
viega
11mo ago
Okay, finally found some time to provide you with a fully annotated example of your original ask here, assuming you wanted to transform the arguments passed to F into IDs, and the arguments passed to G into strings (as seemed to be the case
22.
▲
by
viega
11mo ago
If you can give me specifics on how it's not clear, I'd very much want to improve it. Please DM me about it.
23.
▲
by
viega
11mo ago
Yes, 100%. And since CPP doesn't actually understand C, it's not too hard to do some lightweight preprocessing that requires some real additional parsing. But while CPP is pretty finicky and not very modern, getting such things wo
24.
▲
by
viega
11mo ago
Well, I've done it that way if I'm willing to limit myself to pointers or ints up to a pointer size, but that doesn't work with floats or doubles, for instance. Ergonomically, I have tended to start using _Generic for static
25.
▲
by
viega
11mo ago
Wow, you are a braver person than I. Well done.
26.
▲
by
viega
11mo ago
Wow, I'm not sure I've ever seen this (or if I did, it was 20 years ago). And I was definitely looking around for this kind of history when I was searching around when writing. Perhaps my google skills have decayed... or google...
27.
▲
by
viega
11mo ago
That's interesting. I agree with you that the standards text is pretty vague. I think that's why other attempts to show how to do this kind of thing don't get deep enough on the semantics, and why I adopted a "try it and
28.
▲
by
viega
11mo ago
C++ also has constexpr functions, which can be recursive. All code can have bugs, error out and die. There are lots of good reasons to run code at compile time, most commonly to generate code, especially tedious and error-prone code. If the
29.
▲
by
viega
11mo ago
And I should say, if you want to apply the same transformation to arguments twice, but call F() separately from G() per your starting example, you'd just apply your map twice in your top-level macro.
30.
▲
by
viega
11mo ago
I'm on my phone, but if you start with the top 8 lines in the code box under the ascii art, you'll get an implementation of `H4X0R_MAP()`; the bottom two lines are an example, and you can just write yourself a body that produces o
More ›