* cmd/fnode — build/run CLI that drives Five's compiler packages (pp, parser, analyzer, gengo) and stitches generated prg_*.go together with fivenode_go's own hbrtl_ext/* packages in a temp module. Result is one self-contained Go binary; no FFI, no Node. * hbrtl_ext/hello — bootstrap RTL extension proving the blank-import-init() registration path works end-to-end. Exposes FNODE_HELLO() to PRG. * app/hello.prg — minimum end-to-end test: calls Date() (Five RTL) and FNODE_HELLO() (fivenode_go RTL) from the same binary. Verified: ./fnode build app/hello.prg -o hello_app → 17 MB single binary that prints both lines. The same pattern will host the HTTP server, bridge capi helpers, and PostgreSQL client coming in 1a.2b–1a.4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
574 B
Go
21 lines
574 B
Go
// Package hello is a bootstrap RTL extension that proves fivenode_go's
|
|
// custom-RTL pipeline works end-to-end.
|
|
//
|
|
// Blank-importing this package registers FNODE_HELLO via init() so PRG
|
|
// code in the same binary can call it without any further wiring.
|
|
package hello
|
|
|
|
import "five/hbrt"
|
|
|
|
func init() {
|
|
hbrt.RegisterDynamicFunc("FNODE_HELLO", fnodeHello)
|
|
}
|
|
|
|
// FNODE_HELLO() — returns a constant greeting; bootstrap verification only.
|
|
func fnodeHello(t *hbrt.Thread) {
|
|
t.Frame(0, 0)
|
|
defer t.EndProc()
|
|
t.PushString("Hello from fivenode_go hbrtl_ext!")
|
|
t.RetValue()
|
|
}
|