Recently I have started to learn C++. It feels nicer than C at first, while remaining in more C like. But moving to more C++ feature doesn't feel good. I heard many others use C++ just for some extra feature on top of C and leave many features out, like not writing classes. I like that way too.
The real defensible reason is that with current tools available you can write perfectly safe (safer than Rust even) C++ code, while avoiding the horrid Rust compile times and without needing to pepper your code with unsafe all over the place. LLM's can help you formally verify your code and extensively fuzz/test it to the point where you can actually be sure (ie prove) that the code is safe, without really relying on Rusts compiler. Lastly, C++ lends itself more naturally to hardcore optimizations than Rust. But ultimately it really, _really_ comes down to a) Rust's horrid compile times and b) Rust's horrid metaprogramming support (this even kills it for LLM generated output because it wastes tokens).
I fully expect formally verified C to become the standard for any reasonably critical software. It's astonishing how easy it is to crank out program equivalence proofs these days...
well you can just have much stronger safety guarantees in a theorem prover than in the rust type system, and C is a much easier thing to embed in a theorem prover than rust.
Rust isn't C. There are plenty of theorem provers that are proc macros. C doesn't have proc macros so that's why you wrap it instead, but there's no need to wrap Rust like that.
Corporate environment over here, the reason is easy, that is what many SDKs support out of the box without extra tooling, added complexity building the missing pieces ourselves or relying in whatever community project, and finally the human part of actually wanting to use something else.
It's a region of space from where not even light can scape.
You can get a region like that by squashing a lot of mass in a small space, like happens when a star collapses under its own gravity. So here the intuition of "high density" makes sense.
But at the center of galaxies you have the so called "supermassive black holes" which are more or less comparable in size to the solar system and yes, they have a lot of mass but they are not very dense, a pop-sci trope is comparing it's density to cotton candy or even the air we're breathing right now.
So it's a matter of how you distribute mass/energy in a given diameter, not exactly of density.
Normally people think of gravity as pulling on objects. You can instead think of it as pulling on the space those objects are in.
A black hole happens when there is enough gravity that space gets pulled inwards somewhere, at at least the speed of light.
Gravity falls off with distance, and the distance where space is being pulled inwards at exactly the speed of light is called the "event horizon".
It has this name because speed of light is the speed of causality: events that happen further in, are "over the horizon" for you, they cannot causally influence you.
> Normally people think of gravity as pulling on objects. You can instead think of it as pulling on the space those objects are in.
(Very uneducated person here) I’ve always wondered if large objects caused gravity, or if maybe large objects form in the places where there is a lot of gravity. This is probably elementary, but I’ve never looked in to it. Maybe today is the day!
Scientists have directly measured the gravity coming from big balls of lead. The gravity didn't make the scientist put the lead there, and the gravity wasn't there before the lead. The lead must have made the gravity.
If you want to take a very large-scale - if poetic - view of things, you could also (very arguably) say something like "Mass is Fate".
Mass represents a zone where probabilities want to be. The more that aggregate, the more they make other things want to glom on. With a high enough density, nothing that's nearby can glom to literally anywhere else, and there's your black hole. The Great Inevitable. In this space, there are no other possibilities. Very Demiurge-y.
Both / they're related. More mass gravitates more.
Suppose you had an infinite universe that was filled with a cool gas of low uniform density. Then the gravitational field at any particular point would be 0, by Gauss' law.
But, if you wait a brief moment the gas will not stay uniform, because each atom of the gas will have some velocity. You'll observe fluctuations: places with small over-density and small under-density (compared to the average). The places with over-density will gravitate more than the average and places with under-density will gravitate less, and gravity will cause the gas to clump.
Wait a few billion years and some places will have amalgamated whole galaxies' worth of matter around them and other places will be empty.
I tend to believe that dark matter is a name for something we don't understand better yet. I don't necessarily mean MOND or anything specifically, but dark matter is just a little too mysterious and convenient for my taste. Maybe in 100y we will laugh about the notion of something like an aether named dark matter, and see it as simply a model which was necessary, because we didn't get what really is going on.
I mean, it's kind of both: objects have gravity, which attract them together, which creates more gravity and larger objects. Stars are what happens when the rest of physics disagrees with this (and black holes are when gravity wins anyway).
The problem there is that not even the physicists completely agree on the details, because we know black holes definitely exist, but every explanation breaks one rule or another that should apply from different disciplines. It's part of why they get so much ongoing attention.
Black holes are essentially where our knowledge of spacetime breaks, and we can’t even see into it. It’s hard to really concretely know much about it directly.
Why not just say it's something with such strong gravity you can't escape even if you go at the speed of light? Maybe that loses too much accuracy for you?
"A really interesting and cool thing for astronomers to talk about...but you might want to pray that not one of 'em ever comes within a million trillion miles of the Earth."
Unfortunately, there is a rather large one not one sixth of that distance away (a million trillion miles is actually rather large - 170 kly - approximately double the size of our galaxy)
Yes - I took the grandparent comment's "descr to a non-physicist" as "describe to someone who really isn't into math or hard sciences". Those folks will hear "million trillion" as "a really Really REALLY REALLY big number". Not as "1 x 10^18".
I guess, but "light year" is easy to say, easy to understand, and much less likely to mislead. And most black holes would probably be safe at that distance.
Though the issue of small black holes is worth bringing up. If you scrunch up one cubic kilometer of stone into a black hole, that's heavy to be stable for trillions of years, but light enough to pass between the Earth and the moon without causing serious problems. And we really have no idea what the smallest existing black hole is.
Maybe? But if (1) it's a few solar masses, and (2) the https://en.wikipedia.org/wiki/Oort_cloud exists - "from 2,000 to 200,000 AU" - then the black hole could send a lot of planetesimals flying off in random directions. Quite of few of those could be moving toward Earth's neighborhood, some at very high speed. Humans might soon join the dinosaurs.
Astronomical distances are vast, million trillion miles too far, that's over a hundred thousand light years. There are known stellar-mass black holes within just 2000 light years of the Earth. Heck, there might be a primordial black hole in the inner Oort cloud and not only would it not destroy earth, we'd have (are having) trouble detecting it.
Consider a balloon. I don’t imagine in visuals but if you do, either a solid color or a patterned balloon works. Let’s say it’s a cow print design.
Deflate it, then stretch the balloon over a vacuum cleaner tube and put on a rubber band to keep it in place.
If you pour sand on it, you can only get a small bump of sand and then it’ll run off the sides. Reasonable, logical, normal behavior. Clearly it’s a surface — it’s holding sand, it’s pouring sand in different directions over the edge, the sand is not all compacted into a single grain.
Turn on the vacuum cleaner. Assume a balloon stretchier than the strongest vacuum cleaner in the universe. What happens? Several things, each of which are perfectly reasonable:
1) The end of the tube is still a circle, and the balloon is still attached and covering the tube, so it’s still a two-dimensional circle.
2) A single grain of sand can’t block the vacuum tube, so it clearly hasn’t collapsed to a point.
3) The covered end of the vacuum cleaner tube is still the same circle, with the same diameter, as it was before you turned on the vacuum.
4) You can pour buckets more of sand onto that stretched circle of balloon than the handful you could before.
5) If you pour enough sand onto the circle, it’ll behave just like it did before: the sand will form a small mound and then newly-poured sand will run off whichever side the sand was poured on.
6) The rubber band is going to catch some of the overflowing grains of sand and hold onto them (‘accretion’), near but just outside the circle.
Next: Consider a more powerful vacuum cleaner. How much more? Lots. The most. An atomic Dyson powered by nuclear fusion. (This is a bit unrealistic, but that’s astrophysics for you.)
How much sand can you pour onto that two-dimensional, circular, balloon surface?
Lots. The most. Some of it will spill around the edges and get caught in the accretion band, but somehow that circle, that’s still the same size and clearly still blocking the vacuum tube, can hold an entire universe of sand.
That’s how black holes work :)
ps. For those who dislike the crudity of my teaching analogy and want to pop the spherical cow balloon: Topologically, the surface covering the vacuum tube is always a circle, even if you have an infinitely-powerful vacuum cleaner. At no point — pun intended — can a vacuum cleaner apply a transformation applied that reduces the dimensionality of the surface, thus it must remain, topologically, a circle.
pps. So clearly I must choose the circle in front of me! Hahaha! Aaaahahahah!
There's a little more nuance to this. The compiler knows the static type of any value placed into an interface value, and emits code to place a concrete type pointer (or itab pointer) into the interface value. You can see this in the disassembly.
Later when you pass this value around and assign it to places, sure, there may be a different type depending on where the interface value came from. But the construction of these values is very much static.
In this sense I wouldn't really call this "resolv[ing] while the program runs" unless you take a very broad sense of "resolution."
The construction of interface values is a very shallow mean and essentially irrelevant to the need for interfaces.
Whereas the runtime resolution of operations performed through an interface (dynamic dispatch) is the primary purpose of and use care for interfaces, with the dynamic resolution of wrapped types (type erasure / downcasts / type switches) is the secondary one.
reply