today we were discussing different spacecraft accidents caused by/related to software, discussed Arian-5 case, and I remembered a Soviet case, where there was a problem with decimal separator and Fortran compiler. Decimal separator in USSR was comma, but in Fortran code it should be the dot.

Also, Fortran compiler did not consider using comma instead of the dot as an error, but as different code. And my friend said - the same is possible to do in C++ - and sent me the illustration.

#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
if (1,2!=1.2)
{
cout << (1,2) << endl;
}
return 0;
}

if you run it, you’ll get

Hello World
2

(:

#safety #programming #mistakes #safe #c++ #code #example #programming-languages #programming_languages #arian #fortran #source

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

I think, that GPLv3 is a license for which there came historical necessity.

Some people do not want their code to be used to lock devices. These people need a corresponding license.

And, I think that there is a historical necessity for the license, which does not allow to use the software by/for dictatorships/authoritarian regimes.

Because there might be someone who do not want let’s say his software to be used in order to prepare lists of political prisoners. I would not want to help even a soft regime.

The question which comes, then, who/how to decide which regime is authoritarian, which is dictatorship. Should the license contain direct pointers to the number of countries, or to refer to other organization’s assessments.

#software #free_software #open_sourge #gpl #license #code #regime #dictatorship #freedom

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

very interesting resource for those who are interested in compilers: http://turbopascal.org/turbo-pascal-internals

#internals #compiler #source #code #programming #compilers #pascal #turbo_pascal #book #analysis #reverse_engineering #research

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

discussing go, one says:

why this func incTwo(a, b int) (c, d int) not (int c, d) incTwo(int a, b);

and why var v2 string not var string v2;

answer: >because compare

int (*(*fp)(int (*)(int, int), int))(int, int) and f func(func(int,int) int, int) func(int, int) int

#go #syntax #grammar #programming #programming_languages #code #notation

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)