Some of My Latest Setups

Intro

I recently have been looking at the materials available to do some of the things I've done before, and what I'd like to do in the future, and I stumbled upon the ROOT package, as well as the Tcl/Tk package which I used before. Furthermore I already used the Gnu C(++) compiler with Rhide interface, since I am necessarily limited to PC's and have not even sufficient funding to buy a decent compiler (or have my own system consisting at least of a powerfull PC with Linux..), altough I'm happy to be able to use the PC's where this work is done.

This text is mainly for my own reference (and for anyone interested in the subjects, and is merely a working text with some session histories in it.

Startup for inter-package communication.

First, messages are exchanged between 2 ROOT applications, where the interpreters are used to set up a server and connected socket, and messages can be passed between the two. Notice this works without much trouble (no difficult includes or libs).

A problem arises when using the same methods to talk to a tcl/tk application, because the 'Send' and 'Receive' message method has no specification of its data format (at least not in my version). Inspection of the include files learns that the format is of the straightforward header/data type, and some experimentation showed that the header is 8 bytes, and that the end of string \0 is also sent.

With that in mind, messages can also be sent to a Tcl/Tk shell, effectively coupling the two environments dynamically, since both provide a event loop with possibilities to link one's own functions into them. Seems promising, because the ROOT env encapsultes a lot of interesting material (including the openGL 3d graphics lib), is implemented fairly efficiently (1M integer loops / S on a 100 MHz Pentium is not bad), and seems to have a practically usefull interpreted C++ interface.

Making the link work more generally allows for the combination of a quite powerfull env like Root with industry standard Tcl/Tk. (Which may hardly be needed at all, except for its compactness and general availability (even as Netscape plugin). Then again, Tk has a lot more facils at this moment than ROOT has, and some of them are definately more easy to use, but its steep competition in other areas. One of the things done in Root's demos is the combination of 3D graphics (even goureaud shaded polys) and 2D annotation in one window, which are challenging to build a 3D editor either for 3D scenes in general or for 3D programming environment (i.e. graphical programming with 3D elements (mixed with 2D)).

Just one major annoyance: WHY DOES ROOT COREDUMP (if that would exist on windows95) FOR MANY TINY ERRORS (like data mismatches), AND WHY DOES IT VERY REGULARLY INDICATE A 'DEADLOCK' AND NOT SOLVE IT INSTEAD OF JUST QUITTING??

And it should have proper documentation, a windows specific help like tcltk has would be great, but a 'rhide' or gnu type 'info' would do fine. In fact. I'd settle for *any* exhaustive documentation which does not require me to reverse engineer the sources or browse through .h files. Maybe I have the wrong version.

Since I have nbo funds I wonder if PD Gnu C(++) would be able to create shared libs which can be used by ROOT? Or if otherwise I could use it's output together with Root (apart from subprocesses). It seems there are some socket kits out there, will see. Its a bummer to be out of Unix, but then again .3 of the performance of a HP735/99 is not that bad at all.

Histories (Root and Tcl/Tk)

Just for future reference if I forget what I prepared:

Window 1 dump (ROOT)




CINT/ROOT C/C++ Interpreter version 5.13.30, Oct 25 1997
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Welcome to the ROOT tutorials


Type ".x demos.C" to get a toolbar from which to execute the demos

Type ".x demoshelp.C" to see the help window

root [0] TServerSocket *s = new TServerSocket(179, kTRUE);
root [1] TSocket *s1 = s->accept();
Error: Can't call TServerSocket::accept() in current scope FILE:C:\WINDOWS\TEMP\
6 LINE:1
Error: No symbol s->accept() in current scope FILE:C:\WINDOWS\TEMP\6 LINE:1
root [2] TSocket *s1 = s->Accept();
root [3] s1->Send("dsaasf\n");
root [4] s1->Send("dsaasf\n");
root [5] s1->Close();
root [6] TSocket *s1 = s->Accept();
root [7] s1->Close();
root [8] TSocket *s1 = s->Accept();
root [9] s1->Send("dsaasf\n");
root [10]



Window 2 dump (ROOT)




CINT/ROOT C/C++ Interpreter version 5.13.30, Oct 25 1997
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Welcome to the ROOT tutorials


Type ".x demos.C" to get a toolbar from which to execute the demos

Type ".x demoshelp.C" to see the help window

root [0] TServerSocket *s = new TServerSocket(179, kTRUE);
root [1] TSocket *s1 = s->accept();
Error: Can't call TServerSocket::accept() in current scope FILE:C:\WINDOWS\TEMP\
6 LINE:1
Error: No symbol s->accept() in current scope FILE:C:\WINDOWS\TEMP\6 LINE:1
root [2] TSocket *s1 = s->Accept();
root [3] s1->Send("dsaasf\n");
root [4] s1->Send("dsaasf\n");
root [5] s1->Close();
root [6] TSocket *s1 = s->Accept();
root [7] s1->Close();
root [8] TSocket *s1 = s->Accept();
root [9] s1->Send("dsaasf\n");
root [10]


window 3 dump (Tcl/Tk)



% set s [socket localhost 179]
% fileevent $s readable
...

% set h [read $s 8]; set m [gets $s] ; read $s 1
% puts $m
hello!fgsdgfd fd sfd d
% puts [string length $h]
8
%