| | @@ -26,7 +26,7 @@ |
| 26 | 26 | - Work stops after every stage for review. A step starts only on an |
| 27 | 27 | explicit go-ahead. |
| 28 | 28 | - Not in scope for now: man pages, QEMU or bare metal tests, aarch64, |
| 29 | | - an optimizer. |
| 29 | + macOS and Windows (Mach-O, PE), an optimizer. |
| 30 | 30 | |
| 31 | 31 | ## Decisions |
| 32 | 32 | |
| | @@ -43,7 +43,7 @@ |
| 43 | 43 | 6. Records are laid out as C lays them out. |
| 44 | 44 | 7. Modules are compiled together, from source, in one run: no symbol |
| 45 | 45 | files, no separate compilation. A generic module is compiled once |
| 46 | | - per distinct list of type arguments. |
| 46 | + per distinct list of arguments, its types and its procedures. |
| 47 | 47 | 8. Tree shaking: the linker keeps only the procedures, variables and |
| 48 | 48 | literals reachable from the entry point. |
| 49 | 49 | 9. Variadic arguments exist only to call C. jed code gets the same |
| | @@ -70,31 +70,37 @@ |
| 70 | 70 | |
| 71 | 71 | - [x] 1. Language report, `doc/jed.md`. Reviewed and approved before |
| 72 | 72 | any more code. |
| 73 | | -- [ ] 2. Scanner and symbol table, `scan.pas` and `sym.pas` (drafts |
| 74 | | - exist), brought in line with the report; they compile. |
| 73 | +- [ ] 2. Scanner and symbol table, `scan.pas` and `sym.pas`, written |
| 74 | + against the report; they compile. |
| 75 | 75 | - [ ] 3. Machine code, `x64.pas`. |
| 76 | 76 | - [ ] 4. Linking and output, `link.pas` and `elf.pas`: tree shaking, |
| 77 | 77 | static ELF, symbol table. A hand built chunk runs. |
| 78 | 78 | - [ ] 5. Parser and code generator, `gen.pas` and `parse.pas`: |
| 79 | | - everything in the report except multiple results, `NEW`, generic |
| 80 | | - modules and `extern`. |
| 81 | | -- [ ] 6. `lib/Rt.jed`, `lib/Out.jed`; examples (hello, args, variants |
| 82 | | - and slices, volatile); `make check` runs them against expected |
| 83 | | - output; `make bench` times the compiler on generated jed. |
| 79 | + everything in the report except multiple results, errors, |
| 80 | + enumerations and sets, record literals, `defer`, `NEW`, generic |
| 81 | + modules and `extern`. Module bodies, per-target modules and their |
| 82 | + interface check, and code procedures are in. |
| 83 | +- [ ] 6. `lib/Rt.jed`, `lib/Sys.linux-x86_64.jed`, `lib/Out.jed`; |
| 84 | + examples (hello, args, variants and slices, volatile, a code |
| 85 | + procedure); `make check` runs them against expected output; |
| 86 | + `make bench` times the compiler on generated jed. |
| 84 | 87 | |
| 85 | | -Stage 2: allocation, results, generics |
| 88 | +Stage 2: the rest of the language |
| 86 | 89 | |
| 87 | | -- [ ] 7. Multiple results. |
| 88 | | -- [ ] 8. `NEW`; `lib/Mem.jed`, `lib/Arena.jed`, `lib/Heap.jed`. |
| 89 | | -- [ ] 9. Generic modules; `lib/Str.jed`, `lib/Buf.jed`, `lib/Fmt.jed`; |
| 90 | | - examples. |
| 90 | +- [ ] 7. Multiple results and errors. |
| 91 | +- [ ] 8. Enumerations and sets, record literals, `defer`; examples. |
| 92 | +- [ ] 9. `NEW`; `lib/Mem.jed`, `lib/Arena.jed`, `lib/Heap.jed`. |
| 93 | +- [ ] 10. Generic modules, with type and procedure arguments; |
| 94 | + `lib/Str.jed`, `lib/Buf.jed`, `lib/Fmt.jed`; examples. |
| 91 | 95 | |
| 92 | 96 | Stage 3: calling C |
| 93 | 97 | |
| 94 | | -- [ ] 10. `extern`, `link`, dynamic ELF, start through |
| 98 | +- [ ] 11. `extern`, `link`, dynamic ELF, start through |
| 95 | 99 | `__libc_start_main`; examples with `printf` and an X11 window. |
| 100 | + A module whose per-target file calls the C library instead of |
| 101 | + `SYSCALL`, the way other systems would be reached. |
| 96 | 102 | |
| 97 | 103 | Wrap up |
| 98 | 104 | |
| 99 | | -- [ ] 11. `README.md` and `doc/compiler.md`, a guide to reading the |
| 105 | +- [ ] 12. `README.md` and `doc/compiler.md`, a guide to reading the |
| 100 | 106 | compiler file by file. |