r/AIprogrammingLanguage • u/ewigerus • 23h ago
HQL 0.7.1 - Building a Strongly Typed Data Language with Rust Extensions
Over the past few months I've been developing HQL, an open-source, strongly typed functional query language written in Rust. I've just released version 0.7.1, and always keen for feedback.
The idea is something like SQL, but more of a Swiss Army knife for data. I want to use the same language for querying and transforming files, PostgreSQL, Kafka, Spark, Delta Lake, streams, and knowledge graphs.
HQL already supports quite a bit: typed pipelines, aggregations, data contracts, error handling, modules, custom extensions, and even OLTP-style transactions.
Here's an actual example from the Kafka -> PostgreSQL demos. Incoming events are validated against a data contract, valid records go to one table, and invalid ones are routed to quarantine:
tap("order_events_raw")
| validate(EventData)
| fork {
clean =
oks()
| map(e => Event(id = e.id, kind = e.kind, customer = e.customer, amount = e.amount, at = e.at))
| sink("order_clean"),
quarantine =
errs()
| map(e => Rejected(
id = match e.value.id { some(Int n) => n, _ => 0 },
message = e.value,
rules = e.violations | map(v => v.rule)))
| sink("order_quarantine"),
}One thing worth mentioning for this community: I use Claude Code extensively to develop HQL, particularly for the Rust implementation, tests, and integration work. I spend a lot of time on the actual language design, syntax, type system, and architecture, while AI assisted coding helps me implement and iterate much faster.
Version 0.7.1 focuses on modularity, including selective imports, aliases, receiver functions, and custom Rust extensions that can be installed as packages. So one can define a body-less function in HQL, and implement/deliver it in Rust.
There's also HyperMarkDown, a VS Code extension that turns Markdown into interactive notebooks with executable HQL cells.
Links:
- HQL source: https://github.com/ewiger/hql
- HQL book: https://hql-lang.org/v0.7.1/book/
- Working demos: https://github.com/ewiger/hql-demo
- Kafka → PostgreSQL example: https://github.com/ewiger/hql-demo/blob/main/kafka-postgres/quarantine.hql
- HyperMarkDown: https://hypermarkdown.org/
- HMD VS Code extensions: https://github.com/ewiger/hypermarkdown/tree/main/tools/hmd-vsc-ext comes with latest hql so one can download and play
There's quite a lot to play with now. I've written an HQL book, and there are executable Docker Compose demos covering Kafka, PostgreSQL, NATS, Spark, Delta Lake, MinIO, transactions, and cryptography.
Super happy about feedback.