Saturday 22 January 2011

Ada and UTF-8 literals

To my delighted astonishment, I found the following code quite legal in Ada05:
pragma Wide_Character_Encoding(UTF8);
with Ada.Text_IO, Ada.Integer_Text_IO;
procedure Read_Write_Loop is
    use Ada.Text_IO, Ada.Integer_Text_IO;
    β : String(1..40);
    N : Integer;
begin
    Put("> ");
    loop
        Get_Line(β,N);
    exit when β(1..N) = "quit";
        Put("Command: '" & β(1..N) & "'");
        Put(" ("); Put(β'Length,2); Put_Line(")");
        Put("> ");
    end loop;
    Put_Line("Bye");
end;
"Ridiculous", the most programmers use to say, one can write beta in Java/C# (which by the way is the most phantastiqual language ever constructed by the most intelligent godlike gurus, yada yada yada ...). Very nice when encoding mathematical formulae in Ada.

The above code works in GNAT if the data is stored in a file read_write_loop.adb and compiled with
gnat make read_write_loop
Other perceived advantages of using Ada for numeric parts of the sternons project are:
  1. Ada is available wherever gcc is
  2. The Ada programmer have a detailed control over data precision f.ex. being able to declare long reals by type My_Float is digits 12;

Monday 17 January 2011

R101: License change

R101: just a license change in the code from GNU LGPL to GNU GPL. The reason was easier code pilfering from other projects, of which the vast majority is GPL. Now, Microsoft's CEO Steve Ballmer also consider my code "a cancer", which is maybe honorable coming from him, and "viral" according to Craig Mundie, also Microsoft. Microsoft is nice, nice doggie, do not bark on bearded men with turban!

Sunday 16 January 2011

R100 (new year revision)

R100 occured after some time of vacation from the project. My dive into program parsing made me get some intuitive plan in my head for in what direction the project is going to be developed, but I believe the mkmap program syntax needs some heavy revision after I've rehacked the main non-program-parsing code in accord with my vague intuitions. That's the life with theory and praxis: back and forth, nilly-willy over the border of the true and the functioning.