C Language vs Rust
-
I highly doubt it would ever happen: Rewriting it in a new language is essentially creating a brand new application, and doesn’t seem to be what Don has indicated his interests are in. (And honestly, I doubt the most difficult technical challenges in Notepad++ are the memory management/garbage collection. So doing an entire rewrite just for the sake of fixing something that ain’t broken seems unnecessary, at best.)
I would personally prefer he continue to spend his time on adding new features and fixing/improving old ones, rather than rewriting everything.
-
Yea, let’s just toss two decades of software development and maintenance in the garbage heap, makes sense. :-(
-
@Alan-Kilborn Obviously, Alan, you are NOT open to new ideas / improvements in new programming languages. We all know the limitations of C and c-based programming languages.
My suggestion would be to incorporate the Rust language in the development of drivers, etc as a first and learning step. -
@Murray-Sobol-1 said in C Language vs Rust:
@Alan-Kilborn Obviously, Alan, you are NOT open to new ideas / improvements in new programming languages.
Rewriting an application from scratch is a huge investment in time and resources. Rewriting an open-source application from scratch, when the main developer has no good reason to do so is something that’s not likely to happen. (Notepad++ is volunteer, unpaid development. The author himself only works on it in his spare time, as he has a full-time day-job to pay his bills.)
And, btw, Alan is just a fellow user, like you and like me. So he’s not the one you need to convince. (And the way you argue, I cannot imaging that your techniques would convince Don to invest that time.)
We all know the limitations of C and c-based programming languages.
Though not all of us agree that a limitation of a language is enough to justify throwing away the existing codebase and starting over from scratch – especially when the aspects of the application that would use that “limited” portion of the source language are working as designed.
My suggestion would be to incorporate the Rust language in the development of drivers, etc as a first and learning step.
What “drivers, etc” do you think are part of Notepad++?
-
@Murray-Sobol-1 said in C Language vs Rust:
My suggestion would be to incorporate the Rust language in the development of drivers, etc as a first and learning step
Oh, sorry, I didn’t know you meant such new development; perhaps you should have mentioned that in the first posting, for the utmost in clarity.
I guess if you reread your original post, you’ll see how silly it sounds without that qualification.
In light of the new information, I suppose that yes, it would be interesting to see some newer technologies show up in Notepad++ sources.
-
@Murray-Sobol-1
C developers free memory as soon as it is no longer needed. “Garbage collection” is a completely different thing.Rust does not have better memory management. Rust helps (careless) developers to avoid mistakes. It comes with a price of less flexibility. Notably the inability to form linked list which is the bread and butter of C programming.
Rust claim to fame is reducing the bug rate in very large projects. Much of it is for large groups of developers where rust helps in catching bugs a developer added due to misunderstanding other developers assumptions.
This advantage is very minor to Notepad++ which is a mature project with relatively low amount of development and very few developers.
I do wonder how many experienced C/C++ developers switched to rust and like it. I am mainly a C developer, not C++ so I don’t use STL, I use raw pointers ALL THE TIME. I started reading rust documentation. It is quite impressive but not using pointers freely feels like working with my hands tied.
-
… furthermore Rust and C++ code cannot simply be mixed, the effort to do this is … considerable.
But if it is about plugins, then this can be done already today … but here one must work with unsafe code permamently,
if interactions with Npp or Scintilla are desired. So whether this helps to write safe code I don’t know.I have been experimenting with several “modern” languages lately, Nim and V (garbage collected), Odin, Zig and Rust.
All have some appeal, but each require glue code to be written in order to use it to write a plugin for Npp.
It seems to be a certain challenge for programming languages to create a DLL and interact with the Windows API.A few impressions
Please note that these are not truly idiomatic code, as I have learned just enough for each of these languages to make the plugins work.
-
@gstavi said in C Language vs Rust:
C developers free memory as soon as it is no longer needed
HaHaHa:
One of the most common mistakes made in c (or C++) is exactly this: the Failure to free memory when not used. -
@Murray-Sobol-1 I doubt Rust is well suited for creating Windows desktop applications. The Notepad++ GUI is perfect and cannot be done better in Rust, probably only worse. And even if Rust was that great, there would be no need to completely rewrite an absolutely properly working application.
-
@Murray-Sobol-1 ,
Then you have just made the case for C, since it is not the language’s fault, but the faulty operator’s (programmer’s) fault.
:)
People in general don’t clean up after themselves, why should their programming be any different. It takes discipline, not seat of the pants programming they like to call rapid development. Better to learn it right and get faster, than to get it done faster and spend forever cleaning it up. -
@Murray-Sobol-1 said in C Language vs Rust:
HaHaHa:
One of the most common mistakes made in c (or C++) is exactly this: the Failure to free memory when not used.HaHaHa,
One of the main reasons why you shouldn’t convert Java (or Rust) developers to C.
But 1st grade developers who learned C as their first programming language don’t do this mistake.Surprisingly, both Linux and Windows kernels are written in C and they manage to free unneeded memory.
-
Truly agree rust is really a far better language
-