finds.dev← search

// the find

hyperjumptech/grule-rule-engine

★ 2,505 · Go · NOASSERTION · updated Feb 2026

Rule engine implementation in Golang

Grule is a RETE-based rule engine for Go, implementing a Drools-inspired DSL called GRL. It's for Go shops that need to externalize business logic — pricing rules, eligibility checks, scoring systems — without recompiling their service every time a rule changes. If you've ever maintained a 400-line if/else tree for business policy, this is the alternative.

1. ANTLR-backed parser with a real grammar (grulev3.g4) means GRL syntax errors are caught at load time, not halfway through execution. 2. RETE algorithm means rule evaluation doesn't naively re-check every rule on every fact change — the working memory and salience system handle ordering correctly. 3. JSON fact support (JsonDataAccessLayer) lets you feed dynamic data without defining Go structs, which matters for rule engines that need to run against arbitrary payloads. 4. Binary serialization of KnowledgeBase exists, so you can precompile rules and avoid the ~100ms parse cost per cold start.

1. Loading 1000 rules costs ~488MB of memory per operation per the benchmarks — that's not a typo, and it's brutal if you're running this in a multi-tenant context or reloading frequently. 2. The reflection-heavy data access layer means your fact objects need to export fields and methods by name as strings; refactoring struct field names silently breaks rules at runtime, not compile time. 3. Last meaningful activity appears to be slowing down (Hacktoberfest tags from 2021 still in the topic list), and the contributor ask in the README is still about basic test coverage — not a sign of a thriving maintainer community. 4. Concurrency story requires careful KnowledgeBase instance management — you cannot share a KnowledgeBase instance across goroutines without cloning it, which is a footgun that's easy to miss.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →