HNHacker News
TopNewBestAskShowJobs

beltsazar

897 karma · joined November 2, 2013

submissionscomments
beltsazar··on Algebraic Data Types for C99
> To me it feels very similar to an interface (trait) implemented by a bunch of classes (structs)

Then you might not fully grok sum types yet.

> From my perspective a discriminant vs a vtable pointer is a boring implementation detail the compiler should just figure out for me based on what would be more optimal in a given situation.

Disagree. It's a design choice that should be decided by the programmers. There's a tradeoff—choosing which should be easier: adding a new variant or adding a new function/method. It's called the Expression Problem: https://wiki.c2.com/?ExpressionProblem

beltsazar··on Caniwebview.com – Like Caniuse but for Webviews
The Web has a lot of features, but not all of them are implemented by all browsers. The website (caniuse.com) provides you the info about which features are implemented by which browsers. So now you as a webdev can consider which features you want to use in your web apps.
beltsazar··on Israel shuts down local Al Jazeera offices
What do you mean? Israel ranks 30th in The Economist Democracy Index: https://en.wikipedia.org/wiki/The_Economist_Democracy_Index

It's not great, but it's also far from what you said "democracy only in name."

beltsazar··on You are what you read, even if you don't always remember it
And vice versa. Your mental function won't work optimally if you're not fit.
beltsazar··on You are what you read, even if you don't always remember it
> you are the result of all the past sensory interactions that you experienced in your whole life

That's only the mental aspect. Physically, you are also what you eat and how often you exercise.

beltsazar··on Calculus Made Easy
I feel the opposite. In high school I was pretty good at solving calculus problems but had little understanding what "limit" actually is. When in college I finally understood the definition of limit and all the foundational theorems arised from it, I was blown away.

For most people—who won't solve complex math problems daily at work—the takeaway from learning math is not their mechanical ability at solving math problems. The takeaway is their understanding of math concepts and ideas, which will shape their thinking skills in general.

beltsazar··on 20 Years of "Not Even Wrong"
Edward Frenkel made a great analogy:

> So first of all, correct, the beautiful ideas came out of string theory. But that was not the original promise of string theory. The original promise was to describe the physics of this universe, unify all forces of nature, the three forces, electromagnetic, strong and weak described by the standard model and quantum theory of gravity. This has not happened. And now we hear that actually was not such a big deal. It's actually such a big thing. We've learned so much more.

> It's like, you know, I tried to think of a good analogy. It's like, remember Moses? He took Israelites out of Egypt. Mm hmm. And he told them that he will lead them to the promised land. Yes. So imagine Moses after 40 years of wandering in the desert, you would say, you know, guys, you know, this idea of a promised land is not such a big thing. Look how much we've learned. We've learned about the desert. We've learned so much about the sand.

