Hacker Newsnew | past | comments | ask | show | jobs | submit | isogon's commentslogin

Becomes a lot less interesting when you consider that there's no way to power such a camera for any meaningful period of time without a much larger battery (ignoring the issue of storage/transmission).


Repurposing flags not always well-motivated, but one legitimate reason to do this is the memory (and particularly cache) footprint.

Often flags are local to a particular object. If there are lots of such objects, you want each to take as little space as possible. You should check out the contortions linux devs go through to make struct page small [0]. This is important, because there is one such struct per page of physical memory. The memory use is a near-constant percentage of your total memory, and you wouldn't want it to be any larger than necessary.

Even when there are not a lot of these objects, in low-latency software it's important to hit the cache. Your program should always just be as compact in memory as possible.

Semantically flags are booleans (is proposition P true of this object). They are stored compactly as bitsets, often implicitly, say:

    #define FLAG_1 0x01
    #define FLAG_2 0x02
    /* ... */
    #define FLAG_8 0x80

   struct order {
       u32 qty;
       u16 id;
       u8  type;
       u8  flags;
   };

This struct will fit into 8 bytes. This is great, as you probably won't waste space to alignment in many cases -- 8 is a good multiple. But if you wanted to add FLAG_9 here, your flags would become a u16, and your struct would, frustratingly, stop fitting into 8 bytes. To avoid this, one might repurpose flags.

Another example of this is intrustive flagging, using, for example, the high or low bits of a pointer aligned to 2^n bytes. If you run out of bits there, not much you can do.

[0] https://github.com/torvalds/linux/blob/master/include/linux/...


This is pretty much why flags get repurposed. It's also important to mention that things like JSON and protobufs are too expensive for HFT, so you are likely going to be sending structs over the wire. Repurposing flags lets you change a wire format with a lot less friction than adding a byte to a struct. Essentially, it lets you change the minor version number on a protocol and only recompile the endpoints without changing the major version number and recompiling everything.


Thank you both!


This is what I thought as well, and I'm in the field. It's legit to try to fit everything in cache.

However, you can still do something about making this safe. For instance the program could do some sort of version check on startup and panic if things weren't correct.

There's a bunch of stuff that needs to be done before the program reaches its low latency steady state, where speed doesn't matter. Might as well add checks there to make sure things are correct.


I cannot confirm this. ~300k is pay (excluding sign-on) fresh out of college at a big HFT -- sufficiently senior devs make 7 figures.


At our firm, the numbers are similar: $600k TC for new grads ($200k base, $100k minimum first year bonus, $300k signing bonus)


WTF! I am at an HFT firm in Chicago, this is insane. This seems to be a lot like an offer from Radix, or Headland, or maybe Algo Dev at HRT.


There is certainly much variance between the firms, especially the sign-on IME. People I know have turned down HRT core dev for big tech because their offers were unimpressive.

I think an interesting target for comparison with big tech is Jane Street, since their culture and WLB are good, so the main QoL drawbacks of finance don't apply. A new grad will get ~300k at Jane Street, though probably not with this large a sign-on.


This is interesting, didn't know this about HRT Core Dev where offers were below FAANG. My understanding is that core devs are basically the folks who work on all the low latency stuff, so they'd be pretty well.

Jane Street, from what I recall, is 300K (base + bonus) and 125K sign-on, and also it is non-negotiable. No idea what their numbers are like for experienced hires from competitors.


Honestly, that depends on the firm. There are same that do pay very well like this, eg: HRT, Jane Street (they are not an HFT though), Headlands, Radix. Some others like Jump, Optiver the pay varies depending on whether it's front office or back office.

Where I work at, the new grad offers are slightly better than FAANG, but the growth is very good based on performance, we also pay very well to people coming in from a competitor.


> sufficiently senior devs make 7 figures

I can confirm, known firm, manager role, offer was $1,3M full cash.


Could anyone (successfully) apply for such a position with no referral but CV only?


Not sure as the positions were not even public in my personal situation.


For low-latency strategies, AMD's lack of DDIO [0] makes it a non-starter. The memory latency is a big gap to close.

[0] https://www.intel.com/content/www/us/en/io/data-direct-i-o-t...


