HackerTrans
TopNewTrendsCommentsPastAskShowJobs

genrez

no profile record

comments

genrez
·il y a 5 ans·discuss
Interesting observation. I looked into it a bit.

Could theoretically be for Rust, but it sounds like Rust doesn't have the aliasing optimizations working yet. Based off [1], it looks like Swift's ABI might be able to take advantage of these things. (I don't know much about Swift) Based off [2], it looks like Zig definitely can do these sorts of optimizations. Ada also has aliasing constraints, (you need to specify to the compiler that you want a thing to be aliasable) but I don't know if any compilers use them for optimizations. I know that Fortran can do these sorts of optimizations. Both Ada nor Fortran seem to be undergoing a PR renaissance, so they might be "trendy new languages" for that purpose.

However, given that the other two articles on the author's website [3] are about Delphi and complaining about AT&T assembly syntax, I'd suspect that the author is just a system's programmer annoyed about ABIs.

[1] https://gankra.github.io/blah/swift-abi/#ownership [2] https://ziglang.org/documentation/0.2.0/#Type-Based-Alias-An... [3] https://elronnd.net/writ/
genrez
·il y a 5 ans·discuss
My reading of the study is that both BMI itself and sugary drink consumption after adjusting for BMI among other factors are risk factors for low T.
genrez
·il y a 5 ans·discuss
narush points out elsewhere that this isn't a controlled experiment, so take these numbers with a grain of salt. Also I am not a statistician, so take this with another grain of salt.

That being said, if I am interpreting Table 2 correctly, the study is saying that consuming a large amount of surgery beverages causes your risk of having low-testosterone related problems to rise by 2.29 times compared to not drinking many sugary beverages. This is after correcting for age, race, BMI, alcoholism, and physical activity levels.

The risk increase before correcting for these things is 2.78 times, so that would seem to indicate that sugary beverages do have a pretty large effect compared to the confounders they choose, though it is still possible sugary beverage consumption is acting as a proxy for something else.
genrez
·il y a 5 ans·discuss
Just FYI, the standardjs link doesn't seem to support your point here. It seems like standardjs is mostly about forbidding confusing syntax and obsolete APIs. (like .__iterator__, which appears to be replaced by Symbol.iterator, or .__proto__ which is replaced by .getPrototypeOf())

The only item which standardjs forbids that I could identify as possibly producing a decent performance improvement if used is the "with" statement. They also forbid wrapping non-objects in objects, which I guess could provide extra-expressiveness, but seems like it would usually just be a performance penalty.

I have seen people recommending obviously inefficient things like including large third-party libraries just to look up an element by class name, but standardjs looks like it is just a set of linting rules. I don't agree with all of them but I don't think there is a set of rules everyone would agree to.
genrez
·il y a 5 ans·discuss
I'm learning all sorts of things today! handleEvent certainly seems like the language certified way to do this. It does seem like that means you need a case statement in handleEvent if you want to listen for multiple events, which I guess is not the end of the world. It does solve the "redefine the function for every object" problem though, provided any third party apis understand the EventListener interface.
genrez
·il y a 5 ans·discuss
Excellent point! I can see that getting confusing quickly.

Edit: I was confused about how this could work, so I dug through [1] for a bit. It appears that for each object of that class created, an arrow function will be created on that object and its this will indeed be bound to the same scope that the constructor function is bound to. This is really cleaver and I applaud whoever thought it up!

It is interesting to note that this creates a new arrow function on each object as opposed to the normal definitions which create a single function which is stored in the prototype of the class. (its easier to check this in a browser's dev console then it is to decode the spec)

This would suggest that one should use different approaches for different types of objects: It makes sense to use arrow functions for "resource" or "actor" objects, of which there are few but they may have callback functions. It makes sense to use normal method definitions for "plain old data", of which there may be many, (which would make the arrow functions too expensive) but they should not have callback functions.

[1] https://tc39.es/proposal-class-fields/unified.html
genrez
·il y a 5 ans·discuss
Interesting to know that what the article recommends is indeed the industry standard. I'd forgotten about hoisting until you brought it up!
genrez
·il y a 5 ans·discuss
I agree that inheriting the `this` for arrow functions is beneficial. To me it seems like you would want to use the normal syntax for global functions for hoisting and to prevent unintentional re-definitions, the arrow functions where you would use lambda functions in other languages, and the class method syntax for methods.

side-note: Most of my JS experience is writing userscripts for myself, so I definitely do my share of 'this' shenanigans.
genrez
·il y a 5 ans·discuss
I am a noob to Javascript, so if someone knows better, than please correct me about this, but arrow functions aren't meant to replace normal function syntax, right? From [1], it seems like the main point of arrow syntax is to allow you to inherit the "this" parameter if you are inside a method. Meanwhile, you need normal function syntax if you are creating a constructor, making a method function for a prototype, or making generator functions. (I didn't even know javascript had generator functions until just now :))

