| | @@ -3,7 +3,7 @@ |
| 3 | 3 | jed (Polish *jeden*, one) is a small systems language in Wirth's |
| 4 | 4 | tradition: full control of memory, volatile access, atomics, calls into |
| 5 | 5 | C, generic modules. Its compiler is meant to be read in a long weekend: |
| 6 | | -about 4,500 lines of Free Pascal, one pass, no IR, no optimizer, writing |
| 6 | +about 4,550 lines of Free Pascal, one pass, no IR, no optimizer, writing |
| 7 | 7 | x86-64 machine code and the ELF file itself. |
| 8 | 8 | |
| 9 | 9 | The language is defined by `doc/jed.md`. Where this plan and the report |
| | @@ -14,6 +14,10 @@ |
| 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 | 21 | - Clarity over cleverness. Every unit opens with a header comment: what |
| 18 | 22 | it is, what it depends on, what it leaves out. Comments say why, and |
| 19 | 23 | what wherever a layout or encoding isn't obvious. |
| | @@ -52,7 +56,7 @@ |
| 52 | 56 | | File | Lines | What | |
| 53 | 57 | |---|---|---| |
| 54 | 58 | | `src/scan.pas` | ~430 | Symbols, literals, comments, error messages | |
| 55 | | -| `src/sym.pas` | ~390 | Types, objects, scopes, layout | |
| 59 | +| `src/sym.pas` | ~450 | Types, objects, scopes, layout | |
| 56 | 60 | | `src/x64.pas` | ~400 | Code buffer, chunks, fixups, instruction encoder | |
| 57 | 61 | | `src/gen.pas` | ~660 | Items: loading, storing, copying, frames, calls | |
| 58 | 62 | | `src/parse.pas` | ~1,900 | Declarations, statements, expressions, built-ins | |
| | @@ -64,7 +68,7 @@ |
| 64 | 68 | |
| 65 | 69 | Stage 1: the core |
| 66 | 70 | |
| 67 | | -- [ ] 1. Language report, `doc/jed.md`. Reviewed and approved before |
| 71 | +- [x] 1. Language report, `doc/jed.md`. Reviewed and approved before |
| 68 | 72 | any more code. |
| 69 | 73 | - [ ] 2. Scanner and symbol table, `scan.pas` and `sym.pas` (drafts |
| 70 | 74 | exist), brought in line with the report; they compile. |
| | @@ -76,7 +80,7 @@ |
| 76 | 80 | modules and `extern`. |
| 77 | 81 | - [ ] 6. `lib/Rt.jed`, `lib/Out.jed`; examples (hello, args, variants |
| 78 | 82 | and slices, volatile); `make check` runs them against expected |
| 79 | | - output. |
| 83 | + output; `make bench` times the compiler on generated jed. |
| 80 | 84 | |
| 81 | 85 | Stage 2: allocation, results, generics |
| 82 | 86 | |