(c) 1990 Steve Hawtin. Over the last few months, since NorthC was first released, quite a few people have written to me to ask about NorthC, usually they also add some supplementary questions, I thought it would be worth putting down the answer to some of these queries so that you have to think of more interesting ones. 1. What books on 'C' should I buy? Since 'C' is the current "fashionable language" there are a vast number of books on 'C' around, mostly written by the people who were writing books on Artificial Intelligence a couple of years ago and know just as much about 'C'. If you want to buy a book on 'C' here are some that I can recommend. "The C programming language" by Kernigan & Ritchie. If you want to learn 'C' this is the best book, it may be hard going at first but unlike many "easy" books you will still be using after a year of 'C' programming. This is the book that professional 'C' programmers use as a reference. You will find a copy almost everywhere 'C' is used seriously, normally dog-eared and grey from overuse. There are two editions of this book, the original edition and the ANSI edition, you should not worry about which on you get, although the ANSI one is more up to date most 'C' compilers will be closer to the old edition for some time to come. "C traps and pitfalls" by Koenig For the experienced 'C' programmer this book is a must, it points out many of those nice little quirks that trap everybody from time to time. This book collects together a vast body of 'C' experience, once you know the difference between a union and a structure this book will tell you all the things you didn't realise you didn't know. "Standard C" by Plauger & Brodie The best book I have seen on the ANSI standard, this book is a reference guide rather than a "how to" book. "Amiga ROM Kernel:Libraries & Devices" by CATS "Amiga ROM Kernel:Includes & Autodocs" by CATS These two books are the complete guides for the Amiga specific bits, most of the examples are in 'C', but you will have to get hold of the include files. The first book introduces AmigaDOS and gives examples of how to do things with the machine, the second is the ultimate reference book for Amiga specific programming. If you are buying these make sure you get the right version for your version of workbench, currently the ones in the blue covers for Workbench 1.3. 2. Is NorthC ANSI compatible? The answer to this question is no, although I have tried to use ANSI functions where I can there are still many areas where the compiler falls short of the standard. The "Bugs.doc" file outlines the areas that do not conform. The ANSI standard clearly states that compiler writers are not allowed to claim ANSI conformance unless they implement everything in the standard, however this has not stopped certain companies claiming to have ANSI 'C' compilers when they do not support multibyte characters and locales. As yet I have not managed to find a true ANSI 'C' compiler. 3. Is NorthC shareware or public domain? The answer to this question is no, NorthC is neither public domain or shareware. Shareware programs are programs that are distributed by the public, but if you use them, or want an up to date copy, you must send some money to the authors. Public domain programs are programs that you can do anything with, they belong to the public. Most of NorthC is copyright to the original authors, myself, Charlie Gibbs, the Software Distillary and so on, however the copyright holder has allowed other people, this means you, to copy their programs and data provided you stick to certain rules. These rules normally just say that you are not allowed to use the stuff for commercial gain, see the individual files on the disk to find out the full set of restrictions for each program. If you feel that I deserve some money for the hard work that I have put into this disk send £15 or $25 to your national spastics charity, they need it more than I do. If you feel that some of the other people that contributed deserve some recognition please send them any money direct. 4. Why isn't the NorthC disk bootable? Well the reason for this is that I could not create a bootable disk without including some programs by Commodore. It is easy to create a bootable NorthC floppy, just copy your workbench floppy, delete all the bits you don't need, the ".icon" files, all the fonts except topaz, the commands you don't want. Then move "NorthC", "A68K", "Blink", and "make" to the Utilities directory, move the contents of the "include" directory on to the disk, create a directory called "clibs" and move "crt0.o" and "libc.a" into it, and add the lines assign clibs: :clibs setenv INCLUDE df0:include newshell "newcon:0/10/640/246/NorthC 1.2 Shell" into "s:startup-sequence" to replace the "loadwb" line. On NTSC systems the newcon command should of course read newshell "newcon:0/10/640/190/NorthC 1.2 Shell" If you have problems fitting all this on a single floppy I have been told that "Power Packer" by Nico Francois is a useful tool for squeezing more programs on a disk, it is distributed by Fred Fish, ask your local PD supplier for the disk. Once you have created a bootable floppy in this way you are not allowed to give copies away, that would break some of the rules for copying the programs. 5. Where do I get the AmigaDOS include files? You will notice that the NorthC 1.2 disk does not contain the AmigaDOS include files, I asked Commodore if I could put them on the disk but they refused. To get them you can either type them in from "Includes & Autodocs" or you can write to Commodore and ask to become a "registered developer", this will cost about £20 in the UK, presumably a similar amount elsewhere. Commodore will send you the include files and various other useful bits and pieces. I have been told that it is well worth doing. See the "README" file on the NorthC disk for more details. 6. Why do you give away your software? This is one of the most difficult questions I am asked, here is a selection of answers 0. Because its needed. 1. Because its there. 2. Because I cannot sell it. 3. For the money. 4. Because I think more Amiga users should have access to 'C'. 5. Because software should be free. 6. To encourage users to purchase Lattice C. 7. As an Erisian it is my duty to spread knowledge. 8. For the fame. 9. Just because... Some of these answers are true, some are false and some are meaningless, you will have to sort them out yourself. 7. How did you port NorthC Before I answer this question I should point out that I have written programming languages before, in the last ten years I have written a "Forth" interpreter, a "Scheme" interpreter and compiler, and been professionally involved in "Common Lisp" interpreters and compilers. So the idea of porting a 'C' compiler was not as horrendous as it should have been. When I bought my Amiga in December 1989 I assumed that I would be able to get hold of a complete 'C' system in the public domain, in fact what I found was 1) Sozobon C, on FISH 171, an "almost ported" 'C' compiler. 2) SmallC, on FISH 141, a working but very limited 'C' compiler. 3) A68K, on FISH 186, a working assembler. 4) Blink, on FISH 40, a working linker. 5) SmallLib, on FISH 92, a small library for assembler programmers. one problem with Sozobon was that the output was not compatible with any of the Amiga public domain assemblers. So my first step was to create a program "convert" that read a ".s" file produced by Sozobon and converted it into a ".asm" file that A68K could deal with. I wrote the first version in SmallC, this finally convinced me that SmallC was not the language for me. I now could compile 'C' programs in three steps, 1) hcc test.c 2) convert test.s test.asm 3) a68k test.asm using this I created some 'C' library functions, and used these to create a new version of "convert". I then ran the Sozobon compiler through this three stage compilation process, the resulting program summoned the guru of course. After two months of continual work modifying the Sozobon source I managed to get the compiler sort of working. Once I had a version of the compiler that could compile itself I changed the output routines to make the "convert" program unnecessary. As soon as the system was stable I released it, I thought that it was worth sending out a version that was incomplete so that people could start to play with 'C'. I called this first release NorthC 1.0 because the original source has been so heavily hacked the program was sure to contain many new and exciting bugs, this was distributed by Fred Fish on FISH 340. After two more months I had a version I felt happy with, I released this at the start of May as NorthC 1.1. Having spent almost every evening for more than four months working on NorthC I decided to give it a rest. As a passing thought if I had just bought a copy of Lattice when I started I would have saved myself a large amount of time and money. However I would not know as much about 'C' as I now do. 8. Are you trying to replace Lattice? In a sense the answer to this question is yes, when I first started working on NorthC I could have got an illicit copy of Lattice and used that to develop my 'C' programs, however I felt that it would be better to have a legitimate 'C' compiler. So I hope that NorthC and the other public domain 'C' compilers will replace all the illegal copies of Lattice that are floating about. Of course the Lattice compiler is a professional piece of software, the documentation is better, and in hard copy, I would assume the code produced is quicker and more compact, and the software support on Lattice is better. If the size and speed of the final program matters enough to spend the money then you should go out and buy a professional compiler. Until that time comes you can carry on using NorthC, any code you write should work in any half descent 'C' compiler.