|
> One I ran into tonight is that there's no such thing as a constructor
The problem you're describing is not the absence of a constructor but the absence of function overloading. Rust doesn't have constructors, because there's no need for a constructor as a separate function. That said, rust differentiates between function identifiers and struct identifiers, so you can create a function with the same name as the struct and call it. It will look just like a constructor in C++.
The reason rust doesn't have overloading is explained here.
|
|
|
|
|
But, either way, it lacks the incredibly obviously important means to do convenient and controlled initialization with various parameter combinations in a standardized way. That seems crazy-like to me. It doesn't seem to me that making an exception on overloading just for ctors would be such a huge compromise and would get rid of a raft of repeated silliness in every program.
Explorans limites defectum
|
|
|
|
|
I've been programming in rust since 2016. The number of times I thought "man, having function overloading would be really nice" can be counted on the fingers of one hand. If you have a case where you need overloading and the code looks more readable with overloading, you're welcome to discuss it on the language design forum.
|
|
|
|
|
Well, it wasn't about actual overloading, but construction. Object (or structure) initialization in Rust seems very weak to me, for the reasons I enumerated in my original post. Obviously we can live without overloading in general. My own CML language doesn't support it in general. But it does support it for constructors, for the same obvious reason that we want a consistent, formalized means for controlled initialization of data structures with variable parameter sets, not a somewhat ad hoc set of mechanisms that are either convenient but unsafe or safe but inconvenient.
Explorans limites defectum
modified 29-Apr-19 14:35pm.
|
|
|
|
|
BTW, while I'm whining... Who made the choice not to use an explicit return statement? That seems particularly non-optimal. There's absolutely no visual difference between the last statement falling out the bottom and an incomplete line of code just from looking at it. I mean readability is far more important than saving a few characters.
Explorans limites defectum
|
|
|
|
|
Get rid of the "Windows" namespace; no more C# "windows"; just a couple of hundred "other" namespaces.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Things have moved on quite a bit since you wrote this. It has become a thing, with most of Big Tech backing it and now using it a lot.
Even Google with Go sees a need for it. They will be using it in Android, for example.
Kevin
|
|
|
|
|
Actually I've dug into it quite a lot since then, and the more I use it the more I'm gravitating away from it. I get it of course. The memory safety is a huge, almost overriding benefit. But I just hope that these ideas get incorporated into a language I like better on the whole.
Explorans limites defectum
|
|
|
|
|
Was watching news tonight (I know - filthy habit) and heard that someone decided that the universe was several billion years younger than was previously thought. When I was younger this would have been interesting in a 'wow science is awesome' sort of way, but now I just thought "So what? Does it help make my car payment, or pay the mortgage, or improve my life?" And I was saddened to reply (to myself) "Nope".
This makes me sad
A human being should be able to change a diaper, plan an invasion, butcher a hog, navigate a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects! - Lazarus Long
|
|
|
|
|
Well, you know, that's why they invented drugs...
Explorans limites defectum
|
|
|
|
|
|
|
Never should have come down from the trees.
|
|
|
|
|
stoneyowl2 wrote: now I just thought "So what? It's just a side effect from the incessant streams of bullsh1t that spew forth from the "science" known as astronomy.
Almost every press release from every astronomer could be replaced with wither the word "bullsh1t" or the word "wolf".
It's impossible to get excited about a "great new discovery" when you know it's probably just a new great big lie.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
You spelled astrologer wrong
|
|
|
|
|
There's a reason why the two words have so many of the same letters in the same positions.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: Almost every press release from every astronomer could be replaced with wither the word "bullsh1t" or the word "wolf".
We're developers. How often do we roll our eyes when something happens in this field and we hear reporters completely fail to accurately describe what's going on because they don't understand what was explained to them and they mess up their dumbing down for the masses?
The same thing is going on in astrophysics. Don't blame them for the bullshit, blame the reporters.
|
|
|
|
|
Dark energy? Photoshop pictures of black holes? Exoplanets that they can describe better than the other planets of our solar system, etc, etc?
The reporters don't make up the bullsh1t, they just report it.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Well, while there is always a certain amount of 'manipulation' required to turn non-visual data into a picture, it's hardly photo-shopped. As to the exo-planets thing, I've never heard a single instance of anything remotely like that being said by any reputable scientist.
And, it has to be said, that modern digital cameras are no different. They capture energy levels as numbers and those are only turned into pictures by your computer assigning colors to those numbers. If some of that energy is outside of the visual spectrum by the time it gets here, that doesn't make it invalid to assign colors to those numbers based on known attributes of energies of particular levels.
Dark energy of course is theoretical still, and it might get dumped in the long run. But you have to have working hypotheses to move forward on and test, even if they have to be ultimately discarded or modified. The press almost always makes them out to be far more proven than the scientists ever actually claim. The actual papers may be full of qualifications and self-doubts and error bars, but that never gets into any 10 second new show 'science' segment.
Explorans limites defectum
modified 27-Apr-19 12:21pm.
|
|
|
|
|
Dean Roddey wrote: Well, while there is always a certain amount of 'manipulation' required to turn non-visual data into a picture, it's hardly photo-shopped. Really?
They decided that they wanted black holes to have a black middle and a bright ring (which makes absolutely no sense whatsoever; they would be the brightest objects in the sky), so they used a taxpayer-paid-for hyper-expensive version of photoshop to take away away everything that didn't look like that (about two thirds of the six million photons that had to work with), and called it absolute proof that their (ridiculous) idea of what a black hole looks like is indisputably true.Dean Roddey wrote: As to the exo-planets thing, I've never heard a single instance of anything remotely like that being said by any reputable scientist. This is the top result, when searching on "new exoplanet"[^]. See how much detail they claim as absolute fact.
Dean Roddey wrote: And, it has to be said, that modern digital cameras are no different. People who take selfies don't demand huge amounts of taxpayers' money to do so, and they don't claim to have found absolute truths about the universe.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Black holes have a planar accretion disc. It's not a globe around it, it's a flat disc around it, which would be aligned parallel to the black hole's rotation axis. We are seeing it about half inclined to our line of site, so it would look like a bright ring around a black center. Particularly for one so enormous, the event horizon is very large. If it were really small, then yeh, we probably wouldn't see much of a black center because it would be overwhelmed by the light of the accretion disk. But when the event horizon is more like solar system sized, that wouldn't be the case.
Explorans limites defectum
|
|
|
|
|
Dean Roddey wrote: Black holes have a planar accretion disc. It's not a globe around it, it's a flat disc around it, Yes, and there's nothing else around a black hole for billions and billions of miles; it's just completely empty space -- and there's especially nothing colliding and giving off light and heat.
So it's no wonder it looks exactly as they decided it would -- a perfect circle, because black holes will always be perfectly perpendicular to our angle of view.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
That's incorrect. The black holes being discussed here are at the center of galaxies. There is always material falling into these black holes. It's just a matter of how much, which changes over time. In the case of M87 it's VERY active, so there's lot of dust and other material falling into it, so it will have a very bright accretion disk.
The material in that disc isn't 'colliding' it's spiraling in, getting faster and faster as it gets closer to the horizon, which generates immense amounts of energy. Once it hits the horizon of course we don't see anything else from it. But, until then, it's enormously energetic, with the material reaching speeds of a substantial percentage of the speed of light.
That spiraling in creates a planar accretion disk which absolutely does matter as to the orientation relative to the observer. It also controls the direction of jets ejected from the black hole, which are perpendicular to the disc when they occur. M87 has enormous jets spewing out through the galazy from the black hole. And, if you look at the direction of the jets, it would agree very well with image in terms of orientation of the disc.
So, anyhoo, your understanding of the physics involved is just not right.
Explorans limites defectum
|
|
|
|
|
Dean Roddey wrote: So, anyhoo, your understanding of the physics involved is just not right. That's exactly what I was going to say to you.
I suggest you think a bit more carefully about what the immediate region surrounding a black hole would look like, rather than just believing the "absolute truths" that astronomers would have you believe.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
What exactly would that be? I think you misunderstand the distinction between a black hole and the singularity inside it. What we call a black hole is just the area inside the event horizon. No, there's not really 'stuff' inside that event horizon, but that makes no difference for what we are talking about here. The gravitational influence of the black hole DOES extend beyond the event horizon. Gravity is neither energy nor mass, so it isn't stopped at the horizon. It extends outwards just as the earthy's gravity extends beyond its surface.
Material falling into the center of the galaxy will be pulled into an accretion disc around the horizon, just as it would if it were falling onto a planet's surface.
Explorans limites defectum
|
|
|
|