summaryrefslogtreecommitdiff
path: root/miniany/REQUIREMENTS
blob: 9274af420f899e5e3e611ede876f2730e35fa716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
implementing:

- userland
  - argument passing to main function (argc, argv)
- libc
  - print_char
    - requires a 3 parameter syscall to 80h (Linux)
      - requires
        - inline assembly

not implementing:
- libc
  - variadic functions are not type-safe, do we need them?
    - printf -> putint, putchar, etc.
      - format string only, as replacement for puts
      - vararg required in compiler
      - not type-safe
    - snprintf no option, strcat, strstr etc also not really
    - newer formating functions and logging: strfmon, error, warn, syslog
    - syscall
  - puts
    - requires stdout, which is a FILE structure
  - print_char
    - requires a 3 parameter syscall to 80h (Linux)
      - requires
        - either inline assembly
        - linker and calling convention
- preprocessor
  - have a cat building up the required modules instead
  - needs file operations (at least open, close, read)
  - needs a file system on the host and the destination
    (alternative: have a tape-like file system)
- linker
  - have compilation units needs a linker do build
    an executable
- symname[t] printing the symbol and not the number,
  requires static initializers for array of char*
- ASTs are basically only useful when you start to optimize,
  till then you can use an intermediate format (as C4) does
  and a stack machine. They also make the code easier readable.
  For use they fore the introduction of pointers, references and structs.
  In expression parsing we see, that const folding already needs
  an AST, because we should not emit code when still reading
  a constant expression. It also seperates syntactical stuff like '['
  from logical stuff like 'declaration of array size' and 'derefencing
  a pointer'.