raz / commit a90b6049

commit
a90b604905a2617fbbf33885bce253d073f6cb69
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
0d6f0f1f
Plan stage 3: F32, extern var, a thread-safe heap, line numbers

The line budget becomes 5,000 lines of code within 10%.

patch · log

1 file changed, +18 -10

PLAN.md (history) modified +18 -10

@@ -14,10 +14,11 @@
1414 - The compiler is Free Pascal 3.2.2, `{$mode objfpc}{$H-}`: records,
1515 pointers, shortstrings. No classes, ansistrings, exceptions, dynamic
1616 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.
2122 - Clarity over cleverness. Every unit opens with a header comment: what
2223 it is, what it depends on, what it leaves out. Comments say why, and
2324 what wherever a layout or encoding isn't obvious.
@@ -98,14 +99,21 @@
9899 - [x] 10. Generic modules, with type and procedure arguments;
99100 `lib/Str.jed`, `lib/Buf.jed`, `lib/Fmt.jed`; examples.
100101
101-Stage 3: calling C
102+Stage 3: calling C, and what comes with it
102103
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.
107115
108116 Wrap up
109117
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
111119 compiler file by file.