Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gjulianm
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
91.
▲
by
gjulianm
3y ago
It's always a tradeoff, but I'm surprised to see so many people say that just because Python isn't fast it shouldn't get multithreading. Yes, by using Python we leave a lot of performance on the table. We also get a lot
92.
▲
by
gjulianm
3y ago
But thread-unsafe code is not the same as incompatible code. That's the point. You can just choose to say "NOT THREAD SAFE" (just as many C libraries aren't thread safe and need to be wrapped in locks to be used by multi
93.
▲
by
gjulianm
3y ago
You're missing something, which is that a lot of libraries will be "i-don't-care-about-gil". Only native extensions need to choose GIL or noGIL due to the ABI difference, but pure Python libraries should run with the sam
94.
▲
by
gjulianm
3y ago
Which code is automatically going to run in threads? As you say, basically nobody uses Python threads. So even enabling no-gil, nothing is going to change because sequential code will still be sequential.
95.
▲
by
gjulianm
3y ago
I'm one of those happy to see the GIL removed. I've had troubles with the 2->3 transition and more recently with the 3.6 EOL, which wasn't as traumatic but still a little bit troublesome. Despite that, I prefer another tra
96.
▲
by
gjulianm
3y ago
> is there any use case of No-GIL which is not solved by multiprocessing ? Tons: - A web server that responds using shared state to multiple clients at the same time. - multiprocessing uses pickle to send and receive data, which is a mas
97.
▲
by
gjulianm
3y ago
I think there are several reasons: - The history is backwards: it isn’t that devs wanted to make a native library and then chose Python, it’s that they chose Python and then they needed a native library. - Python works very well for scripts
98.
▲
by
gjulianm
3y ago
> Yes, I understood that. However this is new information for me. Where did you get that? There's not a lot of evidence that links sugar intake to cancer risk directly, when controlling for weight. Sugars aren't in the IARC lis
99.
▲
by
gjulianm
3y ago
> I have never heard of this. Where did you get this? I meant that sugar causes cancer through obesity, not that there's an intermediate step between sugar and obesity. > Bacon aside, there is no proof which shows that red meat c
100.
▲
by
gjulianm
3y ago
Here is more detail about the mechanisms by which they could cause cancer: https://pubmed.ncbi.nlm.nih.gov/30376922/ And yes, all bacon, by definition, is processed meat according to WHO's definition. Bacon is sal
101.
▲
by
gjulianm
3y ago
The evidence is well known and any Google search will produce it. Here's a document from WHO: https://www.iarc.who.int/wp-content/uploads/2018/11/Monograp... Spoiler: bacon (as it's a processed
102.
▲
by
gjulianm
3y ago
Well, sugar needs an intermediate step to cause cancer, obesity, which is something that can be controlled. Not to mention that quite a lot of foods have sugar in them and you can't really take it out. On the other hand, red meat and b
103.
▲
by
gjulianm
3y ago
Not really, and the link between red meat and colon cancer is very well established and significant, much more than the alternatives.
104.
▲
by
gjulianm
3y ago
I can't really trust the nutritional advice of someone that deliberately loads up on things like bacon and red meat, which are known risk factors for colon cancer.
105.
▲
by
gjulianm
3y ago
> Give people freedom and let the users decide what they find worthwhile. Well, as I already said what people find worthwhile is the shorter tweets, it's what generates more engagement. I do agree that one gets more value and depth
106.
▲
by
gjulianm
3y ago
> Removing the tweet limit was a massive improvement The essence of Twitter is precisely that the tweets are short, bite-sized thoughts. It's what drives interactions and engagement, removing the limit shows a lack of understanding
107.
▲
by
gjulianm
3y ago
I haven't used Cython too much, it does look really interesting but the translation layer worries me a little bit for more complex modules. However, I've been using pybind11 extensively and it's a delight. Well designed, docu
108.
▲
by
gjulianm
3y ago
I think that at this point this is a discussion about semantics, just as this other commenter pointed out: https://news.ycombinator.com/item?id=36758407 Yes, you can do something in C that somewhat resembles encapsulation.
109.
▲
by
gjulianm
3y ago
LTO isn’t always going to inline things you want it to inline, that’s the main issue I have with it.
110.
▲
by
gjulianm
3y ago
Out of curiosity, how would you do it? The ways I've seen require using another "public" struct and either casting public to private or using a nested pointer, each with their set of problems. In either case, it's still
111.
▲
by
gjulianm
3y ago
As the other commenter said, and I want to reiterate, what led me to start with the talk about the private keyword is the big bold header that says "Myth: C has no equivalent to “private”" and the first code snippet that shows how
112.
▲
by
gjulianm
3y ago
I mean, there's a big header that says "Myth: C has no equivalent to “private”" and a code example about the private keyword, so that's why I started saying that. Even then, my points still apply: this isn't really
113.
▲
by
gjulianm
3y ago
The code sample still isn't equivalent. Now you have yet another pointer, which implies another allocation, another source of possible memory leaks and mistakes, and a separate memory space that will hurt the cache. > Those are impl
114.
▲
by
gjulianm
3y ago
Yes, that's usually how it goes, each header/source is like a "class". And usually, what you have is a "main" struct that represents the "class" itself. In this case that main struct can't have b
115.
▲
by
gjulianm
3y ago
I wouldn't call this equivalent to the private keyword: * It does not work on a field, but on the whole struct. Either all fields are public or all are private. The latter case forces you to write getters/setters for properties yo
116.
▲
by
gjulianm
3y ago
> And by the way, be sure you're ready to sink some time in if you're curious about this game...it's just too good, and I've had to consciously reduce the time I'm spending, because I could just keep optimizing..
117.
▲
by
gjulianm
3y ago
> My daughter was sick with 'rona twice last year (the rest of us seem to have never gotten it) and in both cases it barely registered visually just once on the tests after doing many many tests that showed negative. Well, if anythi
118.
▲
by
gjulianm
3y ago
> this means that level of endemic infection was reached much sooner than claimed by pretty much all western governments No, it doesn't mean that. An easy reason is that most western governments used PCRs for case confirmations. Ano
119.
▲
by
gjulianm
3y ago
> My city had none of those problems I think you missed the part where I said "Maybe the reason it wasn't for you is that you lived in a place where the government took precautions before it got too big". > COVID standa
120.
▲
by
gjulianm
3y ago
Precisely the point of most of those policies was to use rapid tests to ensure you weren't being infections at that moment or close to it. I honestly don't know what's so controversial about them.
More ›