Do you know this for a fact? I've done some work in the industry where I needed to make fast software, but never the like sub-microsecond tick-to-trade type fast, so I really don't know.

There was a great presentation from 2017 about some of Optiver's low latency techniques[1]. I had assumed they released it because the had obviated all of them by switching to FPGAs, but I don't know. Either way, he suggested that if you ever needed to ping main memory for anything, you already lost. So, I wouldn't have thought DDIO plays into their thinking much.

[1] https://www.youtube.com/watch?v=NH1Tta7purM


The idea is precisely that you want to avoid pinging main memory at all, which is possible (in the happy case) if you do things correctly with DDIO. Not everything is done in hardware where I am. I am wary of saying much because my employer frowns on it, and admittedly I work on the software more than the hardware, but DDIO is certainly important to us.


how do you access this DDIO feature if you are writing a C or C++ application? intrinsics?


DDIO operates mostly transparently to software, with the I/O controller feeding DMAs into a slice of L3. Hardware can opt out by setting PCIe TLP header hints, and you have some system-wide configurability via MSRs, but it's not something a userspace application can take into its own hands.


so is this taken advantage of by the OnLoad drivers of solarflare cards, for example?


Noticed this just now. It is.


It's configurable via MSR. You can also disable it system-wide or on a PCIe port basis. I detailed it all here:

https://www.jabperf.com/skip-the-line-with-intel-ddio/


There is social context to licenses.

My employment contract states that I am an at-will employee, so my boss could technically fire me because they didn't like my haircut. If they were to _actually_ do this, I would certainly be slighted by this, probably post about it publicly and forewarn others against working for them, although they would not have violated the letter of the contract nor my understanding of its literal meaning.


> There is social context to licenses.

What is the social context in terms of open source software and licences?

> so my boss could technically fire me because they didn't like my haircut. If they were to _actually_ do this, I would certainly be slighted by this

If we translate this to the log4j scenario: log4j says there is no support or warranty provided in their licence, however if they _actually_ do not provide support or warrant, you would be slighted by this.

To me this does not sound fair at all. Your boss at least pays you for your time as part of your contract. What do the log4j developers get for their time? Absolutely nothing. Yet it is expected they should provide support even when the licence says they won't? That's just comes off as entitled.

Drew DeVault has blog post that covers this better than I can: https://drewdevault.com/2021/06/14/Provided-as-is-without-wa...


Right, and I disagree with that post in this sense: there is a social expectation of fitness for a purpose that cannot be disclaimed with a license.

Many projects under licenses providing no warranty are nevertheless of high quality and well-maintained. Making the category in question precise is difficult, but it includes log4j. Projects by organizations such as Apache and eminent individuals like Bellard or Valsorda fall in this category. There is therefore an expectation that if you are such a project, yet unwilling to hold yourself to that standard of quality, you should make it clear for your users. Using a license with a no-warranty clause does not achieve it because it is not a distinguishing factor. The license, of course, protects from legal liability and so on, but no one is talking about legal matters here -- only about whether we should be collectively unhappy with the log4j maintainers.

The reason for this unhappiness would not be that they aren't willing to donate more of their time, but that their stewardship of the project is poor. Vulnerabilities are found in FOSS all the time; this instance was special because the misfeature in question was an egregious inclusion in the first place. It appears to be not a case of lack of time for review, but a lack of sense to say, "no, interpreting strings after formatting is insane and will never be part of this library." Obviously, they are entitled to include whatever code they want in their project, but some code is incompatible with it being useful -- if they do not aim to clear that bar, they should make it clear, because others in their position do.

I would say that something like opening your README with "this is not a serious project, you should not use this in prod" would be reasonable. This warning needs to be front and center and explicit, not merely sating "we are unpaid volunteers" or similar. There is precedent for this. Yes, some ignore such warnings and complain -- as long as this verbiage creates a useful distinction, such people are wrong and we should ridicule them. This warning would stand in contrast with the great many projects which aim to be fit for a purpose in practice, such as Postgres, Linux, Blender, etc. Obviously, such projects are usually better funded than log4j -- making it clear that you're not funded well enough to dedicate much time to the project an important part of this warning's content.

