|Developing and running OmniMark programs|
OmniMark is a compiled language. OmniMark source code is compiled into byte code which is executed by the OmniMark virtual machine. The OmniMark virtual machine is available in three forms:
The OmniMark compiler is also available in three forms:
OmniMark IDE and OmniMark C can create compiled OmniMark byte code files. These have the extension ".xvc". OmniMark ".xvc" files are platform specific: they must be executed on the platform on which they were compiled.
OmniMark C/VM cannot produce ".xvc" files. It compiles and executes OmniMark source files (".xom") on the fly. OmniMark source files are generally portable across all supported operating systems, unless the program makes operating-system-specific calls or relies on operating-system-specific behavior.
There is little performance difference between executing an ".xvc" file with OmniMark VM and executing a ".xom" file with OmniMark IDE or OmniMark C/VM. There are three advantages to compiling to an ".xvc" file and executing using OmniMark VM:
Developing OmniMark applications
You can write OmniMark programs in the IDE or in a text editor. See the IDE documentation (under the IDE Help menu) for details. The IDE provides a full suite of editing and debugging tools including:
The command line
Most programming languages simply give you access to the values on the command line used to launch your application. In OmniMark, a great deal of command-line functionality is predefined by OmniMark. Files named on the command line are automatically bound to the application's main input stream. You can specify one or more default input files on the command line. You can set the initial values of global variables, and perform a number of other useful functions. You can also access values from the command line in the conventional manner using
OmniMark's command-line options are supported by OmniMark C/VM and VM. In the IDE, the same options are set through a dialog box.
OmniMark also supports argument files. An argument file is a text file with one OmniMark command-line option or command-line item per line. The "-f" command-line option, followed by the file name of an argument file, causes OmniMark to read the items in the argument file as if they were on the command line. OmniMark argument files use an ".xar" file extension.
Compiling OmniMark programs
To learn how to compile a program in the IDE, consult the IDE online help.
To compile a program with OmniMark C, use the following command line (where your OmniMark source code file is "myprog.xom" and the compiled program to be created is "myprog.xvc"):
omnic -s myprog.xom -save myprog.xvc
Running OmniMark programs
To learn how to run OmniMark source (".xom") files in the IDE, consult the IDE online help. (You cannot run compiled ".xvc" files from the IDE.)
To run OmniMark source files using OmniMark C/VM, use the following command line:
omnimark -s myprog.xom
The "-s" parameter identifies the OmniMark source file. You can also include any command-line items or OmniMark command-line options appropriate to the program being run.
To run compiled OmniMark programs using OmniMark VM, use the following command line:
omnivm -load myprog.xvc
The "-load" parameter identifies the OmniMark program file. You can also include any command-line items or OmniMark command-line options appropriate to the program you are running.
You can also run a program using an argument file. The argument file should contain the "-s" or "-load" option, depending on whether you are using C/VM or VM. It should also include whatever other command-line items or OmniMark command-line options are required. The command lines for using an argument file with C/VM and C respectively are:
omnimark -f myargs.xar omnivm -f myprog.xar
You can also run a program using an IDE project file (.xop) as an argument file. The command lines for using a project file with C/VM and C, respectively, are:
omnimark -f myargs.xop omnivm -f myprog.xop
Note that while you can run your programs in the IDE, programs run significantly more slowly in the IDE than they do when run with OmniMark VM or C/VM. The debugging information maintained by the IDE imposes a significant performance penalty. You should use the IDE as a development environment, but run production programs on the command line for maximum performance.
External function libraries and include files
If you are running an OmniMark source code application, OmniMark needs to know where to find any include files and external function libraries used by your program. If you are running a compiled OmniMark application, OmniMark needs to know where to find any external function libraries used by your program.
When you install OmniMark on Windows, the installer records in the Windows registry the location of the external function libraries and OmniMark include files supplied with OmniMark. OmniMark can find these automatically.
If you install external function libraries and include files in other directories, you can set these directories as external function library and include file directories in the IDE, and it will record them in the registry.
If you install VM or C/VM on a Windows system on which the IDE is not installed, and you need to install external function libraries and include files in directories other than the defaults, you can do one of the following:
If you install OmniMark on a UNIX system, external function library and include file directories are not detected by default. You can do one of the following:
On all platforms, the environment variables are:
Under UNIX, paths should be separated by a colon (":"). For example:
OMNIMARK_INCLUDE = /bin/omnimark/xin:/bin/mystuff/xin
Under Windows, paths should be separated by a semicolon (";"). For example:
OMNIMARK_XFLPATH = "C:/Program Files/OmniMark/lib";"d:/bin/mystuff/lib"
The Windows registry entries are found under the key:
For include paths, there is one entry specifying the number of paths and then one entry for each path. The entry specifying the number of paths is:
The entry specifying the first path is:
and the other paths are "Item1", Item2", and so on, up to the value of Count - 1.
For external function library paths, there is one entry specifying the number of paths and then one entry for each path. The entry specifying the number of paths is:
The entry specifying the first path is:
and the other paths are "Item1", "Item2", and so on, up to the value of Count - 1.
When searching for include files or external function libraries, OmniMark searches in the following order:
You can force OmniMark not to search the environment or registry paths with the
-noea command-line option.
Compelling design considerations sometimes make it necessary for us to change the language in a way that is not backward compatible with all existing programs. We've listed all such changes made since OmniMark 2.0, along with suggestions for making such programs work with the current version of OmniMark.
Distributing your OmniMark programs
You can distribute your OmniMark programs either as OmniMark source files (".xom") or compiled programs (".xvc"). See your licence agreement for information on which OmniMark-supplied files may be redistributed with your programs.
Platforms and Operating Systems Supported
OmniMark runs on a wide range of platforms. For a complete list of platforms, see Platforms: operating system requirements.
Copyright © OmniMark Technologies Corporation, 1988-2000.