Recent submissions

Comment · 3 years ago
>C has been adding generics anyway, like _Generic.

"_Generic" added function overloads to c, not generics. The naming is exceptionally poor.

The submission is an example of generic programming. It an implementatin of something that works on all types that fullfill certain constrains. In this case comparable and swapable. "All types" include user defined types.

"_Generic" does something completely different. The C++ equvivalent would be std::conditional_v<std::is_same<T, int>, myIntFunc, std::conditional<std::is_same<T, double>, myDoubleFunc ............ The exact opposite of a generic, I'd argue, as myIntFunc and myDoubleFunc do depend on the type. You might use the preprocessor to create these functions that differ only in type, but then again, you might do what OP did.

Comment · 3 years ago
No, The strict aliasing part of the semantic of the memory. “syntax sugar” is, per definition, part of the syntax.
Comment · 3 years ago
for a definiton of "just memory" that includes the strict aliasing rule. Certainly not a buffer of bytes, what most people would assume when they hear "just memory".
Comment · 3 years ago
Sorry my bad. Yes, it works for proper function arguments. Does this work for variadic arguments? Parent seems to suggest, but i'm not aware of any mechanism for this.
Comment · 3 years ago
>Did you propose/implement/release something better than printf?

This is what the article is about? Things much better that printf are a dime a dozed and available since 20 years.

>Some people talk about getting work done,

Like this article does? While you busy arguing that you could do the same thing, but much worse?

Comment · 3 years ago
Comment · 3 years ago
And outstreams where not that bad, aswell. Sure, the operator overloading looks a bit rough. But that's IMHO a pragmatic choice if you want to offer customisation points and didn't have variadic functions yet. They where introduced only in c++11.
Comment · 3 years ago
Comment · 3 years ago
I think you are looking for (one specific implementation of) Cold district heating.

It can be implemented as a single line of force water flow with 20-25 Celsius. It is viable as both a heat source and a heat sink at the same time.

This thing can be connected to both your coolers and heaters, and thus transfere heat from one to another. Maybe you could even get you desktop computer into the loop.

Usually it implemented on a lager scale, but i don't see why this would work scaled down.

Comment · 3 years ago
Both can be bad, and both are bad.

But it looks like a lot of people assume they are just as bad without any quantitate or qualitative assessment.

Lithium mining is way less bad than oil extraction in both dimensions. If that lithium can offset oil consumption it looks particular good.

Comment · 4 years ago
>It does not misrepresent what you said, and failure to see that means you did not actually understand it

Oh yes, I do. I do know what i mean and I can see that your quote of it was either extremely unintelligent, something you can by definition not see, or intentionally miss representing and therefore bad faith and therefore something you by definition lie about.

I'm heavily leaning to bad faith, because you never make any attempts to refute arguments anywhere in the whole thread.

So, of course, I'm obviously correct on on this one, so it's good thing either of us wasted any time talking on the substance.

Comment · 4 years ago
Yes, precisely my point: Even the best are not nearly good enough. Because "the competent enough C programmer" is a myth.
Comment · 4 years ago
Seatbelts have issues. Some of them undiscovered yet. What suggests that Seatbelts won't introduce issues that will be larger than the 70% of issues that it solves with crashes? Because to me, it just sounds like we can't know so we're being hopeful that we don't run into that situation.
Comment · 4 years ago
I understand your argument. It works with starting from a massive misrepresentation of what I have said (aka bad faith). Your argument is fatally flawed due to the reason i stated. And that's why there is nothing to be said to the substance, other than what was written and this discussion was and remains over.
Comment · 4 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton