The FTC System

 

Background

The aim behind FTC is to introduce programmers into the world of C, a language that appears to cause problems with first time users. The C language was chosen because of its acceptance in the marketplace and it's consequent value to programmers. As there are many reasons why programmers have difficulty adapting, this project will attempt to re-dress many of them.

 

The Customer

Technically speaking the customer in this case is the Department of Computer Studies (effectively the makers - Dr. R.G. Stone and Dr. A. Benson). However, the project is aimed at a wider audience and directed towards those of a moderate programmer, but with little or no knowledge of the C language. They will all, however, come from various programming backgrounds, and differing machine environments. To this end, all code must be portable, ensuring a larger audience.

 

Description

The problems encountered by programmers when coming to a new language are many and varied, listed below are what I feel are the major contributing factors.

Structural layout

Commands Syntax

Differing error messages

Grammar, Syntax

Data structures

Lack of run-time checks

The C pre-processor

 

Structure

The basic idea is that the project will involve a series of stepping stones, each one dedicated to making the transition into C easier, by providing something that the programmer can relate to. This common link will give them an 'emotional cushion' to fall onto when things do not work. The project is thus split into three main areas. They are,

1. A language toolkit.

This will be the first step the user takes into the world of C. It should mimic various commands from another high level language giving the user of sense of security by providing situations that they have seen before, and can cope with.

A high level language will be chosen, and a C include file will be created. This will contain 'macros' (textual substations) and 'functions' (small sections of program code) that appear to have come from the foreign language. This should also take much of the confusion out of the pre-processor, as it will automatically include those files necessary to run the basic features of the language.

2. A C compiler.

This, apart from being the main bulk of the project, will be an enhancement on many C compiler's by providing fuller warnings on many features of the language not normally mentioned, i.e. This variable has been declared at the local and global levels.

To ensure portability, this compiler produces pseudo-assembly that will run on another program called the 'Emulator'. Source code will be supplied for both pieces of software. The user's own system will then be compile it.

Because of the project time-span, a complete implementation for C is unrealistic, so a smaller subset of C has been produced, containing the simpler, more fundamental blocks of the language - like arrays - while retaining a complete set of control structures, if-then's, switches and so forth.

3. The C-to-C compiler.

The title is perhaps misleading, as this section of project is really an extension to the compiler. It will add sections of assembly code to the compiled code that prevent errors that occur at run-time, for instance, the over-running of arrays. The compiler could run on a real processor (like the 680x0, or 80x86) wilth a simple alteration.????Does fit in here???

Language

C and C++ are favoured for their portability; as this is very important. The end user will require a compiler to build the program in the first instance, and of the above languages, C has a better base for building on, with many good free C compilers like GCC and DICE available. This, combined with the availability of compiling tools (such a YACC and LEX) that work under C environment, it seemed that this would be the best move to take.

Environment

Because of the portability of C there is little restriction on my choice of environment. However, the previously mentioned tools - YACC and LEX - will probably be used. As these are available as part of the UNIXÒ system installed on the HP's the majority of the work was done under UNIX, with additional work performed during the Christmas Vacation on an Amiga 500 with DICE.