HNHacker News
TopNewBestAskShowJobs

_yosefk

3,127 karma · joined October 6, 2012

Yossi Kreinin (Yossi.Kreinin@gmail.com, http://yosefk.com)
submissionscomments
_yosefk··on How Intel Makes a Chip
"It costs more to make a chip than a plane" - nope, not if you don't build the fabs as Intel does. Of course Bloomberg (or at least many people there) should and does know better.
_yosefk··on Intel and ME, and why we should get rid of ME
Do you think the keylogger running on your and my machine came in by exploiting the ME or a C buffer overflow somewhere in the OS or userspace code that sister claims you "control"?
_yosefk··on Intel and ME, and why we should get rid of ME
Prediction: over time, there will remain no commercially significant high-end chips without this sort of a "security subsystem." Recommending ARM, PowerPC or other architectures over x86 as the FSF suggests will not get you very far because the problem (or as chip vendors call it, the solution) is not in the ISA, it's in the chip, and every chip vendor making the sort of chip that can power a general-purpose computer will end up being this way.

Of course in practice, as long as say Linux runs on the machine, the existence of the ME or the like is almost inconsequential for the user, because you run the same software, and there's never a shortage of security vulnerabilities right there in the OS and the userspace software. In terms of the impact on the number of vulnerabilities, eliminating C and C++ would go way further than eliminating black box "security" hardware, just because the huge amount of C and C++ code, much of it written hastily and committed the moment it "runs on my machine", presents a much larger attack surface than the black box hardware + software system. But of course the FSF will never recommend ditching C and C++.

_yosefk··on Awesome C++ – find the best libraries
I've seen and ported such programs. I no longer remember what the problems were, but I think some of them had to do with array initializers - C++11 seems to have become stricter wrt implicit casts of values used to initialize arrays (meaning that more casts need to become implicit.)

Perhaps it's a compiler issue, not a language issue; my only point is that the issue exists (and I'm not saying it was that terrible - I recommend everyone to upgrade to C++11 - just that code will not compile unchanged.)

Sister comments say that they have old C++ code that compiles just fine. Of course such code exists, I'm just saying that not all code is like that; I bet you can get there with Rust or some other reasonably stable new language if you program conservatively enough. Also a big question is what platform your code runs on; if you've targeted gcc since forever and you don't use -Werror, then your code and your Makefiles will be very stable relatively to having to port to VS - even if you're not really targeting standard C++ but the dialect GNU C++. Different C++ compilers, build environments and platform libraries are very different, and it seems a safe bet that newer languages will do a better job of minimizing differences between implementations (or keeping their number small.)

Porting C++ code compiling fine under g++ to clang, for instance, is a metric ton of work (and this one I gladly wasn't involved in but I've seen others do it; again, if your C++ code ports just fine, more power to you.) And g++ and clang are much closer to each other than the average pair of C++ compilers.

_yosefk··on Awesome C++ – find the best libraries
I'm not sure C++ is more stable than Rust. It's pretty stable but it does introduce breaking changes and code written 10 years ago will not compile as C++11 without changes. Of course if you need to port C++ code across platforms, which can easily happen if code is to survive a decade, then even if the built-in type sizes don't change, you'll have to deal with things like there being no standard build system for C++, no standard interfaces for most of the functionality found in an OS, etc.

Overall, while C++ indeed is fairly stable, I wouldn't bet on C++ code to be easier to drag into the future than code in those other languages (of course I wouldn't easily bet the other way, either; it's hard to know in advance with these things which will bite you the hardest.)

_yosefk··on Chess legend Viktor Korchnoi has died
As a dissident under the Soviet system, Korchnoi didn't have the chance to prove himself in international competition in his twenties or thirties

I don't think he was a dissident in his twenties or thirties, and he did play in international tournaments.

_yosefk··on ‘Dilbert’ Creator on How Trump Is Like the Founding Fathers and Jesus
This is not your usual endorsement to say the least:

"I would be a top-ten assassination target in that scenario because once you define Trump as Hitler, you also give citizens moral permission to kill him. And obviously it would be okay to kill anyone who actively supports a genocidal dictator, including anyone who wrote about his persuasion skills in positive terms. (I’m called an “apologist” on Twitter, or sometimes just Joseph Goebbels).

