Liste des Groupes | Revenir à c arch |
On 9/3/2024 8:46 AM, Terje Mathisen wrote:Possibly because, due to the way I've been writing C(++) code for the last 40 years, I have almost never been hit by those problems myself?
> Stephen Fuld wrote:
>> On 9/2/2024 1:23 AM, Terje Mathisen wrote:
>>> Stephen Fuld wrote:
>>>> On 8/31/2024 2:14 PM, MitchAlsup1 wrote:
>>>>> On Sat, 31 Aug 2024 21:01:54 +0000, Bernd Linsel wrote:
>>>>>> You compare apples and peaches. Technical specifications for your
>>>>>> pressure vessel result from the physical abilities of the chosen
>>>>>> material, by keeping requirements as vessel border width, geometry
>>>>>> etc.,
>>>>>> while compiler writers are free in their search for optimization
>>>>>> tricks
>>>>>> that let them shine at SPEC benchmarks.
>>>>>
>>>>> A pressure vessel may actually be able to contain 2Ã the
>>>>> pressure it
>>>>> will be able to contain 20 after 20 years of service due to stress
>>>>> and strain acting on the base materials.
>>>>>
>>>>> Then there are 3 kinds of metals {grey, white, yellow} with different
>>>>> responses to stress and induced strain. There is no analogy in code--
>>>>> If there were perhaps we would have better code today...
>>>>
>>>> Perhaps an analogy is code written in assembler, versus coed written
>>>> in C versus code written in something like Ada or Rust. Backing
>>>> away now . . . :-)
>>>
>>> IMNSHO, code written in asm is generally more safe than code written
>>> in C, because the author knows exactly what each line of code is
>>> going to do.
>>>
>>> The problem is of course that it is harder to get 10x lines of
>>> correct asm than to get 1x lines of correct C.
>>>
>>> BTW, I am also solidly in the grey hair group here, writing C code
>>> that is very low-level, using explicit local variables for any loop
>>> invariant, copying other stuff into temp vars in order to make it
>>> really obvious that they cannot alias any globals or input/output
>>> parameters.
>>>
>>> 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?
>
> Q&D programming is still far faster for me in C, but using Rust I don't
> have to worry about how well the compiler will be able to optimize my
> code, it is pretty much always close to speed of light since the entire
> aliasing issue goes away.
>
> Rust also gets rid of the horrible external library/configure/cmake mess
> that kept me from successfully compiling the reference LAStools lidar
> code for nearly 10 years.
>
> Using the Rust port I just tell cargo to add it to my project and that's
> it.
Thank you. I find it interesting that the main advantage of Rust as touted by its evangelists, memory safety, didn't make your list.
Les messages affichés proviennent d'usenet.