So it seems a bit weird to me that they advocate using arrow function syntax instead of the regular syntax. They seem to be advocating using the new class syntax instead, so I guess they don't need the constructor or method creation features of the normal syntax, but I still don't see why they would specifically advocate for arrow function syntax. Is it faster? They say it interferes with other features, but which features?

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
genrez
·il y a 5 ans·discuss
I've read v1 of the book, and the author does cover the fact that many parallel problems can be covered by using shell scripts or databases. He calls these problems you are talking about "embarrassingly parallel" and encourages the reader to take advantage of parallel tools whenever possible.

The rest of the book talks about doing data sharing efficiently (i.e. for not embarrassingly parallel problems), including some things I don't think I ever would have run across otherwise like RCU. All the while he explains the use cases for each of the techniques. If you are interested in making the most of your processors (and I suspect you are given this post), and are up for a technical read, I'd highly recommend this book.

EDIT: By which I mean to say that he covers all the stuff you posted, and explains exactly when it is worthwhile to use the high performance and communication techniques. If you want to know just the basic stuff, read the first 3 chapters.
genrez
·il y a 5 ans·discuss
I think I understand now. Thank you for explaining. To me Western culture is a set of knowledge and practices one grows up with, but I don't attach my identity to any particular culture, nor do I hold people responsible for any harm caused by practices their country's culture accepts. I can see that if someone had said something like "programmers are weird", then it would feel like an attack to me though because I identify as a programmer. Many people do attach their identities to their county's culture, so we should be careful about how we discuss cultures. Did I miss anything?
genrez
·il y a 5 ans·discuss
I agree that the article is poorly written, and doesn't more than tangentially make the point I was making. I think I can understand why you would want criticism a poorly written article in the supposedly high quality BBC. My curiosity is peeked about the inclusive society point. Nothing in the article ran afoul of my speech norms. I don't think my speech norms are particularly well developed though. What part of the way the article makes its point is something you would not accept?
genrez
·il y a 5 ans·discuss
I agree that the article does choose not to say that their claims are backed with evidence. The article in fact does correctly state that they don't have evidence that bed-sharing is safer. However, they do state that room-sharing is current pediatric best practice, and provide links [1], [2] to articles to back that up.

Given that as far as I know, room-sharing is not standard Western parenting practice, I believe they have backed up with an appeal to authority the idea that Western style parenting is harmful. Furthermore, link [1] contains a link to [3] which is an recommendation from a pediatric journal that provides links to scientific papers that suggest room-sharing reduces SIDS risk by up to 50%. (see bullet point 4 of link [3]) Thus I think the appeals to authority are backed by evidence.

Thus I think that the article could have made a stronger point if they had talked about room sharing more instead of bed sharing, but I think they do have an evidence backed point that Western parenting is potentially harmful. They avoid ruffling parent's feathers too much by understating their point.

[1]: https://www.aap.org/en-us/advocacy-and-policy/aap-health-ini... [2]: https://www.lullabytrust.org.uk/safer-sleep-advice/ [3]: https://pediatrics.aappublications.org/content/138/5/e201629...
genrez
·il y a 5 ans·discuss
I think that the article is trying to point out that some western parenting practices are potentially harmful to infants. In this case, "weird" is a very kind way of expressing the articles concern.