So I’ve decided to endorse Hillary Clinton for President, for my personal safety. Trump supporters don’t have any bad feelings about patriotic Americans such as myself, so I’ll be safe from that crowd. But Clinton supporters have convinced me – and here I am being 100% serious – that my safety is at risk if I am seen as supportive of Trump. So I’m taking the safe way out and endorsing Hillary Clinton for president."

I came here to say that he must have changed his tune because Trump's luck seems to have turned for the worse based on the latest poll numbers; but he still predicts Trump will win, so I guess maybe it's not that or at least he's changing his tune gradually, hedging his bets.

(For the record, I generally think that Scott Adams is a troll and everything he writes is clickbait, he himself said his traffic increased 5-fold since he started writing about Trump. As to his correct prediction of Trump's rise, I think that's the prediction one would have made based on polls alone (certainly Nate Silver admitted that his abject failure in this instance was due to ignoring polls.) Since Adams apparently doesn't care about the outcome as much as Nate Silver and other professional journalists, he didn't have a bias to cloud his judgement, or rather his ability to parrot polls which is where the actual data comes from. His drivel about his mastery of persuasion skills as the basis of his political analysis seems to me not that convincing, since the supposedly stellar examples of persuasion that he shows outside of the election business look pretty bad to me.)

_yosefk··on The Barbell Effect of Machine Learning
Apart from PageRank not being based on ML, there's also the fact that Google did better search than those other services which also had the data, and it does better search than Bing now though Microsoft has no shortage of data, processing power, or money to acquire more of both.

Generally how much data you need for ML varies with the problem and to say that it's all in the data and large server farms is perhaps a nice talking point for VCs but can be completely true, completely false, or anywhere in-between depending on the problem.

_yosefk··on Basic income plan clearly rejected by Swiss voters
You can say this about any level of democracy though (that its downside is populistic decisions, or, more precisely, decisions that you or I think are wrong.) It's easy to find a country where most decisions are made by elected leaders and they chose leaders you or I find terrible, who proceeded to make a lot of bad decisions. I don't see an argument either for more or less direct democracy here (though I guess with some data and given a belief of what decisions are "good" one could construct an argument.)

The US population for instance prohibited alcohol and then undid the prohibition, and I think the least that can be said in favor of this process is that since then there's seemingly a consensus in the US wrt prohibition. I'm not sure such consensus is achievable when elected officials enact laws, not to mention when a Supreme Court reinterprets the constitution to de-facto enact a law.

Overall, to me it seems that decisions will be made and reversed no matter what's your process, and it seems that referendums are a great way for the population to "own" the decision - not just affect it but feel responsibility for it.

Also I'd guess that more direct democracy would reduce both stability and corruption (people are more likely to change the status quo, harder to bribe, and not as likely to form 2 or some other small number of groups voting together on every issue as professional politicians.) It seems that we have a lot of both stability (presumably a good thing) and corruption (presumably a bad thing) and it doesn't look like a terrible gamble to attempt to reduce both.

_yosefk··on GNU Toolchain Update – GDB now supports Rust
I use gdb's Python API all the time, and I'm really happy that they have it. It's good for custom pretty-printing (well, almost - I wish p vec[6] worked well and not just print vec if vec has a pretty printer defined for its type) and it's good for commands needing to access a bunch of state and print a custom summary/run external commands based on that (for instance, view an image object graphically.)

So when you say it's not good I guess you want to do other things (which?) - or else you mean that it's messy (if so I ought to say that I've seen much worse and in relative terms I'd say gdb's API is rather lovely.)

_yosefk··on Why Are the Highly Educated So Liberal?
Erm... I wouldn't say that the average liberal feels that there's much they don't know, and that they might be wrong about a lot of things. (I wouldn't say that the average conservative is like that, either.)

I believe that academia is the perfect place for the formation of cliques which over time exclude non-believers. Right now there's a powerful liberal clique in academia - but over time it could be replaced by anything, really. At some point eugenics were all the rage, today it's taboo, etc. And since educated people pass through the academia, and receive a lot of information filtered through the leading clique, they're likely to share the clique's views. (Whether, on top of that, educated people also simply exhibit less critical thinking and original opinions based on their own experience than the average person I don't know; I wouldn't be surprised by it being either true or false, I can certainly construct a believable narrative explaining both possibilities.)

