I will soon be teaching my family about programming, and while preparing for it, stumbled across an article that sparked a question which I would like to hear feedback on. I though this would be a great community to post this to.
A Brief Backstory
As I said my family is getting a lesson on the science of computers, because in 2019 I think everyone should be able to write or at least understand a bit of source code. Before I set out on this endeavor, I had bought a bunch of books from Humble Bundle about programming that I have been meaning to get through, and this was the perfect opportunity to read them.
The Main Event
One of the books (you can read this one for free) I started reading is about Rust. I have heard of Rust before this, but I haven't look into it much until now. As I have been reading the book I was wondering if ffmpeg had a library (or crate as they call it) in Rust. In my research I found a couple of bindings/wrappers for ffmpeg, but I also found two articles about some of the short comings of the language [1 by Michael de Lang & 2 by Eax Melanhovich]. These were written in 2016 and 2015 respectfully, so they might be a bit out of date with some of their information, but the question I want to rise still stands.
The first article talks about how Lang was rewriting nanogui in Rust, and found a few roadblocks that he couldn't get around to get the same functionality as the original. Lang went on to say that the concept of Rust was quite appealing, but certain aspects of the language (the problems he had) felt vary limiting in a OOP style.
The second article is about how C/C++ "Killers", Rust specifically, are unlikely to take over the market, simply because of the time and refinement that has been invested into C/C++ to make them better, as well as the sheer amount of catch-up a new language has to do with getting libraries for their language. Melanhovich also mentioned how a lot of the problems addressed by Rust have mostly been solved before by tools built for C/C++. Then after reading this I had a thought, which leads us nicely to my question I would like to propose.
Just for anyone reading this unaware of what the point of Rust is, The idea is to make sure (mostly) your memory management is as safe as it can be, like Java or Python, but without the performance hit of Java or Python (hence being the speed of C/C++). One large gripe I have with the whole software industry is that there are too many languages. When I go to teach Programming the idea is to put more emphasis on the concepts of programming rather then the syntax of one particular language. I find beginners seem to get stuck with trying to remember the syntax of a language more, instead of remembering the flow/logic of programming. All of Rust's claims are implemented in the compiler to catch those pesky bugs before the costumer gets it. So finally This brings me to my question. If all the magic of Rust is in the compiler, Why not write a new compiler for C/C++ that does everything that Rust does?
I mean, it always feels to me that when ever some one tries to make their language "better" then some other one, it seems like a duplication of time and effort that could have been spent making an already established language better then it already was. Plus you get the benefits of having years of libraries for your language already. Yes, There are reasons to create an entirely new language along with the syntax, but here it feels vary unnecessary to make a new language. I myself would like to write a simple interpreter or compiler, not to make the hot new language, but rather to learn how a interpreter/compiler is made/works. And maybe making your own little version of BASIC (or whatever) is not your cup of tea, but I think making a compiler to understand what it is doing is a good exercise for everybody (well, maybe not everybody).
Well, I can't wait to see what people have to say about my post here! What do you think? Do you agree with my question? Maybe you just stopped by to see what my thoughts about Rust were. Whatever the case may be I hope you enjoyed reading my humble little post. I also encourage you read both of the articles I mentioned if you have the time, because I think they are an interesting read, and there is more to glean from them then what I mentioned here.
Is that it's not too long, and you should be ashamed of yourself for trying to skip to the bottom and get ALL my thoughts in one sentence. Wait why did I make my question italic AND bold?
Sincerely, Logos' Coder