Easier?
Easier?
Posted Nov 23, 2024 1:45 UTC (Sat) by khim (subscriber, #9252)In reply to: Easier? by ceplm
Parent article: NonStop discussion around adding Rust to Git
> Do you mean to say, with a straight face, that there are more Rust developers than the C ones?
No, but anyone may say, with a straight face, that the vast majority of developers, these days, have no idea how to write code in any language which have piles of UB and which doesn't notify you if you do mistakes.
You can give Rust compiler to TypeScript or Python developer and while they may not like it… they would be able to write something working.
You can not give them a C compiler and expect them to write code that works.
Because they implicitly expect that code either works or breaks and they get an error message – that's true for Rust without unsafe and very explicitly not true for C.
Posted Nov 23, 2024 13:25 UTC (Sat)
by pizza (subscriber, #46)
[Link] (3 responses)
No.
They may/will be able to write something without UB, but that doesn't mean it actually *works*.
The *works* is the critical point. It doesn't matter if git is written in rust or javascript or C or algol or whatever. You still have to have at least some understanding of what and how git does things -- core concepts, data structures, algorithms, etc -- if there is going to be any chance of producing something that works.
And sure you can just bash against the compiler until your rust code compiles, but again, that doesn't mean that the resulting binary _works_ for its intended purpose.
Posted Nov 23, 2024 15:56 UTC (Sat)
by khim (subscriber, #9252)
[Link] (2 responses)
It kida does, though. C/C++ is more-or-less unique among popular languages in that you may easily write code that compiler would accept and that would works, for some time, but may then explode if you change something in entirely different place. In most other popular languages if code compiles – then it works… somehow. It may not do what you want, it may even fail (and most likely would fail on first try), but it fails in predictable fashion! That's different story altogether. Once your code works but doesn't do what you want it to do you start the “genetic programming”: start mutating code semi-randomly while picking better and better behaving specimens till it would do what it needs to do. StackOverflow is a great thing at this point, ChatGPT or Gemini are even better. It does, though. Very much. Well… that's precisely what makes is so hard to contribute, isn't it? The algorithm explained above that the vast majority of modern programmers employ… it just simply doesn't work with C/C++! Because in C/C++ wrong code may actually work by accident in your tests, but then it would fail in larger program and random mutations don't bring you closer and closer to something you may declare as “finished” but just make it harder and harder for anyone to fix it.
Posted Nov 23, 2024 16:29 UTC (Sat)
by pizza (subscriber, #46)
[Link] (1 responses)
...Are you seriously asserting that something can still "work" even if it "it fails" ?
(Well, if by "works" you mean "compiler accepts it and it produces a runnable binary" then sure. But most would consider that a necessary, but wholly insufficient milestone)
Posted Nov 23, 2024 16:45 UTC (Sat)
by khim (subscriber, #9252)
[Link]
Sure, but in most language that perfectly fine basis for the iterable attempt to fix your code. In C/C++… that approach doesn't work at all: usually your code still fails but without any breadcrumbs which allow you to go and tweak the code randomly till error messages would stop occuring. Because in C/C++… very often the actual problem that makes you code fail (some wild pointer or buffer overflow or any other silly problem) is happening in entirely different piece of code, not where something actually crashes! That's such a crazy wild disconnect from what the most contributors (the ones who don't know C/C++, but know JavaScript, C#, Go, or any other popular language) expect that C and C++ form it's own wild subculture entirely disconnected from all other languages. Sure, there are also a lot of infigthing withing that subculture, too, but it's entirely separated from the other languages – and that division also reduces number of potential contributors. In C/C++ people consider it the norm that you would first try to understand core concepts, data structures, algorithms, etc of the project – and only then would attempt to contribute… but in all other languages it's the opposite: you first contribute something and as you add more and more code to the project you, gradually, learn about core concepts, data structures, algorithms, etc of the project. Contributing to the project written in Rust is the same as contributing to the project written in any other popular language and thus open up your project to a much wider audience.
Easier?
> And sure you can just bash against the compiler until your rust code compiles, but again, that doesn't mean that the resulting binary _works_
Easier?
Easier?
> But most would consider that a necessary, but wholly insufficient milestone
Easier?
config is undefined – oh, damn, I forgot to read the config file, ok, done panic: index 24325462 is out of bounds – wow, I guess I mess up with my calculations, somehow… better to fix that, and so on.
