Hello world with Perl
From Dyna
- This page describes a future feature. We do have SWIG wrappers for an earlier version of Dyna, as proof of principle, but they are out of date.
You don't have to know C++ to write your driver programs. Several other driver languages are or will be supported.
For example, suppose you prefer Perl. Put the following driver script in an
executable file called hello:
#!/usr/bin/perl ... fill this in ...
You still have to compile the Dyna program from the previous section. Use the BLAH BLAH BLAH option to compile it into a form that Perl can use:
dynac [... magic Perl option here ...] hello.dyna
Now running your driver script with ./hello or perl hello will produce the desired output:
$ ./hello hello*world = 42
The Dyna documentation (including ths tutorial) usually assumes that you are writing the driver program in C++. That's because your Dyna program really does compile into C++ classes. Options like BLAH BLAH BLAH simply wrap those classes for use by another language, using SWIG. You may pay a speed penalty for this. See the list of driver languages for more details.
