Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #4291 > unrolled thread

Also about Software reliability

Started bySky89 <Sky89@sky68.com>
First post2018-05-18 21:06 -0400
Last post2018-05-18 21:06 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.programming.threads


Contents

  Also about Software reliability Sky89 <Sky89@sky68.com> - 2018-05-18 21:06 -0400

#4291 — Also about Software reliability

FromSky89 <Sky89@sky68.com>
Date2018-05-18 21:06 -0400
SubjectAlso about Software reliability
Message-ID<pdntar$u7u$5@dont-email.me>
Hello..


I wrote before this:

Also read this about Software reliability:

"Both Rust and Spark languages implement a number of static and dynamic
checks directly in the language definition. For example, they implement
strict-type safety; that is, objects can’t be implicitly converted from
one type to the next. The following doesn’t compile in SPARK"


Read more here:

http://www.electronicdesign.com/industrial/rust-and-spark-software-reliability-everyone


I think C++Builder has a good implementation of variants that allows
you to "emulate" much better strict-type safety of Rust and Spark,
i have looked to Boost variants and i think it is less powerful
than the one in C++Builder, here is how you have to extend
type-safety, you realize this solution with objects that contains 
variants that represent different types and the functions that work with 
them like Add and Multiply and Divide etc, here is the solution
for FreePascal and Delphi and C++Builder and you can extend
it, so i think FreePascal and Delphi and C++Builder are now acceptable 
for more reliability:

-- 

program test;

uses VARIANTS,SYSUTILS;

var f:double;
      a:integer;



FUNCTION ASSIGN(a,B:VARIANT):VARIANT;

begin

IF VARTYPE(A)=VARTYPE(B) THEN
BEGIN
A:=B;
RESULT:=A;
END
ELSE RAISE EXCEPTION.CREATE('ASSIGNEMENT NOT OK');


end;

begin

a:=2;

f:=a;

A:=ASSIGN(F,A);


end.
-- 


Here is the Vartype function:

http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Variants_VarType.html




Thank you,
Amine Moulay Ramdane.


[toc] | [standalone]


Back to top | Article view | comp.programming.threads


csiph-web