Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Also about Software reliability

7 views
Skip to first unread message

Sky89

unread,
May 18, 2018, 9:05:29 PM5/18/18
to
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.



0 new messages