Re:The Dark Arts of Advanced and Unsafe Rust Programming
by habitue on Friday August 24, 2018 @03:23PM
(#17837241)
> Rust is nothing but a slapdash C style copy of its semantics.
Rust is a copy of Ada's semantics for dealing with memory unsafe code? Could you provide an example of what you mean?
> Ada does, and has better and more clear conventions for "unsafe" programming (pointer arithmetic, conversions, etc)
Can you give some examples here of what you mean? I found Interfaces.C.Pointers, but I don't know enough about the language to know if that's what you were talking about
Re:The Dark Arts of Advanced and Unsafe Rust Programming
by exitcode00 on Friday August 24, 2018 @11:52PM
(#17839430)
I meant Rust is a copy of Ada in general - it does not deal with unsafe programming in the same way. Instead, you do things like instantiate generic packages/procedure like Ada.Unchecked_Deallocation and Ada.Unchecked_Conversion with the specific conversion or heap deallocation procedure you need. So you are forced to be explicit about every unsafe operation by including such procedures and calling such things - but you are not prone to accidents because you got in the habit of wrapping things in perverse "unsafe" blocks every time you meet a well-thought-out restriction of the language.
Re:The Dark Arts of Advanced and Unsafe Rust Programming
by Tuna-Fish on Saturday August 25, 2018 @04:18AM
(#17840084)
> I meant Rust is a copy of Ada in general
Have you ever actually looked at rust? The headline feature of Rust is linear types with checked borrowing, something that Ada does not provide.
Re:The Dark Arts of Advanced and Unsafe Rust Programming
by hunt on Saturday August 25, 2018 @07:40AM
(#17840458)
Plus Ada has a complicated runtime system that Rust doesn't.
Re:The Dark Arts of Advanced and Unsafe Rust Programming
by exitcode00 on Sunday August 26, 2018 @08:35AM
(#17845665)
Example?
Rust is nothing but a slapdash C style copy of its semantics.