Turk/2 Compiler Usage Instructions


This is my current version of the Turkish Demitasse (Turk/2 or T2) language as used in all my new programming projects. The language is specified by the Turk2C grammar, which when given to my TAG compiler, generates C code. This can then be compiled in a standard C compiler to produce yet another compiler which compiles Turk/2 code into C++ code. That output, combined with System and Framework code can be compiled in a C++ compiler to produce a program that runs, for example, in a Win32 system. Sorry, no Linux nor unix versions of the full Framework code are available, because there is no standard graphical user interface (GUI) for those systems, but I have a stripped-down (no GUI) version that should run in any system that supports standard C. The optional System is compiled from T2 code; the Framework is partly compiled T2 and partly hand-crafted C++ code. The output from Turk2C is massaged by another T2 program, FixT2C, which is able to merge multiple source compiles into a single threaded Win32. This is the tool set I use for compiling BibleTrans.

Another version of the same T2 grammar, Turk68 compiles to a text representation of 68000 machine code, which a HyperCard stack based on my program generator Double-XX turns into executable application code. I included here the source code for FixT2C as a sample, plus the HyperCard stack to build the program (it won't run without HyperCard and Double-XX), and the resulting program. The stack is easily modified to build other programs in the same manner. None of this works on anything that doesn't support MacOS/68K code. This is what I use for my local software development, because it tends to run much faster in emulation on my 400MHz PowerPC G3 Mac than the compiled C++ code runs native on a 2GHz PC. Go figure. My 68K version also does better process management than the compiled C on my Mac (which tends to lock up the computer for the duration). Maybe some day I will fix that, or maybe it will become unnecessary when I move everything to a Wintel computer with a more usable system and better system security than currently offered by Windows or Linux or OSX.

Both versions of the Turk/2 compiler expect to read their own version of a Libry.txt file for precompiled system code. This is in two parts, but only the first part is read by the compiler. When recompiling the library from SysLib.t2, the first part (down to the blank line) should be deleted; it is then replaced from the compiled output for subsequent compiles that import System.

The Turk/2 language is still under development. I hope to add full class support at some future date. In the meanwhile there is no good way to send callbacks to another function. Sorry about that. Really.
 

Links:

The latest copy of the TAG compiler, with notes on how to use it.

A discussion of the Turkish Demitasse language design.

The current version of Turk2C.tag with its compiled Turk2C.cpp and library code TagLib.c (same as used in the TAG compiler, except this one is slightly newer), in a ZIP file.

The current version of Turk68.tag, with its compiled Turk68 program and the HyperCard stack to build a particular application, in a self-extracting archive converted to "BinHex" text. You need a PowerPC or older Mac and HyperCard to be able to use this.

Downloadable copies of CompileIt and Double-XX on my website.


Tom Pittman
2010 January 16