Speaking of eugenics and such... how do I put this, in hindsight people reevaluate their ideas wrt what's scary, and the British Labor and Liberal parties' insistence that Nazi Germany wasn't particularly scary seems to me to be a pretty good example. I think this shows that "you're generally not threatened of things you understand" sometimes is less accurate than "you're not threatened of things that you completely misunderstand, while those who do understand them are right to be scared shitless about them." And sometimes, like in this case, "you" are more liberal than "them", and sometimes it's the reverse.

_yosefk··on Nvidia CEO: We'll be solving VR immersion problems for the next 20 years
You mean how many chip cycles he needs, right? How many he's got we all know: maybe 2. Then CMOS scaling is over. (Not that things will completely stop evolving, but they'll surely slow down.)
_yosefk··on You Can't Always Hash Pointers in C
I think you can do that test by comparing pointers, you just can't subtract them. (The SO answer you link to also points out that comparing and subtracting are different, but I'm not sure that what I said follows.)

In practice, almost all C and C++ programs depend on both implementation-defined and undefined behavior, and, modulo security implications, that's fine as long as you test the program properly after compiling with a new compiler.

_yosefk··on Challenging the myth that the rich are specially-talented wealth creators
TTIP is pushed by corporations, not individual rich people. A corporation will want that even if every one of its stockholders has a below-median wealth. More generally, organizations and people working for them will pursue their goals and these goals will be misaligned with the interests of the population at large even if nobody is involved whose net worth is particularly remarkable. If corporations are eliminated and most work is done by government agencies, then these new organizations simply become more shielded from all sorts of punishment from the population compared to corporations.

The rising nominal wealth of the richest people since 2008 is largely a result of asset price inflation resulting from low interest rates; the wealthy person is not more wealthy, however, holding a more expensive stock if the dividends and the profits are about the same as they used to be when interest rates were higher and stocks were cheaper, in fact the wealthy person is largely worse off since risk-free income is gone.

As to "unjust and dysfunctional"... aren't we all. At least a rich person can lose money in a variety of scenarios and can be intimidated by this possibility. A tenured academic pays no price whatever he does, so he's more scary that way.

edit: I'm not saying people aren't responsible, just that many of those responsible aren't that rich, and even if you mandate a ceiling on wealth and income, guess what, people will still want to get things done (because you will have a mechanism making them want to, otherwise nothing gets done - of course you can very much choose that, too), and guess what, people will get "their" things done at your expense.

In fact it's people who blame the rich who claim that people aren't responsible (their money/assets - the thing making them rich people on top of just "people" - is responsible.) I'm absolutely saying that people are responsible, and taking money from people will not solve very much.

This is not to say that nothing can be done; jailing wealthy criminals is a good start. A great economist whom nobody will blame for excessive concern for the welfare of the wealthy who'll be glad to show you his list of things to do, but who's nonetheless not "Pikettian", is Dean Baker.

_yosefk··on Steve Blank: 'VCs Won't Admit They're in a Ponzi Scheme'
"Nowadays, most of the liquidity is happening for large companies paying for startups and hedge funds buying into the latest round. So when this crash happens, it's mostly going to affect the later-stage investors," Blank says. That's different from what happened when the bubble burst previously, inasmuch as "It [the '99 crash] destroyed a lot of public value, not just private capital. Your grandmother got hurt as well."

Newspapers were complaining about the public being unable to invest in unicorns, with all the benefits going to wealthy private investors. Then people on HN started echoing these sentiments (the part where stuff from newspapers gets planted into the heads of normal people and becomes their opinion is really scary, I guess it must be happening to me, too. Really scary to watch this happen though, reading some weird idea in a newspaper and then reading/hearing it repeated by people the next month.)

