![]() With that in mind your question might become "Why create a Rust language specification rather than add the features it offers to existing specifications of C or C++ or whatever else" There are hundreds of compilers for the C language besides GCC. Given such specifications one can write compilers for the languages. Or at least it is defined by what we find in the Rust Book and other places. ![]() Rust also has a specification somewhere (I know not where). As you likely know C and C++ are defined by their ISO standards documents. One should not confuse a programming language with any actual compiler for that programming language.Ī programming language is a syntax and semantics defined by some specification. Why did some people create a new language like Rust instead of improving gcc and adding those security checks in rustc into the gcc compiler ? It can be nice to make new things without the weight of almost 4 decades of history.They are massive semantic differences and if we were add things like move-by-default, the borrow checker, and lifetimes to C++ or remove things like templates and copy/assignment/move constructors then it would no longer be C++ The things Rust introduces are much more than "security checks".It might be that adding these shiny new features would be technically infeasible in existing compilers like GCC or Clang. Every codebase suffers from entropy and over time you will make decisions about how something is implemented that make certain solutions impossible.Every year there are thousands of new programming languages that get created, it's just that only a handful will ever gain popularity.You can't keep adding features to a language indefinitely without it turning into an inconsistent mess that is impossible to implement or learn.Sometimes you want to try something new which would be a non-starter on the original language for backwards compatibility or philosophical reasons.Instead, the people that define C++ and the people that design Rust are separate groups with their own values, goals, and ideas for what makes a good programming language There is no one body that creates all the programming languages in the world.This particular topic (C++ versus Rust) tends to spark a lot of religious wars, so I'll try to outline some general contributing factors: ![]() There are a lot of reasons you might want to create a new programming language instead of adding new features to an existing language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |