HNHacker News
TopNewBestAskShowJobs

1ris

2,242 karma · joined February 24, 2014

submissionscomments
1ris··on Qsort.h – Quicksort as a C macro (2019)
>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.

1ris··on C was not created as an abstract machine
No, The strict aliasing part of the semantic of the memory. “syntax sugar” is, per definition, part of the syntax.
1ris··on C was not created as an abstract machine
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".
1ris··on Rust vs. C++ Formatting
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.
1ris··on Rust vs. C++ Formatting
>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?

1ris··on Rust vs. C++ Formatting
Do you mean this feature [0]? I'm not aware of any differences in c and c++ about this. Can you get a type of a argument in C? How? At compile time, or at runtime? Both sound very un-C-like to me. cppreference is usually excellent documentation but it doesn't mention something like this.

I don't considers this to be "proper" variadic arguments, because a functions argument has to have a type. and these, as far as I'm aware of don't have one. This is about a powerfull as passing a void**. This is essentially memcopying multiple differently typed into a char* buffer and then passing that buffer. You can than correctly copies them back you have pretty much the same behaviour. Both methodss obviously lacks important aspects of the language abstraction of a function parameter and i don't what that feature can bring to the table that the previous techniques don't.

[0] https://en.cppreference.com/w/cpp/utility/variadic

1ris··on Rust vs. C++ Formatting
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.
1ris··on Rust vs. C++ Formatting
printf is a bad joke of a formatting function.

When i want to print a string i don't want to worry about the security implications of that. With printf i have to. [0]

And i certainly don't want a turing complete contraption. [1] Also looking at log4j.

And even if everything is correct, it's has to parse a string at runtime. I consider that alone unaesthetic.

>Edit: It's almost like the whole world got a lot of work done with the tools they already had.

The best metaphor i know for this attitude is "stacking chairs to reach to moon". If you don't care about the limits of the tech you will be stuck within it.

I'm time and time again amused how anti intellectual and outright hostile to technological progress the programming profession is. programmers, out of all of them.

[0] https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=printf

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

1ris··on Heat pumps of the 1800s are becoming the technology of the future
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.

1ris··on Na-S Battery: Low-cost with four times the capacity of lithium
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.

1ris··on Rust in the 6.2 kernel
>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.

1ris··on Rust in the 6.2 kernel
Yes, precisely my point: Even the best are not nearly good enough. Because "the competent enough C programmer" is a myth.
1ris··on Rust in the 6.2 kernel
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.
1ris··on Rust in the 6.2 kernel
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.
1ris··on Rust in the 6.2 kernel
The non-cynical answer is: Yes, we will be doing so much more.

https://blog.ploeh.dk/2019/07/01/yes-silver-bullet/

1ris··on Rust in the 6.2 kernel
"Training" and "being the (allergy) the most skilled" have no connection to you? You can't be serious.

This is mincing words and a bad-faith argument. I consider this discussion pointless and will not continue.

1ris··on Rust in the 6.2 kernel
Kernel hackers are considered the most skilled people in the whole profession. The Linux kernel is one of the most read source code on the planet. The code is audited to death. Much of the research into static code analysis starts there. They have tools available most other people don't. That's what i mean.

If, what ever the happens there, is not up to your standard of professionalism, maybe your standard is unrealistic?

1ris··on Rust in the 6.2 kernel
To reuse your metaphor:

If professional chefs would constantly maim themself and each other despite extensive occupancy safety training, knives have no place in the hands of a responsible professional.

Using C is the SE equivalent of taping down one button of the two-hand control device of a die cutter.

1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
"I/My kid/My dog could have done that" is something that is said to artists since the dawn of time.

It's a universal sentiment. I'm not saying it's true. I'm saying it is said.

1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
What about this is counterproductive? People get angry, emotional involved. After a few minutes they realize that the glass in front of the painting is not that expensive and all is well. Or is it? That's when they have time to think about destruction and maybe what these people just said about climate change.

What picture exactly is of course not important. Any popular picture with a glass plate in front of it could have done the job. I don't they have any ax to grind about Vermeer, nor will the controversy have any connections to him or his art.

1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
It's like telling people you are burning a puppy with napalm "for demonstrating the effect" at an anti-viet-nam-war-protests. First people get crazy angry at you, then they change their attitude about napalm.
1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
The most solvable to these people, anyway.
1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
It's funny that you can say that about pretty much all art.
1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
This was the case for 70 years and thus far all the mad man where all to wise not to press it, because at the end of the day they know how it will end.

We didn't stop all human activity or activism for the last 70 years and neither should we have done so.

This is the biggest Whataboutism if have ever heart of.

1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
Genuine question: What would you expect a rational actor to do FOR the cause? Because to me this looks very rational and very much for the cause.
1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
Yes, peta are profoundly unlikeable people, back then and now. I don't like them, I think their holocaust comparisons are unforgivable and neither am i vegan. My point is that they are living rent free in peoples heads and do actually change attitudes. Because there was a huge change and i just don't see who else could have caused that.

My point was: Effective activism does not have to be likeable. Going for the opposite seems a viable strategy.

1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
Of course everybody thinks PETA as lunatics, maybe rightfully. But it was them made veganism a thing. It's mainstream now. I guess about between 2% and 5% of the population and growing. Burger king and McDonalds sell vegan options. That's absurdly successful. When they started it was literally about 5 people.

I don't think most vegans will quote them for their change, but their activism that gave animal welfare attention in a attention economy, when it would otherwise simply not have gotten any.

1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
I have yet so see any argument why this should be ineffective or even highly so. Or why this should be any less effective than anything else that has been tried.

With regards to your article: I think the authors answers his own questions: These are serious scientists. They told everybody in the whole world that we are all going to die (I'm paraphrasing, but you get it) in the most adult and sophisticated way possible: Highly prestigious peer reviewed journals, conferences and so on for several decades. Nobody listed. THAT was highly ineffective. Now it seems like time for a change in strategy.

And given how very well it worked for the yellow vests and their infantile demands it looks like a good strategy.

1ris··on Activist glues his head to glass covering 'Girl with a Pearl Earring' painting
That's what people said about PETA and whatever outrageous stuff they did.

Time has disproven these people. I don't see how this is any different.

1ris··on Gas Leak in the Baltic Sea
Might actually happen in Bulgaria. And yet, for the most part, people are overreacting. I for one have lived in a temporary unheated german apartment with horrible insulation (build around 1955, not upgraded). It sounds way worse than it is. The only actually unpleasant thing is washing your hair. Just keep an eye on the humidity.

I won't heat my (different) apartment this winter. It will be ok.

Page 1 of 20Next →