Will newspapers remember to thank wealthy private investors for taking the hit when the bubble pops? (BTW, what AFAIK doesn't exist but could is a VC fund with publicly traded shares. Of course the average VC produces below-average returns.)

_yosefk··on The Curse of Culture
IMO what the article talks about is the business model, not the culture, they are two separate things - not entirely separate, but mostly. Business model is Apple shipping devices and Google providing ad-supported services over the Internet. Culture is how in one company you can't push changes to the central repository without a code review which might take a couple of days, while in another you can work whichever way you please but if things break you're expected to fix them on Sunday at 3 AM.

Like the business model, culture is certainly influenced by the people at the top, though I think it's defined by a somewhat larger number of early employees, and it's harder to change once established, compared to the business model. Both affect performance in the market, but it's not as straightforward to analyze, even in hindsight, how exactly culture affects market performance relatively to the business model where in hindsight it's perfectly clear.

_yosefk··on The surprising cleverness of modern compilers
LoopIdiomRecognize::recognizePopcount? Then I think it's more about "the surprising ability of modern compilers to recognize popcount" than general "cleverness."

(I suspected it was this kind of thing, but I thought maybe it was something more generic.)

_yosefk··on The surprising cleverness of modern compilers
Indeed, Clang/LLVM did a stellar job here. It'd be interesting to know how (in part to understand what situations can one expect this sort of thing to happen; for instance, I'd be surprised if IEEE floating point emulation code would be compiled to a hardware floating point instruction - though perhaps I underestimate the optimization passes at work here!)
_yosefk··on Type-based aliasing in C
I didn't know the part where the standard lets you malloc a buffer, write it as int, read it as int, then write it as float, and read it as float, all without freeing, and how the compiler thus has to treat heap memory differently from other memory. The part where compilers are too aggressive to follow this rule actually makes sense (as it seems to greatly increase the chance of valid optimizations based on type-based alias analysis to actually happen; it's hard to prove that a given pointer wasn't malloced.)

I wonder if the story is different with C++'s operator new, which returns a typed result.

_yosefk··on Japan adding mandatory programming education to all elementary schools
I think programmers overestimate the value of programmatic problem solving. IMO it's slightly under understanding how cars work (something I have no idea about and as a result, I waste money on new leased cars so as to avoid maintaining older ones), nowhere near as useful as literacy or basic arithmetic. The reason is that contrary to Alan Kay's opinion, computers not just aren't, but can't be usefully applied by most people without a lot of professional programmers providing them with software for the task at hand.
_yosefk··on Visual profiler for Python
Actually KCachegrind displays files in an open format and is great for visualizing profiling info obtained from other tools.
_yosefk··on Context switch logging with the Windows Event Tracing API (2014)
I've used Win32 (I guess calling it that in the 64b era dates me) including some of the COM stuff, though I guess not as extensively as you did (TFA definitely brought some memories, the stuff looks a lot like the usual Win32 stuff.)

I think it's generally hard to make an easy-to-use API in C, unless the memory management involved is really trivial. (Let's ignore C++ for the moment including Microsoft's attempts like MFC and ATL, on the theory that binary compatibility issues make C that much more practical than C++ for this kind of thing.) IMO say poll or select (and the rest of the socket API, actually) aren't a picnic, either, and the only way to have a nice experience with these is by using a higher-level wrapper, and that's because everything involving variable-sized data structures, or any sort of data structure nesting, or literal initialization of this sort of thing, or lifecycles and memory management, or callbacks with private state, etc. etc. is just gnarly in C. (In C++ everything of course is just ducky and hence we never tire of articles discussing why smart pointers should really be passed by reference and shared_ptr is as good as gc except it's slower if used throughout and it doesn't work with circular references and don't use it unless you really have to etc. etc.) I haven't used the standard X C API but I glanced at it and it didn't looked very appetizing; that Microsoft's C API for GUI and OO looks worse than most of the standard Unix APIs kinda results from MS's APIs doing more, IMO, and X in particular, or Motif, which do more of what Win32 does, do not seem superior to Win32 in terms of usability, though if someone with experience in both strongly disagrees I'd take their word for it.

Now if you're saying that their C APIs of today are better than my argument is off. If you're saying that say writing a Windows program in C# is better than a C/C++/VB COM-infested program, then I think it's more of a testament to the strength of .NET/similar runtimes than anything else.

_yosefk··on Context switch logging with the Windows Event Tracing API (2014)
This API is for people (both program authors and users) who really know quite well what they're doing, for very rare occasions, and the alternative/status quo was to not be able to get this info from the kernel at all. I imagine someone at MS thought they did a favor to people doing performance optimization by giving them something instead of nothing, perhaps they even had to fight to include this feature in the product because obviously Windows would sell rather well without the feature. They must have had a bad day reading this criticism.

(I'm not saying "poor Microsoft" - it's definitely not poor - and I'm not saying "you should thank people for whatever API they give you" - a lot of programs/features do more harm than good - and I'm not saying someone shouldn't vent having had a lot of time burnt by some ugly API. I'm saying specifically that this here is a dark corner of the OS that the API in question sheds at least some light on and I have a hunch, perhaps an entirely mistaken one, that it was someone's pet initiative and they thought it was definitely better than nothing. "Little did they know." To take a simple example of the other kind of API: sprintf, the version that doesn't take a buffer size, is a really bad API because that's something everyone's gonna use a lot and you just shouldn't give this kind of thing to people (give them snprintf at the very least) and you certainly can't be excused by "one should know what they're doing" in this case because it's between hard and uneconomical to use safely while passing the buffer size is the obvious thing to do, also one seems entitled to care-free string formatting, definitely 100x more so than care-free kernel status monitoring on the grounds of it being something many more people do much more often.)

_yosefk··on Love thy coworker; thy work, not necessarily
I met a guy I studied with recently, he found my blog and invited me to dine together. It turns out he managed a team of remote workers, and he ranted how those office buildings where you catch infectious diseases are a thing of the past (he also freaked out when I sneezed.) However he also wanted to meet various people from our joint past, like he just met me, which was kinda weird given that we were never best buds or anything, and I think this ought to have to do with a shortage of time spent in office buildings where you catch infectious diseases.

Personally... I'm not smug about this at all, I'm the opposite of smug; because the stuff I'm doing in my spare time of which I now have more does not involve such an office building and I really wonder whether a void will form there.

_yosefk··on Love thy coworker; thy work, not necessarily
You actually sound like you fall on both sides similarly to the way I (TFA's author) do, seeing that you did high-paid less lovable work and then more lovable work for less pay. (At the moment I program 3 days a week and during the other days I animate without any plans to get paid for it.)

My point was mostly that one could be equally valuable (or, conversely, pernicious) at both types of jobs having either sort of motivation.

_yosefk··on Love thy coworker; thy work, not necessarily
I've never lived in either a Protestant or a Catholic country (I've lived in an Orthodox country and a Jewish one), so the following guess isn't based on much first-hand experience, but I'd guess that "love your work" in the Protestant sense is probably closer to what I mean by my tongue-in-Bible "love thy coworker" than to "program for free during your weekends and publish code on github." That is, "work ethic" - yes, but because that's the proper way to get things in return for things in a society, not because nothing is more fun than neural monadic closures.
_yosefk··on A former CIA spy has revealed his key role in the arrest of Nelson Mandela
Grandparent said "communist", not socialist, so while many people argue about the difference it doesn't seem relevant here.

Revolutionary Spain did not survive long enough to discuss IMO.

Cuba... egalitarian in what way? Is there anything the government does that the citizens can legally undo without overthrowing it? (Note that a benevolent dictatorship can exist, in theory, and among other things it can be a communist - or a racist - dictatorship; nothing prevents from the dictator to grant freedoms to the subjects, the point is that nothing prevents him from taking them away, either. If you don't refer to rights in the sense of things the government cannot prevent you from doing but instead refer to "egalitarian" in some sense of Cuban citizens living substantially different lives than Soviet citizens, I'd be curious to hear what exactly you mean.)

_yosefk··on A former CIA spy has revealed his key role in the arrest of Nelson Mandela
An egalitarian communist state has never existed, it's always a state where the ruling party does as it pleases while the majority has no rights whatsoever. (Whether this is superior or inferior to an apartheid state is a tough question.)
_yosefk··on Whoever does not understand Lisp is doomed to reinvent it (2007)
Common Lisp has static types.
_yosefk··on No Sane Compiler Would Optimize Atomics
I think that different elements of the language call for a different approach. I believe that everything related to mutable shared state calls for a very conservative compilation approach, because the potential benefits seem to me rather tiny while the potential drawbacks seem very large (since when it comes to race conditions, runtime testing is at its weakest when trying to find bugs in the code generated after a compiler upgrade.) To me it doesn't make sense economically. But this is not the case with a whole lot of other optimizations. I think that making this distinction is my modest attempt at being on the right side on this issue :-)

(So I agree that the original quote taken literally and out of the original context does become a nice talking point contradicted by reality; I think however that it's much more sensible in its original context - and the context of this discussion - this context being optimizing code working with mutable shared state.)

← PreviousPage 6 of 23Next →