HML (Hica Markup Language), looking for library authors.
Posted by cladamski79@reddit | programming | View on Reddit | 3 comments
Hej,
HML (Hica Markup Language) is a structured document and configuration language initially built for the hica programming language ecosystem. There is a v0.3.0 specification published and a reference implementation in hica at HML repo, I'm looking for community feedback, critique, and curious developers who want to help build parsers and libraries in their favourite languages.
Why another markup language?
TOML and JSON are great for flat configurations, but they fall flat when you need complex hierarchical trees or mixed text documents. Contrary to those (and an unpopular opinion perhaps...), XML is fantastic at separating metadata from content.
With HML I tried to bridge this gap. It aims to preserve the semantic strengths of XML while keeping the clean, low-noise readability of modern config formats.
Some highlights
- Metadata vs. Content: Attributes in
(...)for metadata; bodies in{...}for content. - Text content requires an explicit wrapper element (
@body,@p,@text). If you accidentally miss a colon in a property (e.g.,timeout 30s), HML throws a syntax error instead of silently parsing it as a string block. - Built-in literals like
timeout: 30sorinterval: 500msmake configurations clean. - Quickly create nested structures inline without writing boilerplate blocks.
- The parser never needs lookahead beyond a single token to determine context.
Here is a quick look at an HML configuration snippet:
@service(id: "auth-api", public: true) {
environment: "production"
cache_ttl: 24h
@upstream(url: "https://api.internal") {
retry: @policy(max: 3, delay: 500ms)
}
}
Do you like to write handwritten recursive descent parsers, or messing around with tools like nom, pest, antlr, or gocc?
It would be amazing to have libraries in other languages!
Read the full spec here
Comment below if you’re interested in building a parser or if you have thoughts on the design principles.
programming-ModTeam@reddit
r/programming is not a place to post your project, get feedback, ask for help, or promote your startup.
Technical write-ups on what makes a project technically challenging, interesting, or educational are allowed and encouraged, but just a link to a GitHub page or a list of features is not allowed.
The technical write-up must be the focus of the post, not just a tickbox-checking exercise to get us to allow it. This is a technical subreddit.
We don't care what you built, we care how you build it.
gredr@reddit
Really liked what I was seeing, until "text mode". I don't understand at all the rationale behind this.
cladamski79@reddit (OP)
The lack of handling text content has been an issue in formats like YAML and TOML that don't support mixed content, HML is designed to fill that gap while keeping the structure unambiguous.
Hope that helps?
https://github.com/cladam/hml/blob/main/HML-Specification.md#text-content-mixed-content