To continue the workplace analogy, I would be the unreasonable one to complain if the company specifically warned that they were significantly more trigger-happy that the normal company hiring at-will.


There is no such context. The licence specifies clearly and completely the terms of use. You cannot handwave an unwritten "social context" into existence, that adds and obligation to the creators that their licence explicitly refused to accept. What you get, of course, is the actual source code.

It's understandable that you would assume such a spurious obligation, human history is full of references to such obligations, up until the age of Big Data, which is when we realized that most of these assumptions were false. It's been a painful time for all of us.

In fact, the actual obligation is yours, if you decided to use this logging library. Seems there was a severe vulnerability in the code. It also seems that the people who responsibly forked the code, ran their own security audit, discovered the vulnerability and then patched decided not to make their contributions known to the general community of users of the software. They, if they exist, seem to be acting as if no obligations exist with respect to the code they acquired.

Speaking of assumptions, your proposed actions regarding your employment assume that your boss was obligated to tell you the reason your contract was terminated. Again, no such obligation exists. They can't fire you out of disgust for your Satanism, or because of your Innuit heritage, or because there are ambiguities regarding your gender. Luckily for them, at-will employees can be terminated, well, at-will, so there is no need for them to specify that it was not, in fact, because of your quite stylish haircut. Your public postings might in fact earn you a letter from the legal department, since you have no way of knowing the real reason was that you downloaded logging code on to mission critical servers, and lacked either the inclination or capacity to verify this internet code, and then when asked about your decision to do this thing, you quoted an imaginary "social context," an unwritten, unknown construct, that in this case silently tacks on the term "users of this library will receive free, unpaid support in perpetuity" that functioned exactly like Adam Keynes "invisible hand," that is, some rationalization to absolve you of the responsibility for explaining problematic aspects of the mental model used in your decision making. This was a vast surprise to the administrators of your company, who, understandably, know very little about logging libraries, which is why they hired someone to provide the required functionality.


I think the thrust of the complaint is that the society doesn't sufficiently value privacy for its own sake.

In a different kind of society, websites of the sort that you describe would be unpopular, because users at large would place less value on the real-person guarantee than on the non-collection of their identifying information.

Closely related to this is the topic of end-to-end encryption. To withstand attacks that I expect will continue to be mounted on it, I think the society has to believe in privacy as a terminal good. The answer to the argument that "we could catch such and such criminals if we had key escrow" ought to be "yes, and not catching those criminals is a price we agree to pay, because privacy is just that valuable to us".


I think it's quite reasonable to compare defer and destructors, in that case.

Destructors probably cannot be usefully imported into C while preserving the simplicity of the language: then you'll want at least unique_ptr to manage your memory with destructors, then probably shared_ptr, and some ownership semantics as you pass those around, et cetera. In that sense, defer strikes a balance between simplicity and usefulness. However, there is still a comparison.


My own experience is that it works quite well for a certain kind of person: on Reddit I was simultaneously subbed to /r/The_Donald, /r/politics, /r/ChapoTrapHouse, /r/Libertarian, etc (while those were still around). I'd also drop by voat occasionally to get my weekly sample of virulently antisemitic takes.

I think looking at extremes is the most realistic path. Purportedly balanced sources are dangerous because their bias is subtle; extreme sources typically have very clear bias that is easy to keep in mind as you. You can read many extreme sources and sort of take the intersection of what they show you to guess at some minimal amount of what must be really true.


Balanced sources tend to give you what the extremes don't, which is nuance.

Does your approach not gloss over the nuance? Or are you able to surface the complexities of a given topic simply by examining the extremes?


It does often gloss over the nuance. I ultimately try to estimate how bad I am at assessing the veracity of arguments concerning the topic at hand, which I think is most valuable.

For example, I read many conflicting predictions concerning the last US election, saw that I could not distinguish bad predictions from good ones, and concluded that I have to remain unconvinced. I was vindicated by it being a very tight race. This doesn't always happen.

On the other hand, I read the recent Texas filing [0] and found that I could confidently argue against it, and the best opposing arguments I could find did not convince me. To my SO, I confidently voiced the prediction that this lawsuit will fail, and articulated why the probability argument in the attached Cicchetti Declaration is misguided. This is arguably a very easy task, so this correct prediction does me little credit, but I think that's the point: even if I only become convinced of things which are obvious, it is important to not accidentally become convinced of things which are not obvious.

