Deutsch English Français Italiano |
<vb91e7$3o797$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: not-for-mail From: Terje Mathisen <terje.mathisen@tmsw.no> Newsgroups: comp.arch Subject: Re: Computer architects leaving Intel... Date: Wed, 4 Sep 2024 09:15:19 +0200 Organization: A noiseless patient Spider Lines: 103 Message-Id: <vb91e7$3o797$1@dont-email.me> References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <memo.20240830164247.19028y@jgd.cix.co.uk> <vasruo$id3b$1@dont-email.me> <2024Aug30.195831@mips.complang.tuwien.ac.at> <vat5ap$jthk$2@dont-email.me> <vaunhb$vckc$1@dont-email.me> <vautmu$vr5r$1@dont-email.me> <2024Aug31.170347@mips.complang.tuwien.ac.at> <vavpnh$13tj0$2@dont-email.me> <vb00c2$150ia$1@dont-email.me> <505954890d8461c1f4082b1beecd453c@www.novabbs.org> <vb0kh2$12ukk$1@dont-email.me> <vb3smg$1ta6s$1@dont-email.me> <vb4q5o$12ukk$3@dont-email.me> <vb6a16$38aj5$1@dont-email.me> <vb7evj$12ukk$4@dont-email.me> <vb8587$3gq7e$1@dont-email.me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Date: Wed, 04 Sep 2024 09:15:20 +0200 (CEST) Injection-Info: dont-email.me; posting-host="606cd5cacbb278ca156ab821d74f9569"; logging-data="3939623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KJ5ig7Q2Htnnl/nkbODPrHF181WSB7Ru7kxe4o8rfxg==" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2 Cancel-Lock: sha1:vMEEjCxVS8w5QvOYuIBPbhyjQMs= In-Reply-To: <vb8587$3gq7e$1@dont-email.me> David Brown wrote: > On 03/09/2024 18:54, Stephen Fuld wrote: >> On 9/2/2024 11:23 PM, David Brown wrote: >>> On 02/09/2024 18:46, Stephen Fuld wrote: >>>> On 9/2/2024 1:23 AM, Terje Mathisen wrote: >=20 >>>>> Anyway, that is all mostly moot since I'm using Rust for this kind = >>>>> of programming now. :-) >>>> >>>> Can you talk about the advantages and disadvantages of Rust versus C= ? >>>> >>> >>> And also for Rust versus C++ ? >> >> I asked about C versus Rust as Terje explicitly mentioned those two=20 >> languages, but you make a good point in general. >> >=20 > I want to know about both :-) >=20 > In my field, small-systems embedded development, C has been dominant fo= r=20 > a long time, but C++ use is increasing.=C2=A0 Most of my new stuff in r= ecent=20 > times has been C++.=C2=A0 There are some in the field who are trying ou= t=20 > Rust, so I need to look into it myself - either because it is a better = > choice than C++, or because customers might want it. >=20 >=20 >> >>> My impression - based on hearsay for Rust as I have no experience -=20 >>> is that the key point of Rust is memory "safety".=C3=82=C2=A0 I use=20 >>> scare-quotes here, since it is simply about correct use of dynamic=20 >>> memory and buffers. >> >> I agree that memory safety is the key point, although I gather that it= =20 >> has other features that many programmers like. >> >=20 > Sure.=C2=A0 There are certainly plenty of things that I think are a bet= ter=20 > idea in a modern programming language and that make it a good step up=20 > compared to C.=C2=A0 My key interest is in comparison to C++ - it is a = step=20 > up in some ways, a step down in others, and a step sideways in many=20 > features.=C2=A0 But is it overall up or down, for /my/ uses? >=20 > Examples of things that I think are good in Rust are making variables=20 > immutable by default and pattern matching.=C2=A0 Steps down include lac= k of=20 > function overloading and limited object oriented support. >=20 > There are some things that some people really like about Rust, that I a= m=20 > far from convinced about - such as package management.=C2=A0 I could be= =20 > misunderstanding (since I don't have the experience), but for /my/ work= ,=20 > I am very much against anything that encourages an "always get the=20 > latest version" attitude.=C2=A0 Stability is much more important to me.= =C2=A0 (I=20 > dislike the rate at which Rust changes - every two weeks or so for smal= l=20 > things, and every couple of years for breaking changes.) That's yet another of the things cargo (the rust package manager, as=20 well as lots of other stuff) get right: Yes, by default you'll pick up the latest of every package/module you=20 "cargo add foo" to your project, but then you can edit the resulting=20 text-format configuration file, and lock down exact versions of some or=20 all of those packages. This is similar to how we always freeze python packages: Any changes are = something we decide to employ. >=20 > And there are some things that Rust simply gets wrong - such as the=20 > handling of signed integer overflows. Maybe? Rust will _always_ check for such overflow in debug builds, then when=20 you've determined that they don't occur, the release build falls back=20 standard CPU behavior, i.e. wrapping around with no panics. You can argue both pro and con here, personally I like the Rust setup=20 much more than C(++) which will use code that could do so as an excuse=20 to elide that as well as all surrounding/dependent code. Terje --=20 - <Terje.Mathisen at tmsw.no> "almost all programming can be viewed as an exercise in caching"