> [Interviewer: That's a great analogy.]

> Who cares about the promised land? What do you think would people say to him? And yet here we are. This is called, by the way, you mentioned this expression, moving the goalposts. This is not moving goalposts. This is going to a different stadium. It's starting to play a different game. Like you used to play soccer at one stadium. Then you go to another stadium. You start playing baseball and you say, no, we are playing soccer. We're still playing soccer. Yes, yes, yes. Stating that your original goal is not meaningful.

> It did not work out. It did not work out. How about just starting with that? It did not work out unequivocally, not by saying the next 10 years [it will].

Source: https://www.youtube.com/watch?v=n_oPMcvHbAc

PS: It's probably one of the best podcasts I've ever watched. It made me realize the obvious thing: that scientists are also psychological humans, each of who has subjective personal preferences, even if they don't realize or admit them. Case study: https://www.youtube.com/watch?v=n_oPMcvHbAc&t=8712

beltsazar··on Cousins are disappearing. Is this reshaping the experience of childhood?
> I couldn't care less what others do with their lives

From your previous comments, you care about your parents and friends and future children. So now change "all humans" in my previous reply to "people you care"—what's your response?

> This conclusion is mine and mine alone and everyone else should draw forth their own rather than take mine as gospel or inspiration.

If you honestly thought that, you wouldn't have shared your long opinion in this thread. People share comments on HN for others to discuss and debate. You can't just share something and defend it by saying it's your personal thought. Just keep it to yourself, then.

beltsazar··on Cousins are disappearing. Is this reshaping the experience of childhood?
If you truly believed what you said you believe, you'd wish you and all humans and all living things die asap, instantly, and painlessly from supernova or something. That way, all living things could leave together this horrible world you said. Death is better than life.

You might also wish that the Big Bang had produced matter and antimatter the exact same amount, so they would have perfectly canceled out, and there wouldn't be any matter at all in the universe. Nothing is better than something.

beltsazar··on Cousins are disappearing. Is this reshaping the experience of childhood?
> Life is composed of both happiness and tragedies, but tragedies by far outnumber the happiness. If I were to specify an exact number, perhaps somewhere in the vicinity of 9:1 tragedies:happiness.

> Some of the tragedies are also guaranteed and unavoidable from the moment you are born.

That's a grim perspective of life. For your personal life, do you think that the happiness you've experienced worth the tragedies that have happened to you? If so, don't you want another human (your child) to experience the same?

If it's not worth it, what makes you keep on living, then? (Assuming that you do.) Or do you wish that you had never been born in the first place?

beltsazar··on Cousins are disappearing. Is this reshaping the experience of childhood?
> I don't really care about the preservation of the human species. I'm going to be dead in the next 40 years or so, why should I care?

If most Homo sapiens had the same attitude, the species would have gone extinct since forever lol.

You can have any personal goal you'd like, but from the evolution perspective, the purpose of any living organism is to survive and to reproduce, hence preserving its own species. That's why.

beltsazar··on Cousins are disappearing. Is this reshaping the experience of childhood?
> Edit: the replies - y'all are out of touch.

If you're in the minority, maybe you're the one who's out of touch?

It's not that they can't afford having children—many of those who are less fortunate than them still have children. It's just that they think the cost of raising children, which likely affects their current lifestyle, is not worth it.

beltsazar··on Identifying Rust's collect:<Vec<_>>() memory leak footgun
> Just a few months ago, I ran into the same problem, although it wasn't caused by `collect()`. It was caused by "normal" `Vec` usage

If it wasn't caused by `collect()`, then I suppose it's a related problem, but not the same problem. Your problem was caused by, as your commit message says, "ignorance [original: ignorant] of the broader effects of this strategy [double-when-full] in aggregate"

The OP's problem, otoh, is more about reusing memory that has been allocated when you "convert" (in Rust term: into_iter()) a Vec to another Vec. What's more, the reuse also happens even when the new Vec has a different type from the original Vec's type. This behavior is more surprising than the double-when-full strategy, which is more widely known by programmers (even if sometimes they "forget" about the implications).

beltsazar··on Identifying Rust's collect:<Vec<_>>() memory leak footgun
After skimming the first few paragraphs, I almost commented something similar to yours. But after reading it until the end, the problem is more nuanced than that.

The issue is more about reusing memory that has been allocated when you "convert" (in Rust term: into_iter()) a Vec to another Vec. More surprisingly, the reuse still happens even when the new Vec has a different type than the original Vec's type. You should read the whole post—it's more interesting than I (and you) thought.

beltsazar··on Zig cookbook: collection of simple Zig programs that demonstrate good practices
> Why should the first priority be memory safety?

Because it's easy for beginners (and even experts) to create a memory safety bug, which is more critical than most bugs.

> If the first priority is always memory safety, then rust should not have `unsafe` keyword.

Err.. I suppose you don't fully understand how memory safety in Rust can be achieved. Every safe abstraction (function, trait, etc.) depends on unsafe code, either directly or transitively.

What's the difference between a safe function and an unsafe one, then? A safe function won't violate memory safety, no matter what combination of arguments passed to it.

beltsazar··on Zig cookbook: collection of simple Zig programs that demonstrate good practices
Why shouldn't the unexperienced systems programmers go "all in" by using Rust, then? The first priority for them should be memory safety. Not to mention that Rust has more ergonomic features and stronger ecosystems.
beltsazar··on Things are about to get worse for generative AI
> Or... things are about to get worse for copyright holders.

If that's so, things are about to get worse for everyone, too. With little to no protection against AI, no one will be incentivized to create new IPs, whether they're books, drawings, songs. Or even films and games, when AI is able to also generate those in the (possibly near) future.

beltsazar··on Ask yourself dumb questions and answer them (2020)
I'd go further to say that if you don't ask to yourself a single question while you're reading a substantial part of a book (a section, a chapter), then you don't really internalize what you think you're learning.

The questions don't need to be answered perfectly, nor they need to be "good" questions. The questions can be general and simple, like:

- Does it have to be this way? Why?

- How is it related/connected to what I've learned previously (last chapter, last year, last decade)? Do I need to unlearn something or adjust my previous mental model?

beltsazar··on Jepsen: MySQL 8.0.34
> Serializable by default doesn't seem feasible when you really dive into the concept.

I was expecting you'd argue for a weaker isolation level than serializable, but then you said:

> Without any knowledge of the transaction type(s) and their semantics per the business domain, it would be impossible to make assumptions about logical ordering of anything.

Serializable isolation level only guarantees some total order of transactions, and yes, it doesn't guarantee that the order will be exactly what you want (e.g. first come, first serve). So, are you now suggesting strict serializability [1], then?

[1] https://jepsen.io/consistency/models/strict-serializable

beltsazar··on Jepsen: MySQL 8.0.34
The performance hit is likely worth it—considering that the alternative is inconsistent data. In most cases correctness is more, if not much more, important than performance. As I said, those who know what they're doing can always use a weaker isolation in cases where performance is more important than correctness.
beltsazar··on Jepsen: MySQL 8.0.34
Exactly! That's why I just commented [1] that the default isolation level should be serializable.

[1] https://news.ycombinator.com/item?id=38696421

beltsazar··on Jepsen: MySQL 8.0.34
I understand why the default transaction isolation level of most DBMS is weaker than serializable (it's for benchmark purposes), but I'd argue the best default is serializable. Most DBMS users don't even know there are many consistency models [1]. They expect transactions to "just work," i.e. to appear to have occurred in some total order, which is the definition of serializability [2]. And to some who know when to use a weaker isolation level for better performance can always set it per transaction [3].

---

[1] https://jepsen.io/consistency

[2] https://jepsen.io/consistency/models/serializable

[3] https://www.postgresql.org/docs/16/sql-set-transaction.html

beltsazar··on E3 Is Officially Dead
You have a different definition of "regret" from what most people think, then.
beltsazar··on Voyager 1 stops communicating with Earth
> Voyager 1 is so far away that it takes 22.5 hours for commands sent from Earth to reach the spacecraft. Additionally, the team must wait 45 hours to receive a response.

It's like when you write a program and you have to wait for almost two days to compile the code, run the program, and see its output. Meanwhile programmers these days complain when the build time is more than a few minutes.

beltsazar··on E3 Is Officially Dead
Are you suggesting that we should never regret anything, then?

Like I said, everything must be in moderation. Regrets are effective for reminding us not to repeat the same mistakes. But of course if we regret our mistakes 24/7, it will only depress us and discourage us to do anything.

beltsazar··on E3 Is Officially Dead
> Don't regret time spent doing something you enjoy.

This common saying is harmful and borderline hedonistic. Not all enjoyable activities are good activities. Should ex-smokers not regret their past smoking habit, then?

Everything must be in moderation. Playing video games, watching movies, and binging TV shows are great for unwinding after work. But if you do them too much, they can disrupt your life.

beltsazar··on The pro-Israel information war
It depends on "Israeli what".

Anti Israeli government: It's not antisemitic.

Anti Israeli people: It's antisemitic.

beltsazar··on World of Goo 2
The only effective "fix" is by using Denuvo. Are you hoping that World of Goo2 has Denuvo?
beltsazar··on For processing strings, streams in C++ can be slow
But amortized analysis has nothing to do with what CPUs can do. CS students learn it in an algorithm course, not in a computer architecture course.
beltsazar··on Playstation is erasing seasons of Discovery shows from customer libraries
Many don't realize that when you buy anything digital, you don't "own" it—what you actually buy is a license to access the content, which can be revoked at any time and for any reason. When that happens, you can't really sue them because there must be a clause in the ToS, that you've agreed on, that covers it. For most media, the only way to "own" it digitally is, unfortunately, by piracy.
← PreviousPage 2 of 7Next →