| | @@ -14,10 +14,11 @@ |
| 14 | 14 | - The compiler is Free Pascal 3.2.2, `{$mode objfpc}{$H-}`: records, |
| 15 | 15 | pointers, shortstrings. No classes, ansistrings, exceptions, dynamic |
| 16 | 16 | arrays or SysUtils. |
| 17 | | -- The compiler stays under 5,000 lines, and compiles at least 400,000 |
| 18 | | - lines of jed a second, from reading the sources to writing the |
| 19 | | - executable. `make bench` measures it, and a step that breaks either |
| 20 | | - limit isn't done. |
| 17 | +- The compiler stays near 5,000 lines of code (not counting blank and |
| 18 | + comment lines), within 10%, and compiles at least 400,000 lines of |
| 19 | + jed a second, from reading the sources to writing the executable. |
| 20 | + `make loc` and `make bench` measure them, and a step that breaks |
| 21 | + either limit isn't done. |
| 21 | 22 | - Clarity over cleverness. Every unit opens with a header comment: what |
| 22 | 23 | it is, what it depends on, what it leaves out. Comments say why, and |
| 23 | 24 | what wherever a layout or encoding isn't obvious. |
| | @@ -98,14 +99,21 @@ |
| 98 | 99 | - [x] 10. Generic modules, with type and procedure arguments; |
| 99 | 100 | `lib/Str.jed`, `lib/Buf.jed`, `lib/Fmt.jed`; examples. |
| 100 | 101 | |
| 101 | | -Stage 3: calling C |
| 102 | +Stage 3: calling C, and what comes with it |
| 102 | 103 | |
| 103 | | -- [ ] 11. `extern`, `link`, dynamic ELF, start through |
| 104 | | - `__libc_start_main`; examples with `printf` and an X11 window. |
| 105 | | - A module whose per-target file calls the C library instead of |
| 106 | | - `SYSCALL`, the way other systems would be reached. |
| 104 | +- [ ] 11. `extern proc`, `extern var` and `link`; dynamic ELF, start |
| 105 | + through `__libc_start_main`. A plain `lib/Sys.jed` over the C |
| 106 | + library, the default for targets with no file of their own. |
| 107 | + Examples with `printf` to `stdout`, and an X11 window, reading |
| 108 | + `XEvent` as an array of words through pointer conversions. |
| 109 | +- [ ] 12. `F32`: arithmetic, conversions, calls; real literals become |
| 110 | + untyped constants that take `F32` or `F64`. |
| 111 | +- [ ] 13. A thread-safe `lib/Heap.jed`, and its bad sizes refused; an |
| 112 | + example with threads from `pthread_create`. |
| 113 | +- [ ] 14. Line numbers for gdb: `.debug_line`, with the least of |
| 114 | + `.debug_info` and `.debug_abbrev` that gdb needs. |
| 107 | 115 | |
| 108 | 116 | Wrap up |
| 109 | 117 | |
| 110 | | -- [ ] 12. `README.md` and `doc/compiler.md`, a guide to reading the |
| 118 | +- [ ] 15. `README.md` and `doc/compiler.md`, a guide to reading the |
| 111 | 119 | compiler file by file. |