[0] https://www.supremecourt.gov/DocketPDF/22/22O155/163048/2020...


I don’t understand the basis by which you think this election was “tight”.


The number of overall votes it would take to change the outcome of the election, compared to the total size of the electorate, is small.

The votes would need to be very precisely distributed, though.


> The number of overall votes it would take to change the outcome of the election, compared to the total size of the electorate, is small.

Sure, with a geographically optimum shift of votes to maximally leverage the anti-democratic nature of the electoral college, it would take about ~125k votes (37 EVs need flipped, ~40k gets PA for 20, ~31.5k gets GA for 16, and ~3.5k gets ME-1 for 1; at least I think that's the lowest-vote-change scenario, and assumes reversals of votes where every change reduces the margin by 2.)

Of course, that would also be by far the biggest popular vote loss by an electoral college winner since the election of 1824, which had four candidates clearing over 10% of the vote, and the only electoral college defeat of the majority (not merely plurality) winner of the popular vote in US history.


Donald Trump won 2016 because he had a 70k vote majority across three states: Pennsylvania, Michigan, and Wisconsin.

What was the minimum number of votes across the minimum number of states needed for him to win in 2020? Again, nobody has actually provided a reason this vote was close - it wasn’t close at all, it was a humiliating rejection, especially for an incumbent.


> What was the minimum number of votes across the minimum number of states needed for him to win in 2020?

I don't know the exact number, but afaik less than 1 million. Compared to the size of the electorate, a few hundred thousand votes here or there is really not that much. It only seems so to Americans because they have historically low participation and high polarisation.


So he won by 70k in a “landslide”, but losing by 7 million in the popular vote, and 1 million in minimum votes an election where 80 million is “close”.

Also, turnout set a 50 year high in percentage of eligible population to vote.

The only people who think this election was “close” are the same ones who keep saying that shocking new evidence will be released tomorrow by Giuliani, but only if I send in a check to the committee to save America.

Losing as an incumbent is humiliating, doubly so when you get rejected by so much of your own party. Trump’s loss was a humiliation, particularly because it was because he was such an incompetent president.


Either op means that going into it, a lof of America was not firm in their predictions - people were firm last time, and a of them were wrong, so were weary to do it again.

It could also likely be that some states were small margins, and some districts even smaller. Overall, though, I agree with you.


You may think it a very easy task, but it is one that a large proportion of our elected officials failed, or possibly pretended to fail for their own political gain.


My experience is surely anecdotal, but I feel your POV applies more to open minded people, while close minded people are more inclined to feel threatened by opposite perspectives.


Sometimes those opposite perspectives really are threatening, though.


True enough. And the response that I think should appeal even to the close-minded: those perspectives don’t go away just because you’re not exposed to them, and you won’t understand enough to push back if you never study then.


> on Reddit I was simultaneously subbed to /r/The_Donald, /r/politics, /r/ChapoTrapHouse, /r/Libertarian, etc

Maybe you were just enjoying reading shitposts? Nothing wrong with that, everyone has their version of tabloids they enjoy, but these are mostly barely thought through hot takes posted to get a reaction (and surfaced because they were successful at it). There's no reason to think their intersection is going to be anywhere near something "true" (let alone usefully true).


^ A person studying their daily bowel movements for political commentary would be better informed than someone who read those subreddits looking for accurate political news, and they’d have a more honest assessment about the worth of their news sources.

I can list plenty of subreddits with worthwhile political discussion, but none of that matters if a persons idea of “balanced” is to find the dregs of fringe and extreme political movements and use them as the basis of said balance. I’d wager that those subreddits represent less than 10% of the views of most Americans.


Would you mind sharing those subreddits with constructive political discussions?


/r/NeutralPolitics tries pretty hard.

The hard part is that reddit is majority liberal, so it's very very hard to find a good balance.

Any random non-political subreddit is going to be liberal slanted. In order to find a conservative slant you have to go specifically to a political conservative subreddit.


Left: /r/progressives

Center left: /r/neoliberal

Right: /r/neoconnwo

Center right: /r/tuesday

Neutral: /r/neutralpolitics /r/geopolitics /r/politicalfactchecking /r/truepolitics

A spectrum of subreddits across ideological views, all with discussions you may actually learn something from. You’ll notice that none of those subreddits have been suspended because their members and moderators are repeatedly calling for violence against their political opponents, nor are they just recruiting boards for Stormfront. Again, finding the fringe conspiracy theorists repeatedly calling for violence doesn’t actually give you a well informed or balanced perspective.


Aren't you just subscribing to an USA bubble now? Is there a way to add e.g. chinese, indian or islamic reddits to the mix?


That's true. I should add /r/Sino to that list. I also subscribe to ChinaTalk, but I'm not sure how valuable a it is for really gauging what goes on in that part of the net. Unfortunately, I can't read Chinese, so I have to trust someone to translate and aggregate that content in the end.

I haven't tried anything outside of US, China (these two being the two major geopolitical players), and Russia (because I am from there and understand the language). I would love to expand that list, but my time is limited.

Another factor is that reading American commentary is entertaining because I live here and am immersed in the culture. The same goes for Russia. I haven't been able to make this work with China: there is a mass of cultural material that I'm not "in" on, so it feels much more like work.


Aren't you just subscribing to the geopolitical bubble now? Is there a way to add quilting, farming, and spelunking?

Tongue in cheek, but I bring this up to point out that while it might be good to expand one's knowledge, it can become a virtue. When that happens, we're all condemned because it'll never be broad enough.


That's an interesting idea! I could see it being good training for simultaneously holding two opposing thoughts in your head at any given time.

What do you hope to gain out of going to the effort of consuming media like this? Why not just go on an information diet altogether?


I think it is valuable to read a hundred convincingly-written arguments in favor of one point of view, become convinced, and then read a hundred opposing arguments and again become convinced. This maintains my awareness of the fact that I'm a terrible judge of veracity of arguments. Since I want to know what happens in the world, I must be exposed to arguments, so I think it's very important to be viscerally aware that I'm an idiot and should use a lot of care.

As for why I want to know what happens in the world and particularly where I live (i.e. North America), it is because those events affect me. If I were on an information diet, then I would probably miss, for example, the recent passing of S.386 [0] by the US Senate, which is intimately relevant to me as my long-term goal is to immigrate to the US.

[0] https://www.congress.gov/bill/116th-congress/senate-bill/386...


That’s very perceptive. Have you been surprised at all, after reading both arguments, which side of the fence you wind up on?


This seems to presume that these points of view you’re talking about have no objective truth value, and that the only worthwhile exercise is constructing “convincingly-written” rhetoric to support one side or another.


I don't take that from the gp at all. My perspective is that he seems to be saying you're not going to understand a position on an issue until you internalize it "as if" it was your own belief. By internalizing one belief and then another that contradicts it, you can truly compare them on the merits and perhaps become aware of the objective reality that they both share.

https://en.wikipedia.org/wiki/Thesis,_antithesis,_synthesis


I consume media the sane way as OP, here are my answers:

1. Being able to hold conversations with people from all political persuasions (eg. Knowing how to reach agreement on things and knowing what pushes their buttons) 2. Entertainment


In my view, the fact that a[b] is equivalent to *(a + b) in C and C++ (in most languages with arrays the latter notation is meaningless) is a sort of a neat coincidence which we shouldn't feel bound to in language design in general.

There are many reasons to depart from this idea in languages far removed pointer arithmetic. For example, Julia has 1-based indexing and I appreciate it for that when doing computational mathematics. It is closer to familiar notation: A[1][1] is the element of matrix A in row 1 and column 1. In a language with zero-based indexing, it is sometimes easier for me to allocate an extra row and column, wasting memory, than to shift indices and risk an inevitable off-by-one somewhere.


I think it's a trope because most people really don't need color printing, so that advice is appropriate for them.

I, for example, have only ever used my printer to print such things as tickets and documents which must be mailed for bureaucratic reasons. My hunch is that this describes many others too.


I think that “most people” really means “most programmer type computer nerds on hacker news.”

I think most people prefer having color. The top 8 printers on Best Buy’s website are all color and/or photo printers.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: