3 ms·
What got Rust adoption if anything was human factor, most folks adopting it never programmed in Ada, Object Pascal, Modula-2, Delphi,... They weren't even born
by pjmlp 2y ago
What got Rust adoption if anything was human factor, most folks adopting it never programmed in Ada, Object Pascal, Modula-2, Delphi,...
They weren't even born when we were using them, or if they were their toys were actually toys not systems programming languages.
Rust was their first encounter with systems programming, and Standard ML linage, after lots of Python, Ruby and JavaScript, and most likely never seen anything else other than C and C++. Most likely that also believe the fairy tale of C being the very first systems programming language.
- dakom 2y agoI'd agree it's largely the human factor, but maybe from a different angle. Rust has got the "there's a crate for that" factor, like JavaScript, which helps onboard people who are afraid of getting stuck writing everything from scratch. For example, serde (and serde_json, toml, etc.) is a gamechanger, as is tracing, reqwest, and many others. So, maybe less about the language itself for many people, but more about the human factor of overcoming fear of being stuck on an island
- IshKebab 2y agoI'm not sure what point you're trying to make. Do you think Object Pascal is as good as Rust?
- pjmlp 2y agoNope, but definitly better than C in regards to safety in systems programming.
- bawolff 2y agoThat's a pretty low bar. What would be less safe than c?
- pjmlp 2y agoAnd yet here we stand, still not having it replaced at scale. To quote Hoare in 1980, "A consequence of this principle is that every occurrence of every subscript of every subscripted variable was on every occasion checked at run time against both the upper and the lower declared bounds of the array. Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to--they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980 language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law." ===> I note with fear and horror that even in 1980 language designers and users have not learned this lesson. Referring naturally to C, by the way 1988 is the birth year of the Morris Worm, taking advantage of C's buffer management capabilities. Yes, a pretty low bar that 40 years after those events is still largely used across the industry. And the copy paste compatibility of Objective-C and C++ with C doesn't help, because even though those languages provide better capabilities and safer alternatives than writing raw C, there are always those folks that will write C style code no matter what.
- pdimitar 2y ago> And yet here we stand, still not having it replaced at scale. Network effects and business' risk aversion. Nothing to do with technical superiority / inferiority really. The MBAs only hear "we must replace everything from scratch" and immediately shout "NO!". Offensively simple I am afraid. That's all there is to it. Believe me, I'd jump with joy if we scrap like 75% of all UNIX crap, especially "untyped text rulz" in the terminal -- and introduce one good terminal protocol in the process. But it ain't happening in yours and my lifetime.
- pjmlp 2y agoMost likely so, and that also applies to most Rewrite in Rust attempts, sadly.
- 2y ago
- timbit42 2y agoAssembly.
- chadcmulligan 2y agoFun Fact - The NSA / White House regards Delphi (object Pascal) as a memory safe language - https://blogs.embarcadero.com/is-delphi-a-memory-safe-language https://blogs.embarcadero.com/is-delphi-a-memory-safe-langua... in preference to C/C++. Not sure I agree, but I bow to their authority.
- pjmlp 2y agoBecause it is, even if not perfect. Sure, you still get use-after-free and manually memory management, which does not hold folks to now race into rewriting stuff in Zig. However it gets you covered on: - proper strings with bounds checking - proper arrays with bounds checking - no pointer decays, you need to be explicit about getting pointers to arrays - less use cases of implicit conversions, requires more typecasts - reference parameters reduce the need of pointers - variant records directly support tags - enumerations are stronger typed without implicit conversions - modules with better control what gets exposed - range types - set types - when using COM like interfaces, reference counting - arenas Sure C++ also covers some of that, that is why I went C++ after Turbo Pascal, but too many folks still use C like idioms instead of improved C++ ones, it is like adopting TypeScript, but still write JavaScript instead. EDIT: typo, missing not
- chadcmulligan 2y agoVery true. If you include FastMM in your project use-after-free is trapped along with other memory errors. I find the allocate / try / finally / free paradigm in Delphi makes things easier, it just becomes a habit. eg var obj := TMyObject.Create try ...do stuff finally obj.free //(or for bonus points freeandnil(obj)) end;
- bawolff 2y agoThe human factor doesn't just come out of nowhere.
- pjmlp 2y agoIndeed, but it definitly matters, and it doesn't always pick the best technology.
- Yoric 2y agoTo complete what you write, the people in the room during the design of Rust were all very much aware of memory-safe languages. Rust was largely designed by putting C++ developers (who were tired of undefined behaviors) and ML developers (who were aware that ML was not great at system programming) in the same room and have them negotiate a language together, in the hope of producing something that would convince C++ developers to migrate to something less risky. I kinda vaguely remember Erlang being mentioned, but I don't recall Ada being discussed. To be fair, I didn't attend many of these conversations.
- adrian_b 2y agoThe Rust designers might have known that other memory-safe programming languages had existed, but certainly they were not familiar with them. Otherwise Rust would not have inherited a ton of obsolete and useless features of C. For example, when I have seen for the first time a "Hello, world" written in Rust, I have been appalled to see that in a language designed in the 3rd millennium one still has to specify whether function parameters are passed by value or by reference, which is the wrong thing to specify about function parameters, exactly like specifying in old C language whether a local variable was "register" or "auto" was the wrong thing to specify. (The right thing to specify about function parameters has been established in 1977, almost a half of century ago, by DoD "IRONMAN", which has been implemented only in a few languages, the most important being Ada. In my opinion, most difficulties and complexities of C++ have been generated by its failure to comply with "IRONMAN".) In my opinion, attempting to design a new programming language without first studying carefully the history of programming languages, in order to know well the many good and bad choices that have already been used in various programming languages and to understand which have been their advantages and disadvantages, is an amateurish approach that cannot result in real progress. Most recent programming languages have been built around some innovative great idea that makes that programming language better than the previous in some respect, e.g. Rust for compile-time checking of memory accesses, but because in the other areas of the language the best previous features have not been chosen, no language is uniformly better than older languages, all of them are better for something than older languages, but worse than older languages for other things, which makes the choice of a programming language very frustrating.
- pdimitar 2y agoI clearly remember sighing deeply back in 2002 realizing I have to introduce yet another array type so my code could compile in Object Pascal. And this is just one example of many. Rust is objectively better than what I tried before, in several ways. From where I was standing several years ago, there was almost zero "human factor" in adopting Rust for many companies (and devs). People simply saw the better features, performance and security and got excited and wanted to work with that language. And then many mistook that for hype. Yourself included apparently? Sometimes things get popular just because they are good, you know. Not super often historically, mind you, but it does happen. IME Rust is one of these outliers.
- pjmlp 2y agoOpen arrays would have been the answer, which I imagine is the point being made.
- pdimitar 2y agoCould be. Back then I didn't have any detailed docs on hand. It also wasn't the point. There was a number of completely unnecessary annoyances. Academics writing compilers actually seemed like a good idea to people back then. Still makes me smile thinking of it sometimes.
- pjmlp 2y agoMost of mainstream compilers are the output of academics work.
- pdimitar 2y agoOnly if you trace the chain of work back to its source, as far as I'm aware -- could be wrong. A lot of modern compilers don't seem to be directly done by academics though. If you know of such modern examples I'd be happy to be proven wrong.
- 2y ago