This is what the “Hello World” program looks like in Tonto
program run_HELLO_WORLD implicit none ! Macro to create Tonto system object ! Start MPI-parallel stuff too (if needed) TONTO_CREATE ! Start timer std_time.start_timing ! Initialise standard I/O. stdout.create_stdout stdout.open ! Do it stdout.text(“Hello World”) ! Memory report TONTO_REPORT ! Clean-up files stdout.destroy ! Clean-up tonto system TONTO_DESTROY end
To compile the program type
Now, if this seems like a lot of work to print out “Hello World” remember that the Tonto library is fully self contained: there are no external libraries or dependencies, there are no hidden operations or code.
Other points to note:
The program name includes a
run_prefix before the name
HELLO_WORLDall in capitals. This is requied.
Comments appear after an exclamation mark. (Note: The highlighting of code within comments, and in the code is not always correct because I use the ruby language highlighter for the moment).
There is a lot of “set up” and “clean up” which occurs, controlled via macro commands such as
TONTO_DESTROYrespectively. These are required.
The code uses standard dot notation to pass messages to objects e.g. the
“Hello World”is passed to the the
TONTO_REPORTproduces optional timing, memory use, or call stack backtrace — if compiled with special switches.
If this seems annoying, remember that Tonto is self-contained and nothing is hidden or farmed off to libraries.
You can explicitly clean-up objects via
stdout.destroybut you don’t have to. It may help in places where you want high efficiency.