I'm sure they went away because it's a fad or the costs/benefits don't balance, not because there is no space for them. This is evident by the fact that we have scooters in abundance now!
If you look it up, the most gun crimes occur in Democrat-run gun-grabber areas that have the most gun laws. Disarming people is an unacceptable solution for many reasons. It also doesn't work. The best solution to gun crime is to arm the law-abiding.
> If you look it up, the most gun crimes occur in Democrat-run gun-grabber areas that have the most gun laws.
Highly populated areas tend to be Democrat-run. People commit crimes so places with more people = more crimes. More gun crimes cause people to push for more gun laws. Gun laws limited to cities (or even states) have limited impact when it's trivial to get guns from neighboring areas without those laws. Gun laws with limited impact can still be helpful.
It's not as if we don't know for a fact that legislation works (since it works for many many other counties) but a patchwork system of laws that only applies to some areas and not others is bound to perform worse than federal systems. Even federal systems need to be smart and actually managed and enforced correctly to work well.
> Disarming people is an unacceptable solution for many reasons.
Disarming people is an acceptable solution for many reasons. We already do it to all kinds of people in many circumstances. It's just a question of when/how much is appropriate for which circumstances.
> The best solution to gun crime is to arm the law-abiding.
Only if you're a gun/ammo manufacturer. Real world evidence has shown over and over that the best solution is laws placing legal regulations on firearms. We can point to nation after nation whose gun problems are drastically lower than ours because of the laws they enacted.
On the other hand, there exists only fantasy world evidence that giving every man woman and child a gun would solve the problem. Arguably it's already been tried in the US and the result was complete failure.
>Highly populated areas tend to be Democrat-run. People commit crimes so places with more people = more crimes. More gun crimes cause people to push for more gun laws.
Are you suggesting that there are no red cities? The only sense in which this is true is that more laws = more crimes lol.
>It's not as if we don't know for a fact that legislation works (since it works for many many other counties) but a patchwork system of laws that only applies to some areas and not others is bound to perform worse than federal systems. Even federal systems need to be smart and actually managed and enforced correctly to work well.
The federal gun laws are dumb and unconstitutional. I could be on board with disarming children, violent criminals, and nutcases. Anyone else should be able to own a gun if they want to, through a convenient process. That is to say, the current federal laws are at the limit of where I want them to be, if not beyond.
I don't care about other countries. They let themselves be disarmed, and they will ultimately suffer tyranny as a result.
>On the other hand, there exists only fantasy world evidence that giving every man woman and child a gun would solve the problem. Arguably it's already been tried in the US and the result was complete failure.
It's a fact that guns curb certain kinds of crime. The mere possibility that a thug might not survive an encounter with granny means he will think long and hard before making a move on her. The fact that normal people might lose their shit keeps politicians in line. Give up your rights, and evil will follow.
> They let themselves be disarmed, and they will ultimately suffer tyranny as a result.
There's plenty of tyranny in the USA today and guns have done nothing to stop it. There are countless videos on youtube right now of government tyranny in America, how many videos have you seen of tyranny by the State being stopped because someone pulled out a gun or opened fire?
I'm not saying that rhetorically, if you've got a bunch of youtube videos of people shooting police or politicians engaged in tyranny which successfully stopped that tyranny from taking place please respond with links. I'd be genuinely interested in seeing them.
> The mere possibility that a thug might not survive an encounter with granny means he will think long and hard
This is demonstrably false. Everywhere in the US there is a possibility that grannies can have a gun, but nowhere, even the places where there is concealed carry and a large number of gun owners, has crime been stopped as a result. Muggings still happen. Beatings still happen. Rapes still happen. Thugs don't "think long and hard" period. Guns don't make a difference. Gang members in particular aren't scared of guns. They have guns too. They've been shot, or been shot at, many times. They've watched their friends be killed by gunfire. None of that stops them.
> The fact that normal people might lose their shit keeps politicians in line.
Where do you live where your politicians are kept in line at all, or by anything except maybe fear of not being reelected? Again, there are countless examples of politicians out of line all over this country. The number of guns/gun owners has zero impact on government corruption. It's everywhere.
> Give up your rights, and evil will follow.
I, like most Americans, don't want to abolish the 2nd amendment, but like with all of our rights, there are reasonable restrictions and limits that can be placed on it which would still allow people to defend their homes and hunt and shoot while still bringing gun deaths closer to what we see in other counties.
>There's plenty of tyranny in the USA today and guns have done nothing to stop it.
Guns stop crime which is a form of tyranny. As for government tyranny, you are not going to be able to fight a heavily armed tyrant without guns. We didn't win independence from the British via debate. Guns are a factor in reigning in deranged politicians. That is why they want to disarm everyone.
>This is demonstrably false. Everywhere in the US there is a possibility that grannies can have a gun, but nowhere, even the places where there is concealed carry and a large number of gun owners, has crime been stopped as a result.
Crime has been reduced by gun ownership.
>Thugs don't "think long and hard" period. Guns don't make a difference. Gang members in particular aren't scared of guns. They have guns too. They've been shot, or been shot at, many times. They've watched their friends be killed by gunfire. None of that stops them.
They do fear guns. They have guns because they are effective for self-defense, even for criminals. Hard-boiled criminals fear guns. Even if you find some that are so calloused and/or stupid that they don't fear guns, the guns will protect you from those criminals anyway. The gun does not care what its target thinks of it.
>Where do you live where your politicians are kept in line at all, or by anything except maybe fear of not being reelected?
Like I said, it is a factor. The people who want to take our guns are heavily guarded by men with guns. Take the hint.
>I, like most Americans, don't want to abolish the 2nd amendment, but like with all of our rights, there are reasonable restrictions and limits that can be placed on it which would still allow people to defend their homes and hunt and shoot while still bringing gun deaths closer to what we see in other counties.
We already have background checks on every legal gun purchase and extra unconstitutional laws restricting many types of firearms. There is a de-facto and illegal national gun registry.
For all the benefits we get from government, it remains the biggest domestic menace to all of us and we must take steps to not allow ourselves to be defenseless against the state. How do you think genocides happen? The second amendment is not for hunting, or for warding off low-level thugs, though it might be useful for those purposes. It is there to give normal people a real chance to reign in evil in government. A standing professional army would not win against a well-armed majority standing up for their own rights. Even if they did win, it would be a Pyrrhic victory.
I haven't read that but "gun death rate" is not the same as "gun crime rate"... Of course I expect guns to be used more in areas where they are available. Many legitimate self-defense cases are imperfect as well, and technically count as crime for BS reasons. Gun suicide rates probably would be higher with more guns owned by the public.
In summary, I don't think you are right and I would still support broad gun ownership rights even if you were correct about per capita. I am more worried about the public not having guns than having guns.
OK. There isn't any arguing with anyone who doesn't have a problem with the idea that someone else's right not to be murdered is less important than their unlimited gun ownership rights, which is the only conclusion I can draw from what you are saying. So I will leave you to the hell of your own making, I guess.
Guns prevent murder. There's not much you can do besides using a gun to defend yourself against physically superior individuals or groups of people. Banning guns does not prevent murder, it just changes the methods. If you are worried about being murdered, you should probably get a gun lol.
Well, gang members go out looking for trouble, for one thing. For another, they would just as well use knives, bats, chains, hatchets, or any other terrible implement to commit crime. Banning guns just makes it difficult or impossible for non-gang members to defend themselves.
The point of drinking is to get a buzz. Most alcoholic drinks taste bad anyway, and would not be consumed if not for that. The only people who would need a pill to stop after one drink are hardcore alcoholics. This guy is either really stupid, marketing for some upcoming product, or propagandizing against alcohol because they found it is actually good for you after all lol.
Don't speak for people. I don't like getting a buzz - I don't like anything at all that alters my mood chemically. I really dislike it as an idea, deeply. But I love one cocktail or one drink of Scotch or one beer, sipped casually - for the taste.
I like the flavor of most cocktails, but it really isn't the alcohol that makes it taste good. There is a subtle medicinal flavor imparted by most forms of liquor but I never found myself craving that lol.
Congrats. I've gotta say that I think you are just in the habit of drinking beer for whatever reason. You could just as easily drink something that tastes better, like sparkling water. But whatever helps you beat the habit is good I guess.
It’s funny how personal it is. I really hate the taste of alcohol and don’t even tend to like food cooked with alcohol (even if it has “cooked off” it clearly leaves a taste behind).
I tried drinking for a short while but I had to almost hold my nose and swallow it as if it were medicine.
I do like the taste of the high-end stuff as well. But the point is precisely to get a buzz while not suffering the bad sides of the cheap stuff.
Otherwise there are plenty of very good drinks that have no alcohol, if you want to drink for taste, there is really no need to go for alcoholic stuff.
There is a lot of snobery around the expensive stuff precisely because you need to be wealthy enough to afford it. It is just another class signifier.
People drinking those things like the fact that they can get buzzed while still enjoying the taste, outside of true alcoholics, everybody prefer that but they just can't afford it.
Making good alcohol is an art form. It is a very complex process that relies on quality inputs as well as mastery of a refined recipe. It is no a trivial endeavor and this why many of the good alcohols were produced/invented by monks and priest, they were the ones with enough time and ressources on their hands to focus on this unproductive pursuit.
Nowadays the lines are blurred because it is commercialised and profitable but the consumers of the good stuff are very similar to the priests of old (high status/power), they just delegated the process thanks to their power afforded by money.
So what? I have an opinion, backed up by years of being in bars and talking to people who actually like to drink. If you need a disclaimer in a comment, maybe you need to go have a drink to take the edge off.
>I think drinking for the buzz demonstrates an immaturity with alcohol consumption. One many have, but an immaturity nonetheless.
People of all ages enjoy the effects of alcohol. I don't think many would consume it if not for those effects. The people you are calling immature, would call you a goober.
The tone of the GP and your comment, and wanting to drink for the buzz, are all arguably a little immature. But regardless: Maturity has nothing to do with age.
Regarding opinions: You're not defending the GP when you say "many". The GP implied "all" (or close to it). The GP was in fact overstepping the statement of opinion, whereas you are not.
Once a week I hit the local pub for exactly one pint. Usually preferring lower ABV. Why do I stop there? Anymore than that gives a buzz that I usually am not in the mood for. I’m sure one drink has some effect on me, but not enough to consciously realize it.
> Most alcoholic drinks taste bad anyway
Speak for yourself. Beer is hands down one of the tastiest damn drinks. I seriously love German and British styles for their flavor and low ABV. They make great casual drinks.
You don’t like alcohol. That’s fine. And, honestly, you’re likely healthier for it. But claiming that people drink just to get drunk - I stopped doing that in college.
I think you're crazy, but I guess there are people who drink piss so why should I be surprised that someone likes the taste of beer?
Seriously, many people who like alcohol have told me exactly what I just said. There are tastier drinks out there if you're after flavor. Alcohol is for getting a buzz, or fitting in with people who like the buzz.
I feel the same way about black coffee. Who would drink that if not for the caffeine? Better drinks are abundant.
While I certainly drink coffee for the caffeine, black coffee is 100% my preference. Sugar in coffee tastes absolutely horrid to me. Milk is fine but it doesn’t do much for me.
People taste things differently and it’s at least partly genetic. See TAS2R38 for example [0]. It’s fascinating how we all perceive the world a little differently.
Years ago, long before I was of age, a science museum had a little demo on this (not sure if it was related to the aforementioned gene or not) using strips of paper with some chemical on it. Some people were pretty grossed out by the flavor. It didn’t bother other people at all, including myself.
On the flip side of things I’m highly sensitive to sweetness and find anything other than the smallest amounts to be off putting.
DEI is practically in the communist playbook too. So, they basically get support from the super rich and also pro-communist forces. Of course, many pro-communist idealogues are super rich people who have nothing in common with workers. They dream of running things based on prior status, and never having to yield to popular opinion. At least under capitalism, you can work your way up from nothing, and you can keep the fruits of your labor.
The problem is that the definition of "things that are inappropriate for kids" brought up by book-banners is almost always heavily inspired by religion. A book containing graphical violence and sex, like the Bible? Totally okay! A book containing casual day-to-day life, like mentioning in passing that little Johnny next door has two dads? Somehow completely inappropriate.
They never said that. They just pointed out the hypocrisy of the situation, where certain topics normally deemed extremely controversial by those very figures become totally fine if they're brought up along the lines of their ideology. The comment contains no judgements on what should be included or excluded from their point of view.
I've got to interject. Clearly religious texts are of a different nature than gay kids books and teen romance novels. There may be some milquetoast books targetted by the religious but many of them are legitimately in the category of erotica. I've never seen a religious scripture that fell into the category of erotica, besides perhaps the Kama Sutra lol.
>The comment contains no judgements on what should be included or excluded from their point of view.
Let's be real. The types of people who bother to bring up the supposed hypocrisy of it are very much in favor of keeping the erotica, and may very well be in favor of pushing out religious texts because of "the science" or some shit. I know some people have said that they had trouble finding a bible in their library on YouTube. Somehow I doubt it was merely a case of them all being checked out either. If you ever catch a video of the people at the top of the American Library Association talking about these "book ban" issues it will all start to make sense.
> There may be some milquetoast books targeted by the religious but many of them are legitimately in the category of erotica
How much erotica are you seeing in the list linked above? Maybe a few could be kind of misconstrued for it, if someone was interpreting them with active hostility, but the far more obvious theme that ties them together is dealing with "heavy" themes in general - mental illness, discrimination, abuse, prostitution, suicide. Especially books that are overt in their themes and/or make the "wrong" conclusions in the eyes of the censors. You just set the rules for the argument by just filing all of that away as erotica, while most of it is anything but.
> I've never seen a religious scripture that fell into the category of erotica
That's because the hypocrisy that people argue about tends to concern things way worse than just some plain erotica. With their millennia-old standards for morality, religious texts from most religions often feature and endorse horrific acts and social standards that would without a doubt be instantly censored in schools much like the books above, if they weren't religious.
> Let's be real. The types of people who bother to bring up the supposed hypocrisy of it are very much in favor of keeping the erotica, and may very well be in favor of pushing out religious texts because of "the science" or some shit
"Being real" in this case seems to be a way of making a leading argument. I am on the side of those "types of people", and I know many more like that. The vast majority of people hold the stance of minimum book censorship, if at all possible. While I disagree with many religious books on most levels, censoring them would be equally misguided and pointless. At this point, they're important historical texts that frame a lot of how our society works. Anyone who wishes to access them should be able to do so, as should be the case with most other information.
> I know some people have said that they had trouble finding a bible in their library on YouTube
I don't know if YouTube content, especially from people who no doubt were looking for this specific conclusion, is enough to convince me that the most printed document in existence is suddenly impossible to find nowadays.
> Somehow I doubt it was merely a case of them all being checked out either
This is the crux of your argument, and you leave it up to subjective doubting? How many libraries have banned religious books as policy, rather than just having them vaguely be unavailable at some specific point in time?
Every day, hundreds if not thousands of these books are given away for free, on a range of anything from charity to forcing them down people's throats. The argument for this extreme of a level of anti-Christian persecution and censorship in the most religious country in the West isn't looking very good.
>How much erotica are you seeing in the list linked above?
I honestly don't have time to go do a bunch of research on 52 random books I'm definitely not going to read. All I can tell you for sure is that many of these books are inappropriate for children, and I'd object to any book with sex scenes being in any public school library. I have seen people give damning reviews, including quotes and photos of graphic content, from books they wanted removed from school libraries, and I was inclined to agree with them. I'm not even a Christian, but I want to pay for that even less than copies of random religious texts.
>I am on the side of those "types of people", and I know many more like that.
I am not going to give a blanket endorsement to LGBT in this way. I believe in live and let live, more or less, but I believe many of these people are more evangelical than any religion at this point. Anyway, on the subject of injecting their "representation" into everything, even content for prepubescent children, I am very opposed.
>The vast majority of people hold the stance of minimum book censorship, if at all possible.
I hope this is true, but I am not so sure these days.
>Anyone who wishes to access them should be able to do so, as should be the case with most other information.
At risk of going off on a tangent: As much as I love libraries and books, I don't believe in "information wants to be free" type rhetoric. People need to be paid for their work one way or another.
>I don't know if YouTube content, especially from people who no doubt were looking for this specific conclusion, is enough to convince me that the most printed document in existence is suddenly impossible to find nowadays.
I never said that it was hard to find in general. I said that some people reported that their libraries did not have these bog standard books.
>How many libraries have banned religious books as policy, rather than just having them vaguely be unavailable at some specific point in time?
As I said, I only heard some anecdotes. I believe this is still probably a rare occurrence but I can't prove one way or another. I mention it mainly so people can look out for it, not to prove anything.
>Every day, hundreds if not thousands of these books are given away for free, on a range of anything from charity to forcing them down people's throats.
Nobody is actually forced to own and read a bible, unless they are trying to do it to fit in with the religious folk. I consider that voluntary.
>The argument for this extreme of a level of anti-Christian persecution and censorship in the most religious country in the West isn't looking very good.
I personally witnessed some normal inoffensive Christian content censored on Facebook a couple of years ago as if it was gore. There is definitely a sizeable group of people which openly detests Christians and hopes to see the religion die, even though most Christians are very nice people and the religion is very important for Western values. Meanwhile, we have Islamic apologists hoping to excuse terrorism and continue importing millions of highly fertile, culturally incompatible invaders. The same people talking shit about Christian views on abortion will stick up for Muslims who hate all of us and want to take over, and LGBT, which the Muslims especially hate. Sometimes the absurdity of it all makes me suspect we live in a simulation.
>In those languages, correct logic and getting the program to compile doesn't guarantee you are free from data races or segmentation faults.
I don't believe that it's guaranteed in Rust either, despite much marketing to the contrary. It just doesn't sound appealing to say "somewhat reduces many common problems" lol
>Also, Rust's type system being so strong, it allows you to encode so many invariants that it makes implementing the correct logic easier (although not simpler).
C++ has a strong type system too, probably fancier than Rust's or at least similar. Most people do not want to write complex type system constraints. I'm guessing that at most 25% of C++ codebases at most use complex templates with recursive templates, traits, concepts, `requires`, etc.
Comparing type systems is difficult, but the general experience is that it is significantly easier to encode logic invariants in Rust than in C++.
Some of the things you can do, often with a wild amount of boilerplate (tagged unions, niches, etc.), and some of the things are fundamentally impossible (movable non-null owning references).
C++ templates are more powerful than Rust generics, but the available tools in Rust are more sophisticated.
Note that while C++ templates are more powerful than Rust generics at being able to express different patterns of code, Rust generics are better at producing useful error messages. To me, personally, good error messages are the most fundamental part of a compiler frontend.
True but you lose out on much of the functionality of templates, right? Also you only get errors when instantiating concretely, rather than getting errors within the template definition.
No, concepts interoperate with templates. I guess if you consider duck typing to be a feature, then using concepts can put constraints on that, but that is literally the purpose of them and nobody makes you use them.
If you aren't instantiating a template, then it isn't used, so who cares if it has theoretical errors to be figured out later? This behavior is in fact used to decide between alternative template specializations for the same template. Concepts do it better in some ways.
> If you aren't instantiating a template, then it isn't used, so who cares if it has theoretical errors to be figured out later?
Just because you aren't instantiating a template a particular way doesn't necessarily mean no one is instantiating a template a particular way.
A big concern here would be accidentally depending on something that isn't declared in the concept, which can result in a downstream consumer who otherwise satisfies the concept being unable to use the template. You also don't get nicer error messages in these cases since as far as concepts are concerned nothing is wrong.
It's a tradeoff, as usual. You get more flexibility but get fewer guarantees in return.
Of course what you are describing is possible, but those scenarios seem contrived to me. If you have reasonable designs I think they are unlikely to come up.
>Just because you aren't instantiating a template a particular way doesn't necessarily mean no one is instantiating a template a particular way.
What I meant is, if the thing is not instantiated then it is not used. Whoever does come up with a unique instantiation could find new bugs, but I don't see a way to avoid that. Likewise someone could just superficially meet the concept requirements to make it compile, and not actually implement the things they ought to. But that's not a problem with the language.
> Of course what you are describing is possible, but those scenarios seem contrived to me. If you have reasonable designs I think they are unlikely to come up.
I suppose it depends on how much faith you place in the foresight of whoever is writing the template as well as their vigilance :P
As a fun (?) bit of trivia that is only tangentially related: one benefit of definition-site checking is that it can allow templates to be separately compiled. IIRC Swift takes advantage of this (polymorphic generics by default with optional monomorphization) and the Rust devs are also looking into it (albeit the other way around).
> Whoever does come up with a unique instantiation could find new bugs, but I don't see a way to avoid that.
I believe you can't avoid it in C++ without pretty significant backwards compatibility questions/issues. It's part of the reason that feature was dropped from the original concepts design.
> Likewise someone could just superficially meet the concept requirements to make it compile, and not actually implement the things they ought to.
Not always, I think? For example, if you accidentally assume the presence of a copy constructor/assignment operator and someone else later tries to use your template with a non-copyable type it may not be realistic for the user to change their type to make it work with your template.
>I suppose it depends on how much faith you place in the foresight of whoever is writing the template as well as their vigilance :P
The actual effects depend on a lot of things. I'm just saying, it seems contrived to me, and the most likely outcome of this type of broken template is failed compilation.
>As a fun (?) bit of trivia that is only tangentially related: one benefit of definition-site checking is that it can allow templates to be separately compiled.
This is incompatible with how C++ templates work. There are methods to separately compile much of a template. If concepts could be made into concrete classes and used without direct inheritance, it might work. But this would require runtime concepts checking I think. I've never tried to dynamic_cast to a concepts type, but that would essentially be required to do it well. In practice, you can still do this without concepts by making mixins and concrete classes. It kinda sucks to have to use more inheritance sometimes, but I think one can easily design a program to avoid these problems.
>I believe you can't avoid it in C++ without pretty significant backwards compatibility questions/issues. It's part of the reason that feature was dropped from the original concepts design.
This sounds wrong to me. Template parameters plus template code actually turns into real code. Until you actually pass in some concrete parameters to instantiate, you can't test anything. That's what I mean by saying it's "unavoidable". No language I can dream of that has generics could do any different.
>Not always, I think? For example, if you accidentally assume the presence of a copy constructor/assignment operator and someone else later tries to use your template with a non-copyable type it may not be realistic for the user to change their type to make it work with your template.
I wasn't prescribing a fix. I was describing a new type of error that can't be detected automatically (and which it would not be reasonable for a language to try to detect). If the template requires `foo()` and you just create an empty function that does not satisfy the semantic intent of the thing, you will make something compile but may not actually make it work.
Sure. Contrivance is in the eye of the beholder for this kind of thing, I think.
> and the most likely outcome of this type of broken template is failed compilation.
I don't think that was ever in question? It's "just" a matter of when/where said failure occurs.
> This is incompatible with how C++ templates work.
Right, hence "tangentially related". I didn't mean to imply that the aside is applicable to C++ templates, even if it could hypothetically be. Just thought it was a neat capability.
> This sounds wrong to me.
Wrong how? Definition checking was undeniably part of the original C++0x concepts proposal [0]. As for some reasons for its later removal, from Stroustrup [1]:
> [W]e very deliberately decided not to include [template definition checking using concepts] in the initial concept design:
> [Snip of other points weighing against adding definition checking]
> By checking definitions, we would complicate transition from older, unconstrained code
to concept-based templates.
> [Snip of one more point]
> The last two points are crucial:
> A typical template calls other templates in its implementation. Unless a template using concepts can call a template from a library that does not, a library with the concepts cannot use an older library before that library has been modernized. That’s a serious problem, especially when the two libraries are developed, maintained, and used by more than one organization. Gradual adoption of concepts is essential in many code bases.
And Andrew Sutton [2]:
> The design for C++20 is the full design. Part of that design was to ensure that definition checking could be added later, which we did. There was never a guarantee that definition checking would be added later.
> To do that, you would need to bring a paper to EWG and convince that group that it's the right thing to do, despite all the ways it's going to break existing code, hurt migration to constrained templates, and make generic programming even more difficult.
I probably could have used a more precise term than "backwards compatibility", to be fair.
> Until you actually pass in some concrete parameters to instantiate, you can't test anything. That's what I mean by saying it's "unavoidable".
I'm a bit worried I'm misunderstanding you here? It's true that C++ as it is now requires you to instantiate templates to test anything, but what I was trying to say is that changing the language to avoid that requirement runs into migration/backwards compatibility concerns.
> No language I can dream of that has generics could do any different.
I've mentioned Swift and Rust already as languages with generics and definition-site checking. C# is another example, I believe. Do those not count?
> I wasn't prescribing a fix. I was describing a new type of error that can't be detected automatically (and which it would not be reasonable for a language to try to detect). If the template requires `foo()` and you just create an empty function that does not satisfy the semantic intent of the thing, you will make something compile but may not actually make it work.
My apologies for the misdirected focus.
In any case, that type of error might be "new" in the context of the conversation so far, but it's not "new" in the PL sense since that's basically Rice's theorem in a nutshell. No real way around it beyond lifting semantics into syntax, which of course comes with its own tradeoffs.
That is all very good information. I don't often get into the standards and discussions about the stuff. Maybe ChatGPT or something can help me find interesting topics like this one but it hasn't come up so much for me yet.
>I'm a bit worried I'm misunderstanding you here? It's true that C++ as it is now requires you to instantiate templates to test anything, but what I was trying to say is that changing the language to avoid that requirement runs into migration/backwards compatibility concerns.
I see now. I could imagine a world where templates are compiled separately and there is essentially duck typing built into the runtime. For example, if the template parameter type is a concept, your type could be automatically hooked up as if it was just a normal class and you inherited from it. If we had reflection, I think this could also be worked out at compile time somehow. But I'm not very up to speed with what has been tried in this space. I'm guessing that concept definitions can be very extensive and also depend on complex expressions. That sounds hairy compared to what could be done without concepts, for example with an abstract class.
> I could imagine a world where templates are compiled separately and there is essentially duck typing built into the runtime.
The bit of my comment you quoted was just talking about definition checking. Separate compilation of templates is a distinct concern and would be an entirely new can of worms. I'm not sure if separate compilation of templates as they currently are is possible at all; at least off the top of my head there would need to be some kind of tradeoff/restriction added (opting into runtime polymorphism, restricting the types that can be used for instantiation, etc.).
I think both definition checking and separate compilation would be interesting to explore, but I suspect backwards compat and/or migration difficulties would make it hard, if not impossible, to add either feature to standard C++.
> For example, if the template parameter type is a concept, your type could be automatically hooked up as if it was just a normal class and you inherited from it.
Sounds a bit like `dyn Trait` from Rust or one of the myriad type erasure polymorphism libraries in C++ (Folly.Poly [0], Proxy [1], etc.). Not saying those are precisely on point, though; just thought some of the ideas were similar.
> but you lose out on much of the functionality of templates, right?
I don't think so? From my understanding what you can do with concepts isn't much different from what you can do with SFINAE. It (primarily?) just allows for friendlier diagnostics further up in the call chain.
You're right but concepts do more than SFINAE, and with much less code. Concept matching is also interesting. There is a notion of the most specific concept that matches a given instantiation. The most specific concept wins, of course.
I don't agree that Rust tools are more sophisticated and they definitely are not more abundant. You just have a language that is more anal up front. C++ has many different compilers, analyzers, debuggers, linting tools, leak detectors, profilers, etc. It turns out that 40 years of use leads to significant development that is hard to rebuild from scratch.
I seem to have struck a nerve with my post, which got 4 downvotes so far. Just for saying Rust is not actually better than C++ in this one regard lol.
>They certainly know that you dont want to process garbage data from freed memory.
It depends on what you mean by "freed". Can one write a custom allocator in Rust? How does one handle reading from special addresses that represent hardware? In both of these scenarios, one might read from or write to memory that is not obviously allocated.
Both of those things can be done in Rust, but not in safe Rust, you have to use unsafe APIs that don't check lifetimes at compile time. Safe Rust assumes a clear distinction between memory allocations that are still live and those that have been deallocated, and that you never want to access the latter, which of course is true for most applications.
You can indeed write custom allocators, and you can read to or write from special addresses. The former will usually, and the latter will always, require some use of `unsafe` in order to declare to the compiler: "I have verified that the rules of ownership and borrowing are respected in this block of code".
reply