What it does: - Embed in Go with 3 lines: New(), Bind(), Call(), Eval() - Bind Go structs and functions directly — scripts see fields and call methods - Type inference catches errors before runtime, but you rarely write annotations - Option/Result instead of nil — no surprise panics in production - Stdlib covers HTTP, WebSocket, gRPC, SQLite, JSON, CSV, async tasks out of the box
Use cases I built it for: - Business rules that change without redeploying the Go host - Data pipelines and ETL scripts - Configuration that's more than YAML but less than a full app
Example embedding:
Use case: discount rules your ops team can change without redeploy
Go side:
type Discounts struct {
VIPPercent float64
HolidayPercent float64
MinOrder float64
}
func (d *Discounts) SetVIP(pct float64) { d.VIPPercent = pct }
func (d *Discounts) SetHoliday(pct float64) { d.HolidayPercent = pct }
func (d *Discounts) SetMinOrder(min float64) { d.MinOrder = min }
discounts := &Discounts{VIPPercent: 0.05, HolidayPercent: 0.0, MinOrder: 100}
vm := funxy.New()
vm.Bind("discounts", discounts)
vm.LoadFile("rules.lang")
vm.Call("updateRules")
// discounts.VIPPercent is now 0.15
// discounts.HolidayPercent is now 0.10
// discounts.MinOrder is now 50 — no redeploy needed
rules.lang (ops team edits this): fun updateRules() {
// Black Friday campaign
discounts.SetVIP(0.15)
discounts.SetHoliday(0.10)
discounts.SetMinOrder(50.0)
}
Repo: https://github.com/funvibe/funxy