7c61db70c3
fix: Critical code review fixes — race conditions, panic recovery, LTRIM/RTRIM
...
CRITICAL fixes:
- fileio.go: Add sync.Mutex to file handle table (race condition #2 )
allocHandle/getHandle/removeHandle thread-safe helpers
- goroutine.go: Add defer/recover to GoLaunch/GoLaunchBlock
Goroutine panic no longer crashes entire process (#5 )
HIGH fixes:
- strings.go: Implement proper LTrim (TrimLeft) and RTrim (TrimRight)
Previously both aliased to AllTrim — silent semantic bug (#18 )
- register.go: TRIM = RTrim (Harbour compatible)
From 53-issue senior code review.
Remaining: 47 issues (HIGH: 10, MEDIUM: 18, LOW: 16, CRITICAL: 3)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 10:17:30 +09:00
a2430fa44b
docs: Strengthen Five Philosophy — full manifesto with real-world stories
...
Expanded from 180 lines to 450+ lines per language:
- Real failure stories: EU bank COBOL→Java (€200M), Brazil Clipper→Python (tax error)
- Deep Go analysis: 25 keywords vs 90+, no exceptions by design, hardware future
- AI paradox: code generation vs code understanding gap
- Detailed code comparisons: Go vs Five for discount calculation
- Five principles with battle scars from 30 years of xBase deployment
- Independence manifesto: zero-dependency code ownership
- Epilogue: what will future archaeologists find?
"The measure of a language is not what it can express,
but what it allows a stranger to understand."
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 12:13:21 +09:00
409c82dd3c
docs: Five Philosophy — the bible of why Five exists
...
The founding document of Five, written as a manifesto:
- Why 30 years of xBase code must not be discarded
- Why Go is the right foundation for the next 50 years
- Why human-readable code matters more in the AI era
- What was designed: 5 principles, 5 architectures
- The vision: living code that bridges past and future
"Code fades, but thought endures."
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 12:04:40 +09:00
542373572f
feat: MemRDD — in-memory database engine (Go map-based)
...
Complete in-memory RDD implementation:
- CRUD: Create, Append, GetValue, PutValue, Delete, Recall
- Navigation: GoTo, GoTop, GoBottom, Skip, BOF, EOF
- Index: CreateIndex (sorted slice + binary search), Seek (exact + soft)
- Bulk: Pack (remove deleted), Zap (clear all)
- Multi-open: shared table across work areas
- Driver registered as "MEMRDD", prefix "mem:"
Tests: 9 tests including 5000-record stress test
Create, Append/Get/Put, Navigation, Delete/Pack, Zap,
Index (string + numeric), Seek (exact + soft), Stress 5000, Multi-open
Use cases: temp tables, query results, pivot, caching
Performance: no disk I/O, no byte packing — pure Go slices
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 11:57:48 +09:00
c0f175883c
docs: Add math section to syntax reference + improve example comments
...
- five-syntax-en/ko: Add Math comparison table (Harbour RTL vs Go math)
- go_math_compare.prg: Detailed English comments explaining each section
- Example lists updated with go_math_compare.prg
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 11:31:44 +09:00
0828d17159
feat: Harbour RTL vs Go math comparison example + analyzer IMPORT fix
...
- examples/go_math_compare.prg: Side-by-side comparison of
Harbour RTL (Abs, Sqrt, Round, Int, Max, Min, Log, Exp, Mod)
vs Go math package (Sin, Cos, Pow, Pi, Floor, Ceil, Hypot, ...)
- Combined usage: normal distribution, compound interest, distance
- Analyzer: recognize IMPORT package names as valid identifiers
- Analyzer: add math RTL functions (ABS, SQRT, etc.) to known list
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 10:35:40 +09:00
e04ae563ef
test: 16 dynamic PRG tests — all new syntax works in FRB/runtime
...
Verifies every Five extension works in dynamic compilation:
- Multi-return (RETURN a,b + a,b := Func())
- DEFER (Go defer in PRG)
- Slice (a[2:4])
- Channel operators (ch <- val, <- ch)
- SPAWN / LAUNCH / GOROUTINE
- WATCH (channel multiplexing)
- ASYNC / AWAIT
- WITH TIMEOUT
- Nil-safe (?:)
- f-string interpolation
- CONST block
- PARALLEL FOR
- IMPORT + pkg.Func() (Go direct call)
- obj:Method() (Go object bridge)
- MacroEval (runtime expression evaluation)
All 16 tests PASS — dynamic PRG has full feature parity.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 10:16:54 +09:00
6b37cc19e4
test: 8 shutdown tests — EXIT, AtExit, WorkArea, panic-safe, statics
...
Tests verify:
- EXIT PROCEDURE auto-execution on shutdown
- Reverse module order for EXIT
- AtExit LIFO callback order
- WorkArea CloseAll on exit
- Panic in cleanup doesn't crash (safeCall)
- Shutdown runs exactly once (sync.Once)
- Static variables cleared
- Full sequence order: EXIT → AtExit → WA:Close → onExit
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 10:12:34 +09:00
272576f6ce
feat: Harbour-compatible VM shutdown sequence
...
Implements full cleanup on program exit (normal, Ctrl+C, crash):
- EXIT PROCEDURE auto-execution (reverse module order)
- AtExit callback registry (LIFO order)
- All WorkAreas auto-close (child before parent)
- Terminal restore (raw → normal) on signal/exit
- Static variables clear
- Signal handlers (SIGINT, SIGTERM) for clean shutdown
- shutdown.go: Harbour hb_vmQuit() 25-step sequence adapted for Five
- vm.go: Run() now calls Shutdown() via defer
- rawtty.go: terminal restore registered with shutdown system
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 10:07:42 +09:00
d774f1598c
docs: Fix readability docs — Five supports DEFER too
...
Five's DEFER is Go's defer in PRG syntax.
Same safety guarantee, but without if err != nil pollution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 09:57:47 +09:00
b1a58724c8
docs: Add readability advantage — AI era code maintainability
...
Five's hidden strength: PRG code is readable by non-developers.
When AI generates code, humans must verify it.
Five's xBase syntax makes this possible.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 09:53:58 +09:00
59568f3301
Five v0.9 — Harbour + Go fusion language
...
- Compiler: PP → Lexer → Parser → Analyzer → Gengo pipeline
- Parser: 232/236 (98%) Harbour compatibility, registry-based dispatch
- RTL: 351 Harbour-compatible functions
- RDD: DBF/NTX/CDX engines with Rushmore bitmap optimization
- Go Interop: IMPORT + pkg.Func() + obj:Method() with FastPath (15M calls/sec)
- HB_FUNC API: Full Harbour C API compatible Go bridge
- Concurrency: SPAWN/LAUNCH/GOROUTINE, <-, WATCH, PARALLEL FOR, ASYNC/AWAIT
- Extensions: Multi-return, DEFER, Slice, f-string, Nil-safe ?:, CONST
- Macro Compiler: Runtime AST parsing and evaluation
- Debugger: TUI debugger with source display, breakpoints, stepping
- FRB: Native + Pcode dual mode runtime binary
- Tests: 13 packages ALL PASS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 09:41:50 +09:00