summaryrefslogtreecommitdiff
path: root/miniany/cc.wg
diff options
context:
space:
mode:
Diffstat (limited to 'miniany/cc.wg')
-rw-r--r--miniany/cc.wg12
1 files changed, 6 insertions, 6 deletions
diff --git a/miniany/cc.wg b/miniany/cc.wg
index f09157a..2a0ad6d 100644
--- a/miniany/cc.wg
+++ b/miniany/cc.wg
@@ -29,16 +29,16 @@ WordGrinder dumpfile v3: this is a text file; diff me!
.clipboard.margin: 0
.clipboard.viewmode: 1
.clipboard.wordcount: 6
-.documents.1.co: 9
-.documents.1.cp: 205
-.documents.1.cw: 21
+.documents.1.co: 7
+.documents.1.cp: 31
+.documents.1.cw: 25
.documents.1.margin: 0
.documents.1.name: "main"
.documents.1.sticky_selection: false
.documents.1.viewmode: 1
.documents.1.wordcount: 2863
.fileformat: 8
-.findtext: "Typedefs"
+.findtext: "Note"
.menu.accelerators.^@: "ZM"
.menu.accelerators.^B: "SB"
.menu.accelerators.BACKSPACE: "ZDPC"
@@ -160,7 +160,7 @@ LB exit: terminate the process, return does not always work in all combination
LB read/write: read from stdin linearly, write to stdout linearly, this is essentially a model using an input and an output tape. Those two functions must really exist. This basically eliminates the need for a file system which we might not have during early bootstrapping.
P Similarly we simplify the C language to not use certain features which can cause trouble when bootstrapping:
LB variable arguments: though simple in principle (just some pointers into the stack if you use a stack for function parameters), it is not typesafe. And the only example in practice it's really heavily used for is in printf-like functions.
-LB preprocessor: it needs a filesystem, we take this outside of the compiler by feeding it an (eventually) concatenated list of *.c files. Note: in the hosted environemt we (and glibc) can use as many preprocessor features as they want, they just don't have to get visible in our code.
+LB preprocessor: it needs a filesystem, we take this outside of the compiler by feeding it an (eventually) concatenated list of *.c files. Note: in the hosted environment we (and glibc) can use as many preprocessor features as they want, they just don't have to get visible in our code.
LB two types: int and char, so we can interpret memory as words or as bytes.
H2 Local version of C4
P The local version of C4 has the following adaoptions and extensions:
@@ -179,7 +179,7 @@ LB converted printf to putstring/putint/putnl and some helper functions for
LB removed all memory leaks
LB de-POSIX-ified, no open/read/close, use getchar from stdin only (don't assume the existence of a file system), this also means we had to create sort of an old style tape-file with FS markers to separate the files piped to c4.
P The reason for all those adaptions is to minimize the dependency on the host system and to be able to use libc-freestanding.c.
-H3 Note: only too late I discovered that there was a C5 version of the same compiler, which would maybe have served better as a basis.
+P Note: Only too late I discovered that there was a C5 version of the same compiler, which would maybe have served better as a basis.
H2 Examples
H3 Running on the host system using the hosts C compiler
P Compiled in either hosted (host libc) or freestanding (our own libc, currently IA-32 Linux kernel only syscalls):