In the ’90s, a new set of languages like Java, JavaScript, and Python became popular. As a piece of C or C++ code gets bigger and bigger, it’s possible for even the most careful coder to make lots of memory mistakes, filling the software with bugs. A hacker might discover that a program isn’t cleaning up its memory correctly-information that should have been wiped (passwords, financial info) is still hanging around-and sneakily grab that data. Or you could give a digital intruder a way to sneak in. And if you accidentally forget to erase something? You can cause a crash: the software later on might try to use a space in memory it thinks is empty when there’s really something there. They require the coder to keep careful track of what memory is being written to, and when to erase it. You feel like a magician, and that never happens in other languages.” Parker Timmerman, software engineerīut as speedy as they are, languages like C and C++ come with a trade-off. “It’s enjoyable to write Rust, which is maybe kind of weird to say, but it’s just the language is fantastic. The kernels of Windows, Linux, and MacOS are all significantly written in C.) (It’s also used for more advanced computing: at some point an operating system needs to communicate with hardware. Machines that don’t have an operating system like Windows or Linux, including everything from dialysis machines to cash registers, run on such code. That’s why C and C++ are often used to write “bare metal” code, the sort that interacts directly with hardware. That power is useful: with so much control over dynamic memory, a coder can make the software run very quickly. An older language like C or C++ is designed to give the programmer a lot of power over how and when the software uses the chalkboard. Different computer languages manage this in different ways, though. As a piece of software runs, it’s constantly writing little bits of data to the chalkboard, keeping track of which one is where, and erasing them when they’re no longer needed. You could, very crudely, think of the dynamic memory in a computer as a chalkboard. To grasp what makes Rust so useful, it’s worth taking a peek beneath the hood at how programming languages deal with computer memory. But it’s meteor-strike rare for one to take hold and become part of the pantheon of well-known languages alongside, say, JavaScript or Python or Java. Plenty of coders create little ones as side projects all the time. It isn’t unusual for someone to make a new computer language. He named it Rust, after a group of remarkably hardy fungi that are, he says, “over-engineered for survival.” He opened his laptop and began designing a new computer language, one that he hoped would make it possible to write small, fast code without memory bugs. But Hoare decided to do something about it. Most of us, if we found ourselves trudging up 21 flights of stairs, would just get pissed off and leave it there. Microsoft estimates that 70% of the vulnerabilities in its code are due to memory errors from code written in these languages. The problem is those languages also make it easy to accidentally introduce memory bugs-errors that will cause a crash. The software inside devices like elevators is often written in languages like C++ or C, which are famous for allowing programmers to write code that runs very quickly and is quite compact. “It’s ridiculous,” he thought, “that we computer people couldn’t even make an elevator that works without crashing! ” Many such crashes, Hoare knew, are due to problems with how a program uses memory. Hoare lived on the 21st floor, and as he climbed the stairs, he got annoyed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |