Compiling TAD to code
This is a unique feature of TAD. You can now export the entire TAD model, including the ARDELA quick-code (one set in the UI information pane) that your model has into the source code (or binary library) of several computer languages.
This is quite a breakthrough. Now people need not be restricted into using the internal Prolog based scripting language of ARDELA to extend the use of TAD. All you need to do is to just export TAD into the source code of the language of your choice.
The magic of Haxe
This powerful facility is powered by the open-source project called Haxe. The author of TAD, Sabu Francis, has been an active follower of the Haxe project for years – and all that experience helped in providing this feature. With release 4.1.2 of Haxe, that project has matured a lot in order to be used inside TAD.
From version 6.8 TAD now has the capability to internally parse the TAD model and export that as Haxe source code.
Important: Export permission token
To use this export to code feature in TAD, you would have to get a special token that needs to be pasted into this dialog. The why and what of this permission token is explained in a separate topic.
Export to Haxe and other languages
If you want to export your TAD model to Haxe; then it is done in a jiffy. using this Export to code feature. If your only intention was to produce Haxe code, then TAD does not require you to use or install Haxe in your computer. This option is very useful if you are yourself not a software developer but you want to give the model for additional work to be done on your model in Haxe.
TAD does not come bundled with Haxe. That project is a separate open-source project with its own license. You should read its conditions and install if you are satisfied. As of 27th June 2020 haxe is a free, open-source software; but if you are reading this later you should verify their license conditions. TAD is not connected with the Haxe project.
We are now keeping a close watch on the development of the Haxe project and future versions of TAD would take advantages of new features of Haxe too. We are also considering other languages that Haxe does not support; and we may give source-code generation of those languages too. But let me not get ahead of myself.
The export to code feature of TAD was extensively tested on Haxe 4.1.2
A caveat: We found the 32 bit Windows version of Haxe a lot more stable than the 64 bit. Once you install Haxe, it comes with a package manager called haxelib – you would need to use that and install some additional libraries used by Haxe. Follow their documentation for details.
By default, when TAD exports code – it does it in such a way that it creates a “main function” and so you can directly make standalone applications that would work inside your computer. This main function that is bundled into TAD currently does a simple output: It traces out the areas of two objects. You can modify the main function by carefully editing the file tadextra.haxe.txt which is in the bin folder of the TAD installation.
Once you invoke this Export to code feature;l try creating a standalone executable binary by making it export to a C++ source+binary. You would need at least the Microsoft Visual Studio Express edition (which is free) installed on your computer to produce the binary executable. Without Microsoft Visual Studio Express (or the full version) only the C++ source code is generated. It is needed even for C# (CSharp) code.
Note that the Haxe output need not have any “main()” routine. We happen to give one for demo purpose – so that you know that TAD indeed can generate the final executable. But you can chose to ignore it./ In such a case you can export your TAD model to a library– and not compile it into a standalone executable.
You or a software developer you employ can write such a main function externally and use the library produced using our Export to code facility and you should be able to get a very rich application.
What is a library?
Note that the concept of a library varies from language to language. In some cases it is a ..dll file. In some other case it would be a .lib file which needs to be linked to other code. In case of interpreted languages; the library simply means that the exported code does not have any active main function; or even if it was there, it was not called.
For example; you could export the TAD model into PHP and then upload that generated PHP to a web server. That PHP is picked up by other parts of the PHP code which can process the TAD model; and give you some rich application that is seen right inside a browser.
Effectively, anyone with coding skills in any of the supported export language can now write additional code in their language. Designers can export TAD into that language and get married to such additional code. This would result in practically anyone developing additional software based around TAD
We are developing language specific help pages and more richer documentation of all this. This specialized documentation would be available for a nominal cost to those software developers who want to develop applications on top of TAD.
Keep this page bookmarked for further changes!
Press F1 inside the application to read context-sensitive help directly in the application itself