Microsoft: Here's Why We Love Programming Language Rust and Kicked off Project Verona (zdnet.com) 171
Microsoft has explained why it's pursuing 'safe systems programming' through efforts like its experimental Rust-inspired Project Verona language and its exploration of the Rust programming language for Windows code written in C++. From a report: The short answer is that Microsoft is trying to eliminate memory-related bugs in software written in languages like C++, according to Microsoft Rust expert Ryan Levick. These bugs cost a lot to fix and make up a large share of Patch Tuesday hassles. Levick has now offered more insights into Microsoft's efforts behind safe systems programming. Systems programming includes coding for platforms like Windows, Xbox, and Azure, as opposed to programming applications that run on them.
Key systems programming languages include C++, Google-backed Go, and Mozilla-created Rust, but Rust and Go are 'memory-safe' languages while C++ is not. Other languages are memory safe, such as Swift and Kotlin, but they aren't for systems programming. The thing for Microsoft is that it writes a lot of its platform software in C++ and sometimes still in C. While it works hard to address memory issues, the company says it has "reached a wall". "We can't really do much more than we already have. It's becoming harder and harder and more and more costly to address these issues over time," says Levick, who joined Microsoft via its acquisition of Wanderlist, which has become Microsoft To Do. He gave a rundown of Microsoft's safe systems programming efforts in a session at Build 2020 this week.
Key systems programming languages include C++, Google-backed Go, and Mozilla-created Rust, but Rust and Go are 'memory-safe' languages while C++ is not. Other languages are memory safe, such as Swift and Kotlin, but they aren't for systems programming. The thing for Microsoft is that it writes a lot of its platform software in C++ and sometimes still in C. While it works hard to address memory issues, the company says it has "reached a wall". "We can't really do much more than we already have. It's becoming harder and harder and more and more costly to address these issues over time," says Levick, who joined Microsoft via its acquisition of Wanderlist, which has become Microsoft To Do. He gave a rundown of Microsoft's safe systems programming efforts in a session at Build 2020 this week.
How about Dart? (Score:2)
Re: How about Dart? (Score:4, Insightful)
Small example: sometimes you need pure speed and don't care about anything else. True real time matters for your project. You've just eliminated pretty much all the FotW stuff. Or... you need absolutely safety, your program can never crash or leak memory, must be absolutely secure. A whole of bunch of others eliminated. The language intersection of these different requirements is null, at the moment. (Please post if you know of something). And these are just two heavy handed examples. We could get into compression, math, streaming, gaming, and so on. Each field has multiple sub classes of requirements depending on,the project specifics.
Re: (Score:2)
The language intersection of these different requirements is null, at the moment. (Please post if you know of something).
HAL/S, perhaps? In the domain it was designed for, of course.
Re: How about Dart? (Score:2)
I've only read for 5 minutes on it but could you use it to write a complex desktop operating system? A high FPS video game? A web server? The AI for Tesla FSD? If not then we're still not at a universal language and I still think never will be. Maybe someday hardware will be so fucking fast that real time comes free so that requirement c
Re: (Score:2)
All that has nothing to do with languages, but if at all with libraries.
I hope I never meet you in a job .... you have no clue.
Re: (Score:2)
What do you think those libraries are written in?
Re: (Score:2)
Real time systems aren't about raw performance, it's about guaranteed response time.
Safety and real time aren't incompatible. And while you didn't mention it garbage collection/automatic memory management isn't necessarily incompatible with real time either.
ADA could be an intersection of the two even if it isn't in any way a perfect language.
Re: (Score:3)
The halting problem shows nothing of the sort.
Re: (Score:2)
You're still 100% wrong. Amazing. Did you even read the silly slides you linked?
I'm guessing that you failed out sometime in the first semester of your second year. Why don't you leave computer science to those of us with a proper education. You can get back to tinkering with scratch and python.
Re: (Score:2)
You're an idiot. None of that means that the halting problem shows that a program can never be proven to never crash or leak memory. Particularly when we can, and very often do, make those guarantees for some programs.
All is different than some.
That may be the fundamental point about the halting problem that you missed when you dropped out of trade school. It's trivial to show that some programs will halt, it's impossible to determine if all programs halt.
So, no, you moron, the halting problem does not p
Re: (Score:2)
Liar. Go back up and read the bullshit you wrote.
You're such a piece of shit.
Re: (Score:2)
I see that 100% -- I also see that it does not refer to "all programs" but to the "guarantee". Do you speak English?
Again, you don't have the intellectual capacity or the emotional maturity to participate here. That's saying something, given the low-bar this site has set for comments.
Perhaps you should find a new hobby? Computers are obviously well beyond your ability. I'll bet the QAnon people would love you.
Re: (Score:2)
Dart is not for systems programming.
Re: (Score:2)
Neither is "Go". Mentioning it in the same breath as C/C++ and Rust is completely misunderstanding what it is that C/C++ and Rust bring to the table: NO GC in particular.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Yuck.
Also, this guy seems cracked. You know he'll google it, and it may be harmful to exposed him to such an ugly thing.
Re: (Score:2)
Re:How about Dart? (Score:4, Funny)
People favor C because of its elegance. People favor C++ because it has features.
Re: (Score:2)
I would rather call C simple and C++ elegant.
C is certainly not elegant, it is primitive.
Re: (Score:2)
Re: (Score:2)
You think C++ is elegant?
Some stuff in C++ is elegant, yes.
The sad thing is C++ is not even efficient:
About the only language that regularly beats C++ in benchmarks is FORTRAN. So tell me in what way is C++ inefficient?
Re: (Score:2)
About the only language that regularly beats C++ in benchmarks is FORTRAN.
Nah, C++ usually loses to C in benchmarks too, especially modern C++. I can only assume that you haven't looked at benchmarks. Regardless, the difference isn't huge and of course can be made effectively zero by writing all your C++ code in a C style.
Now tell me, why do you think C++ is more elegant than C? If you answer, there's a 90% chance the first thing that will come to your mind is to start naming features. Because the only reason anyone likes C++ more than C is because of the features.
Re: (Score:2)
Nah, C++ usually loses to C in benchmarks too, especially modern C++
On micro benchmarks, possibly. Then again you can put in a few casts and compile your C code with a C++ compiler with the same resulting speed.
In practice, C++ does so much more for you that any given program is quicker to write in C++. In a world of finite resources you can then spend that extra time optimizing your code. And of course many idiomatic things like e.g. Std sort vs qsort are by default faster in C++.
Now tell me, why do you th
Re: (Score:2)
Combining simplicity, power, and a certain ineffable grace of design. Higher praise than ‘clever’, ‘winning’, or even cuspy.
The French aviator, adventurer, and author Antoine de Saint-Exupery, probably best known for his classic children's book The Little Prince, was also an aircraft designer. He gave us perhaps the best definition of engineering elegance when he said “A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.”
Re: (Score:2)
When did I say that they are the same language.
Let's be honest, in all your posts on this thread, you've only written about two sentences that are even coherent. The rest is just useless insults.
Re: (Score:2)
You asked if C++ was more elegant than C, while making snarky comments about what you expected my answer would be. Then when it turned out you were wrong instead of owning that you moved the goalposts to be about whether C++ is elegant all on its own. What's your game, bro?
Re: (Score:2)
What you'll find, is I'm not a pussy like you. If attacked, I attack back, and I don't hold back. Also, if you want to claim that I just shoot off my mouth on the internet where I don't have to face you, then, you are welcome to visit me at my home and attempt to insult me, you'll find that I'll give the same and more. And if you want to escalate to violence, I can go there too.
Wow, you can escalate to violence. I don't want you to escalate to violence, I want you to not act like a neanderthal.
If you really want to make someone look dumb on the internet, you shouldn't insult them or threaten violence. Instead, you should bait them into giving non-sequitur insults to everything you say. Then it becomes obvious who the fool is. (In this case, it's the one who doesn't understand that C++ and Go overlap for a lot of use cases).
Re: (Score:2)
Watch out! We've got a badass over here!
Yeah, violence is a great way to resolve technical disputes. Truly the mark of a true intellectual!
You obviously have some serious mental issues. Seek help.
Re: (Score:2)
LOL! I think we broke you. You're not smart enough or well educated enough to play in this pool -- and it's not terribly deep.
You are one sad and pathetic human being.
Re: (Score:2)
Dart is compiled to machine code, so you can do everything you want with it. That includes system programming.
Microsoft buy ads from Slashdot? (Score:2, Offtopic)
The ONE BIG ISSUE: When will we have a usable Microsoft operating system?
Yesterday's stories about Windows 10:
Windows 10 Warning: Users Hit By Serious New Failure [forbes.com]
Windows 10 update is wrecking laptops — now Microsoft is investigating [laptopmag.com]
Years of problems:
August 4, 2015: Windows 10 is possibly the worst spyware ever made. [networkworld.com] "Buried in the service agreement is permission to poke through every
Re: Microsoft buy ads from Slashdot? (Score:2)
Re: (Score:2)
Okay, whippersnapper.
That was also the time Microsoft was sincerely evil. Went from the point where upgrading my install meant fresh floppy images from the slackware FTP site, up until about where Google decided to just fully ignore their phrase "Don't Be Evil" (that is, about 3 years ago?)
Now, for some strange reason they seem to have genuinely turned the page on that $%^& and are...doing some good things.
So maybe it's not ads? Maybe it's that in this strange alternate future I didn't expect myself to
Re: (Score:2, Insightful)
Bullshit, not leading edge at all. Even Azure offererings have all kinds of linux infrastructure because Microsoft not smart enough to lead. Now they're trying to suck up to the people that make and use real operating systems and the stuff that makes the internet work, because they realize they've failed in yet another space. They failed in mobile, failed in server space, failed in supercomputing and the desktop is being eroded away. Fuck Microsoft, the enemy of open source and choice.
Re: (Score:2)
Nah, you haven't been paying attention to where the leading edge went I think. They're doing some interesting things in mobile now that they've given up being the platform. They've pivoted to become toolsmiths (which they were actually not bad at by popularity though I personally hated them), and they're making all the tools open source. I find it hard to get worked up about that?
Re: (Score:2)
Even Azure offererings have all kinds of linux infrastructure because Microsoft not smart enough to lead.
Actually Azure have all kinds of Linux infrastructure because Linux is what a lot of clients demand and running Linux clients on Linux virtual infrastructure is something where someone else has done all the work for you already.
Microsoft is smart enough not to spend stupid money to replicate a function that someone else already gifted to them.
Now they're trying to suck up to the people that make and use real operating systems and the stuff that makes the internet work, because they realize they've failed in yet another space.
I'm curious where you think they failed? The vast majority of internet traffic hits Windows machines. Azure instances of Windows are rising vs Linux. But let's address
Re: (Score:2)
You are in denial about reality. Apple is eroding Windows desktop/laptop share, they have 13% now. Wake up and smell the coffee.
And Windows making the internet work? Do you even know how things work? You think Microsoft email and web servers, load balancers, routers and firewalls drive the internet? News for you pal, they don't.
You're just wrong and more wrong, must be MS stock holder to be such an ignorant uniformed shill.
And no, Microsoft doesn't many advertise parts of Azure infrastructure that are
Re: (Score:2)
I don't think the reasons are hard to find. If you're the underdog you need to drive adoption, and the way to do that is "free." Hell, that's how Microsoft became dominant in the home in first place: piracy, and the tacit acceptance thereof. Only after they had established market dominance and started cracking down on "free" did they start slipping.
Personally, I can't abide a non-POSIX compliant OS anymore, and while I appreciate WSL (and use it extensively whenever I need to use Windows), the only real
Go is NOT a systems language! (Score:5, Insightful)
I don't know why people continue to group Go in with systems languages, when it is firmly in the same class as Java (Kotlin), C#, D, Swift, etc. These are all memory-safe, garbage collected, relatively efficient programing languages that are good for the vast majority of programing tasks, but systems programing is part of the minority niche that they cannot fill.
No language that uses garbage collection, with the unpredictable latencies it introduces can be considered a systems programing language. Nor languages that do not provide low-level access to memory and hardware (eg if you can't address memory-mapped hardware, or respond to CPU interrupts).
Re: (Score:2)
(eg if you can't address memory-mapped hardware, or respond to CPU interrupts)
..or allow insertion of machine language directly?
(my programming skills are way out of date so I don't know if the other languages you mentioned allow that or not, but I suspect they don't)
What defines "systems Language" (Score:2)
What are the defining systems language characteristics? And why? Can some of the languages you name replace their GC or control it?
Re: (Score:3)
Re: (Score:2)
The only way it's predictable is if there's only one thread running, there's no I/O concurrency, and it's invoked explicitly, which is silly.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Java (and such Kotlin) have non GCed VMs, too.
And even standard Java can access arbitrary memory, albeit by @depricated APIs, and then you can call C from Java - problem solved.
Re:Go is NOT a systems language! (Score:5, Interesting)
Swift uses automatic, implicit reference counting. This has not insignificant run-time overhead. Sometimes the compiler can figure out that it can avoid the reference increment/decrement and optimize it appropriately, but, this is not guaranteed and cannot be relied upon. C, C++, and Rust all try to have zero run-time overhead. Rust also tries to have zero run-time overhead while at the same time having memory and thread safety without run-time costs. That is what makes it different. It is an entirely different approach that prioritizes all the following: high-level abstractions, zero or minimal overhead, memory safety, thread safety. This is unlike any other language currently out there (that is widely used). It truly is a game-changer. Anyone who doesn't see this probably hasn't spent enough time getting past the perceived SJW reputation of Rust to truly examine the problems that Rust is trying to solve and how the solutions they've developed are quite unique and powerful.
Re: (Score:2, Interesting)
If it's not clear to the programmer what Rust is doing (and what it isn't doing), then it's not suitable as systems language.
That's why C and to a lesser extend C++ is so popular: one can figure out pretty much which CPU instructions will be used in what other and to what instruction they are related to.
That's also why debuggers have little problem mapping instructions to lines of source code, because there's a 1:1 relationship. Something that's very desirable (a proper working debugger) when developing.
The
Re: (Score:3, Insightful)
> one can figure out pretty much which CPU instructions will be used
No. Not with an optimizing compiler that does aggressive inlining, vectorization, loop unrolling, etc.
You say:
> I admit i'm ignorant when it comes to rust.
and then:
> Rust - in my view - tries to fix issues at the wrong level.
These two statements, as well as many others you've made above, are 100% in conflict with one another. If you are ignorant, how can you have a meaningful opinion. Perhaps you should educate yourself first so
Re: (Score:3)
I think the problem with the attitude of "let the programmer figure it out" has been borne out countless times over the past half-century: Programmers don't fix their bugs (for countless reasons, many of which are outside of their control) and those bugs introduce security risks. Moreover, humans are inherently fallible, forgetful, and distractible, and will never write perfect code, so why relegate the most important and vulnerable aspects of programming (i.e., memory and thread safety) to humans when ma
Re: (Score:2)
Unmanaged code in C# is to be kept to an absolute minimum by design. Basically you are only supposed to use it for taking in or outputting data, everything else should be managed code which has wrappers for things like calling unmanaged library functions.
It's really not designed to do anything that requires more than a few lines of unmanaged code in some I/O routines. The managed stuff is incredibly readable too, it's a great language for building applications.
Re: (Score:3)
That's why C and to a lesser extend C++ is so popular: one can figure out pretty much which CPU instructions will be used in what other and to what instruction they are related to. ... facepalm.
Funnily that will be in every language the same ones
But why not let the programmer f* up, learn from the mistake and after have an even better understanding what's happening,
Because it is hard for people to learn from programming mistakes. First of all: someone else will fix the bug, they never see their own mistake.
Re: (Score:3)
You should seriously take a look at Rust when you have a chance. I think it really is a lovely language and I am mostly a C programmer. It can compete with C++ in a lot of benchmarks and it all just feels like a next-gen version of C++ in so many ways.
I don't care about the safe vs unsafe thing at all and although I am just starting to learn the language I think you can run so called 'unsafe' code whenever you want as well as inline assembly and you can call C functions quite easily at basically zero cost.
Re: (Score:2)
> Rust is not object oriented
So what. That's a good thing. OOP (Inheritance) is not needed or desirable. It's nothing but a huge cluster-fuck. You may not think so, but, many, many do. Hierarchies are never static. It's meaningless modeling things as "Is-a" relationships when what is interesting/important is "Has-a(Capabilty)" relationship which is what Traits model. OOP languages are strictly worse in every possible way. Arguing Rust is not good because it isn't OOP is laughable.
> has no functional s
Re: (Score:2)
not worth learning unless one pays me to do a job in it.
What can I say, some old dogs are unable to learn new tricks. :P
I said not worth learning. I did not say I can not. I rather learn something else than Rust, unless a paid job requires it. As my assumption is: I learn it in a day. Your millage may vary
Re: (Score:3)
Of course it is possible with GC.
Bertram Meyer wrote a thesis about that and built it into his Eiffel compiler.
Thee is no reals reason that GC can not be as fast as manual memory management in C or C++.
Re: (Score:3, Insightful)
Direct link (Score:3)
Video of talk is at https://mybuild.microsoft.com/... [microsoft.com]
Misplaced Faith (Score:5, Insightful)
I'm not saying that this move to Rust is wrong, but I still have difficulty with the mindset that you just change languages then magically all the bugs stop happening.
Doesn't work that way. Never has never will.
Yeah they will stop getting crappy pointer bugs but the team with the talent level that wrote crappy pointer bugs in the first place will naturally and effortlessly find new types of bugs to create.
Re:Misplaced Faith (Score:5, Informative)
Not all bugs, just bugs that could be avoided by not using a kitchen sink language like C++ that, despite all of its complexity, could not bother with bounds checking and better memory management. When you spend more time trying to understand what the compiler does, or how to trick it into doing what you want, instead of solving the actual computational or business logic problem, then you picked the wrong tool. Apparently everyone has.
Re: (Score:2)
This is why C++ shouldn't be a systems language.
Re: (Score:3)
This is why C++ shouldn't be a systems language.
C also shouldn't be a systems language. It doesn't have the complexity of C++, but it also doesn't bother with bounds checking or better memory management. C is also at too low an abstraction level in many cases, and not just because it requires programmers to do extra work, but because it impedes optimization. Too much isn't expressible directly in the language, so the compiler and optimizer have to try to read the programmer's mind to figure out what's safe.
Rust is still something of an unknown quanti
Re: (Score:2)
and a higher level of abstraction that appears to enable much more effective optimization.
I don't really see any evidence for that claim. The abstraction level doesn't seem much different from C++, and the performance is slightly behind (on which one can probably blame less mature compilers). It looks very similar to C++ overall in the machine model it uses and the type of abstraction.
Re: (Score:2)
Too much isn't expressible directly in the language, so the compiler and optimizer have to try to read the programmer's mind to figure out what's safe.
It's the exact opposite of that. The beauty of C is that it is minimal enough for everything to have clear, concise rules and there is no mind reading required. Everything is explicit in modern C, the few areas that were ambiguous are now formalised and the compiler can make simple logical decisions about optimising it.
One common mistake novices make is thinking that qualifiers like const, static and volatile are related to optimisation.
I hope Rust does take over more system programming. There is a lot of b
Re: (Score:2)
C is minimal, predictable, etc. But I think swillden's comment is related to the fact that getting optimal code (predictably) is hard due to the fact that the language lacks enough constraints to allow the programmer to convey enough clues to the compiler/optimizer, so it typically builds for the worst-case. Maybe it should be stated that "...so the compiler and optimizer have to try and read the programmer's mind to figure out the _most optimal way_ to keep the code safe." And I'm not talking about thin
Re: (Score:2)
I see what you are saying but I think some examples would really help. If anything I'd say it's more like the other way around, generally if you understand the compiler well enough (i.e. you can read its mind) you can get it to optimize the way you want it to. Never quite as good as hand coded assembler but no higher level languages manage that.
I do a lot of code for 8 bit systems and generally don't find this stuff to be much of an issue. Occasionally I do a bit of assembler but I haven't see anything that
Re: (Score:2)
You call yourself theJavaMan. What language are most JVMs written in?
No one spends more time trying to understand what the compiler does in C++, except for compiler writers. What you say sounds like someon
Re: (Score:2)
You don't need bounds checking if you don't go out of bounds. It is much better to provide high level constructs that avoid bounds all together. C++ does that and shows people how to do that with its STL algorithms, and the upcoming ranges library. It does it without introducing any runtime overhead.
Yep.
Also: Microsoft may be claiming tu use C++ but all their base APIs are C (ie "Win32"). They all use structs with no constructor, they all have an uninitialzed "size" field inside that struct to indicate how big they are as a sort of versioning system, etc., etc. It's C, not C++.
Re: (Score:2)
Actually, C++11's smart pointers are a major improvements in memory management. Regarding bounds checking, if you don't do bounds checking, you lose speed. Both Rust and C++11 are trying to implement memory protection algorithms that run AT COMPILE TIME, in order to preserve efficency.
Re: (Score:2)
The point of C++ is that you can define your own (better?) memory management.
Re: (Score:2)
> but I still have difficulty with the mindset that you just change languages then magically all the bugs stop happening.
If that were the mindset of the Rust community, I'd agree with you. Fortunately, I have not seen or experienced that to be the case. Outside of people shooting off their mouths who don't speak for "The Community" I've never seen anyone in that community say that simply changing the language will solve all the problems.
What I have seen said is that there are several classes of problems
Re: (Score:2)
However, it is clear, that GC can never match the performance of manual memory management like that which is done in C or C++.
What performance? Programmer's performance when having to use malloc() and free() manually sprinkled throughout the program in C? Or the execution overhead associated with these things? In C++, the potential unbounded latency of destroying large graphs of objects? How does that compare, for example, to the allocation speed, concurrency properties and throughput of C4/Zing with guaranteed zero pauses for mutators?
Rust does have optional single-thread-only reference counting, "Rc", and muilti-thread capable atomic reference counting, "Arc", but, you only need to use them in situations where that is the only way to model the specific problem
I doubt that that is "the only way" to model the specific problem. Well, maybe in Rust it is. (I
Re: (Score:2)
It really depends on the use case. If memory is at a premium, then a) you will probably never have large graph objects, and b) you need very tight control over allocation and destruction. If you're working with effectively unlimited memory, then those things become less important.
Re: (Score:3)
How much electricity (that is, battery power or money), does it waste by using significant CPU time traversing the memory to look for referencing objects, etc.
Very little, certainly less than atomic refcounting would. We know how horribly broken refcounting is from performance perspective. It's been that way for three decades by now. So certainly the best option is to avoid doing memory management completely whenever you can at compile time, like presumably Rust does, but for handling the rest that you can't, surely refcounting is one of the worst choices you could make. The only excuse for it seems to be that when you need only very little of it, you will also p
Re: Misplaced Faith (Score:2)
Saying that a GC doesn't waste resources compared to zero-runtime overhead is laughable.
Or you could stop with the straw men and actually start reading what I wrote? Since literally no one is making that claim here.
Re: Misplaced Faith (Score:2)
So, again, why would you think GC is a better solution
All I said was that GC is better than refcounting. Learn. To. Read.
Re: (Score:2)
refcounting is not what Rust is about
Then why did you mention it? Don't use it at all, problem solved. Why use misfeatures when Rust has a better solution, as you said?
Re: (Score:2)
You don't have to be a bad programmer to make off-by-one errors, or misconstrue corner and edge cases, or forget a default case. It happens *all the time* by very competent programmers who know exactly what they're doing.
Re: (Score:2)
I'm not saying that this move to Rust is wrong, but I still have difficulty with the mindset that you just change languages then magically all the bugs stop happening.
You don't though; you just don't like it with this language. Otherwise you may as well write in machine code.
Many of the advancements in languages have eliminated wide classes of common bugs.
Machine code to assembly eliminates the common bug of figuring out the bit packing wrong and putting the wrong instruction variant in the code.
Structured
MS shot themselves in the foot (Score:2, Insightful)
With C++ eons ago when they put COM everywhere with *client-controlled* refcounts.
Completely subverts the standard RAII pattern that fundamentally helps prevent C++ code from leaking.
Re: (Score:2)
With C++ eons ago when they put COM everywhere with *client-controlled* refcounts.
Completely subverts the standard RAII pattern that fundamentally helps prevent C++ code from leaking.
This.
All their most basic APIs and connections are fundamentally C, not C++. It's all structs with no constructors, no initialization of variables, they all have an uninitialized "size" field inside them as a sort of 'versioning' system, etc., etc.
It's a disaster waiting to happen and they can't fix it without scrapping the whole "DLL" thing.
Re: (Score:2)
C++ has structs too. It's basically a superset of C. So all of their APIs are fundamentally C++ too. C++ has zero problems interfacing with that stuff as I'm sure you know. If C can do something then C-With-Objects can nearly always do it too and in exactly the same way.
Re: (Score:2)
Google "name mangling" and read up on 'extern "c"'.
Linus was right!
Re: (Score:2)
Refcounting is fully compatible with RAII - have you ever used std::shared_ptr?
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
I can't decide which piece of low hanging fruit to take a bite of.
I'll handle this.
He gave a rundown of Microsoft's safe systems programming efforts in a session at Build 2020 this week.
So, Build 2020 has 10 second lightning presentations. Good to know.
Thank you, thank you, I'm here all week. Try the kipper.
Re: (Score:2)
So, Build 2020 has 10 second lightning presentations.
Sounds suspiciously like a BlipVert... did anyone in the audience explode?
Re: (Score:3)
The problem is that DLL files and COM use C, not C++, ie. they work by passing raw structs around.
Those structs have no constructors or destructors, they're full of pointers, they all have a 'size' field as a primitive sort of "versioning" system, etc., etc. There's many many ways to mess them up and no real solution.
Re: (Score:2)
If they use C instead of C++ that is actually a good thing if you want to call them from a Rust program [rust-lang.org] and who doesn't.
And as far as structs and pointers I don't see the problem. Just don't be an idiot and pointers and structs are great. What is supposed to be the problem with structs anyway? They are just aggregate variables or objects without methods. Again I don't see the problem. Are you a Python programmer?
Re: (Score:2)
What's this whole SJW thing about? Is it their code of conduct? I never read it. I suppose it only applies if you interact with the core group - after all any forum or organization is free to suggest their own rules and many do. I just use the language and the forums I frequent on Rust are independent anyway.
This whole polarizing SJW thing seems so quintessentially American and politically loaded. The last four years in particular. Everything is always taken to the extremes over there and we tend to find it
Re:How bad at programming do you have to be? (Score:5, Funny)
Someone took exception to your remark but failed to handle it properly.
Re: (Score:2)
> Won't the same programmers who produce pointer bugs
You mean ALL programmers. If you believe you are immune, you're not much different from a drunk-driver who has never killed anyone YET.
> You can't eliminate indexing past the end of an array.
No, but, the language can strongly discourage direct indexing of arrays in favor of zero-overhead iterators that can compile down to highly optimized code that is 100% free of these issues without any run-time out-of-bounds checks. Rust does this.
> You can so
Re: (Score:2)
>
> You can't eliminate indexing past the end of an array.
No, but, the language can strongly discourage direct indexing of arrays in favor of zero-overhead iterators that can compile down to highly optimized code that is 100% free of these issues without any run-time out-of-bounds checks. Rust does this.
So does C++.
It can also add range checking to operator[] and keep random access to memory within bounds. Microsoft's own Visual C++ has done this by default for many years now.
Re: (Score:2)
Rust doesn't use GC. It "manages" memory by statically tracking ownership and borrowing (reference) at compile-time and refusing to compile code that does any of the following: 1) have more than one owner of a memory area, 2) have a shared/immutable reference to a bit of memory at the same time having an exclusive/mutable reference to the same memory, 3) having more than one exclusive/mutable reference to the same memory. It then releases/deallocates (at compile time) when the owner's scope ends. If the own
Re: Microsoft Visual J++ 2020 (Score:2)
Embrace and extinguish, was the strategy. They are at it again, not just with this but with JavaScript by making TypeScript.
Re: (Score:2)
It's not close to the same. Typescript works fine on all OSs, it's just a language and the fact it was created by Microsoft matters nota jot. J++ was a deliberate attempt to destroy the write once-run anywhere ethos of java (not that that every worked). Typescript is the best thing to happen to javascript in the last 10 years. I used scala.js for quite a while but its too hard to find developers, and typescript gives 80% of the benefit for 20% of the pain.
Re: Microsoft Visual J++ 2020 (Score:2)
Nonsense. J++ just used a different platform-specific way to run native code. Native code is by definition platform-specific (due to ABI differences) so âwrite onceâ(TM) is already out the window. No, Sun was pissed that that had given Microsoft a VB replacement.