Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • README

    r6244dfb r51b73452  
    22======================================
    33
    4 This is a PRE-RELEASE version of cfa-cc.  It exists solely for the purpose of
    5 private experimentation and scholarly research.  The authors disclaim all
    6 responsibility for the consequences of any malfunction of the software,
    7 including the malfunction of any programs compiled using the software.
     4This is a PRE-RELEASE version of cfa-cc.  It exists solely for the
     5purpose of private experimentation and scholarly research.  The authors
     6disclaim all responsibility for the consequences of any malfunction of
     7the software, including the malfunction of any programs compiled using
     8the software.
    89
    910What is Cforall?
    1011----------------
    11 Cforall is a language design extending ISO C. The purpose of the project is to
    12 engineer modern language features into C in an evolutionary rather than
    13 revolutionary way. Java is an example of the revolutionary approach of
    14 modernizing C/C++, resulting in a new language rather than an extension of its
    15 descendents. C++, Fortran 95 and Cobol 9X are examples of the evolutionary
    16 approach where modern language features are added and problems fixed within the
    17 framework of an existing language.
     12Cforall is a language design extending ISO C. The purpose of the
     13project is to engineer modern language features into C in an
     14evolutionary rather than revolutionary way. Java is an example of the
     15revolutionary approach of modernizing C/C++, resulting in a new
     16language rather than an extension of its descendents. C++, Fortran 95
     17and Cobol 9X are examples of the evolutionary approach where modern
     18language features are added and problems fixed within the framework of
     19an existing language.
    1820
    19 The goal of this project is to produce a largely backwards compatible version
    20 of C containing many modern language features and fixing some of the well known
    21 C problems. Without continued development of the language, C will be unable to
    22 cope with the needs of modern programming problems and programmers; as a
    23 result, it will fade into disuse.  Considering the large body of existing C
    24 code and programmers, there is a significant impetus to ensure C is transformed
    25 into a modern programming language.
     21The goal of this project is to produce a largely backwards compatible
     22version of C containing many modern language features and fixing some
     23of the well known C problems. Without continued development of the
     24language, C will be unable to cope with the needs of modern programming
     25problems and programmers; as a result, it will fade into disuse.
     26Considering the large body of existing C code and programmers, there is
     27a significant impetus to ensure C is transformed into a modern
     28programming language.
    2629
    2730What is cfa-cc?
    2831---------------
    29 cfa-cc is a collection of programs centred around a translator that takes
    30 Cforall code as input and outputs corresponding C code.  This is complemented
    31 by a compiler driver in the style of "gcc", which handles preprocessing,
    32 compiling, assembling, and linking and invokes the translator at appropriate
    33 moments.
     32cfa-cc is a collection of programs centred around a translator that
     33takes Cforall code as input and outputs corresponding C code.  This
     34is complemented by a compiler driver in the style of "gcc", which
     35handles preprocessing, compiling, assembling, and linking and invokes
     36the translator at appropriate moments.
    3437
    3538What is required in order to use cfa-cc?
    3639----------------------------------------
    37 Building cfa-cc requires GNU Make and gcc/g++ 4.  cfa-cc is written in C++.
     40Building cfa-cc requires GNU Make and gcc/g++ 3.  cfa-cc is written in
     41C++.
    3842
    39 The compiler driver uses an installed version of gcc to handle all aspects of
    40 the compilation process except for the Cforall->C translation.  Currently, only
    41 gcc 4.x is supported.
     43The compiler driver uses an installed version of gcc to handle all
     44aspects of the compilation process except for the Cforall->C translation.
     45Currently, only gcc 3.2 is supported.
    4246
    4347How is cfa-cc used?
    4448-------------------
    45 The compiler driver "cfa" accepts all of the arguments of gcc, and is used in
    46 the same way.  For example:
     49The compiler driver "cfa" accepts all of the arguments of gcc, and is
     50used in the same way.  For example:
    4751
    4852        cfa -c test.c
    4953        cfa test.o
    5054
    51 Cforall source files must end with '.c' in order to be compiled by the compiler
    52 driver.  In addition, the flag "-CFA" causes cfa to invoke the preprocessor and
    53 translator and send the translator output to standard output.
     55Cforall source files must end with '.c' in order to be compiled by the
     56compiler driver.  In addition, the flag "-CFA" causes cfa to invoke the
     57preprocessor and translator and send the translator output to standard
     58output.
    5459
    55 It is possible to invoke the translator directly.  The translator is installed
    56 by default as /usr/local/lib/cfa-cpp.  A typical invocation is:
     60In cases where the compiler driver is not useful (i.e., where gcc 3.2
     61is not available), it is still possible to invoke the translator
     62directly.  The translator is installed by default as
     63/usr/local/lib/cfa-cpp.  A typical invocation is:
    5764
    5865        /usr/local/lib/cfa-cpp -cp infile outfile
    5966
    60 If outfile is omitted, output goes to standard output; if infile is also
    61 omitted, input comes from standard input.  Options to the translator other than
    62 "-cp" will not produce valid C code and are only useful for debugging the
    63 translator.
     67If outfile is omitted, output goes to standard output; if infile is
     68also omitted, input comes from standard input.  Options to the
     69translator other than "-cp" will not produce valid C code and are only
     70useful for debugging the translator.
    6471
    6572How can C code be used with cfa-cc?
    6673-----------------------------------
    67 cfa-cc should be able to compile most ANSI C programs.  It is also possible to
    68 link against C libraries in most cases.  Since Cforall supports overloading,
    69 however, names used in Cforall code are mangled in the output C code.  This
    70 caused linker failures when the names refer to functions and objects in code
    71 compiled with a standard C compiler.  For this reason, it is necessary to
    72 enclose the declarations of these functions and objects in extern "C" {}
     74cfa-cc should be able to compile most ANSI C programs.  It is also
     75possible to link against C libraries in most cases.  Since Cforall
     76supports overloading, however, names used in Cforall code are
     77mangled in the output C code.  This will cause linker failures when
     78the names refer to functions and objects in code compiled with
     79a standard C compiler.  For this reason, it is necessary to enclose
     80the declarations of these functions and objects in extern "C" {}
    7381blocks.  For example:
    7482
     
    7987
    8088The extern "C" turns off name mangling for functions and objects declared
    81 within the block.  As a result, it is not possible to overload their names.
     89within the block.  As a result, it is not possible to overload their
     90names.
     91
     92It is our intention to have a transparent solution to this problem
     93in place for our first official release.
    8294
    8395What's wrong with cfa-cc?
    8496-------------------------
     97The authors consider this software to be in an unstable state.  It is
     98quite likely that there are many reasonable programs that will fail
     99to compile.  We encourage users to report their experiences to
     100cforall@plg.uwaterloo.ca, but we make no promises regarding support.
    85101
    86 The authors consider this software to be in an unstable state.  It is quite
    87 likely that there are many reasonable programs that will fail to compile.  We
    88 encourage users to report their experiences to cforall@plg.uwaterloo.ca, but we
    89 make no promises regarding support.
     102We have fixed most of the problems that we are aware of.  There are
     103some exceptions:
    90104
    91 We have fixed most of the problems that we are aware of.  There are some
    92 exceptions:
     105        - initializers are poorly implemented; in particular,
     106        file-scope initializers may result in the generation of invalid
     107        C code
    93108
    94 - initializers are poorly implemented; in particular, file-scope initializers
    95   may result in the generation of invalid C code
     109        - the ISO C99 designated initialization syntax '[n] = m' or
     110        '.n = m' is not supported; use a colon in place of the equal sign
     111       
     112        - some legitimate programs will produce warnings from the C
     113        compiler; these are harmless (in particular, the creation of
     114        libcfa.a in the build process should cause four warnings from
     115        gcc)
    96116
    97 - the ISO C99 designated initialization syntax '[n] = m' or '.n = m' is not
    98   supported; use a colon in place of the equal sign
     117        - abstract types introduced using the keyword 'type' are not
     118        implemented (although 'type' can be used to introduce type
     119        parameters)
    99120
    100 - some legitimate programs will produce warnings from the C compiler; these are
    101   harmless (in particular, the creation of libcfa.a in the build process should
    102   cause four warnings from gcc)
    103 
    104 - abstract types introduced using the keyword 'type' are not implemented
    105   (although 'type' can be used to introduce type parameters)
    106 
    107 - the implicit coercion of structure types to the type of their first member is
    108   not implemented
     121        - the implicit coercion of structure types to the type of their
     122        first member is not implemented
    109123       
    110124Who is responsible for cfa-cc?
Note: See TracChangeset for help on using the changeset viewer.