hcl
by
hashicorp

Description: HCL is the HashiCorp configuration language.

View on GitHub ↗

Summary Information

Updated 58 minutes ago
Added to GitGenius on April 8th, 2021
Created on July 31st, 2014
Open Issues & Pull Requests: 234 (+0)
Number of forks: 647
Total Stargazers: 5,794 (+0)
Total Subscribers: 334 (+0)

Issue Activity (beta)

Open issues: 28
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 762 days
Stale 30+ days: 26
Stale 90+ days: 24

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (6)
  • bug (4)
  • hclwrite (4)
  • v2 (3)
  • gohcl (1)
  • hclsyntax (1)
  • syntax/native (1)
  • v1 (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: 2.8 hours
Mean response time: 116.7 days
90th percentile: 132.6 days
Tracked items: 36

Most active contributors

Detailed Description

HCL is HashiCorp's configuration language toolkit designed to create structured configuration formats that balance human readability with machine processability. Written in Go, it serves as the foundation for configuration parsing across HashiCorp's infrastructure-as-code tools and other command-line applications, particularly in the DevOps ecosystem. The repository represents major version 2 of HCL, which introduced a completely new parser and Go API that is incompatible with version 1, though both versions remain available through Go Modules for projects that need them.

The core design philosophy of HCL distinguishes it from generic serialization formats like JSON and YAML. Rather than treating configuration as arbitrary data serialization, HCL is purpose-built as a syntax and API for constructing domain-specific configuration languages. It attempts to occupy a middle ground between simple data formats and full programming languages, providing declarative logic capabilities without the complexity of general-purpose code. This approach enables applications to define expected configuration structures upfront, allowing HCL to validate conformance and provide meaningful error messages while returning high-level objects ready for application processing.

HCL supports two syntactic representations: a native syntax designed for human authoring and a JSON variant optimized for machine generation. The native syntax draws inspiration from libucl, nginx configuration files, and similar sources, emphasizing readability and writability. Both syntaxes map to the same underlying information model built around two primary concepts: attributes and blocks. This dual-syntax approach allows configuration to be provided as a mixture of human-authored native files and machine-generated JSON files while maintaining API consistency within calling applications.

The language includes an expression syntax enabling basic inline computation and, with application support, integration of variables and functions for more dynamic configuration scenarios. Applications can work directly with low-level attributes and blocks for advanced use cases or employ decoder packages to declaratively extract configuration into Go structs or dynamic value structures. The expression system extends to JSON through interpolation syntax, allowing arbitrary expressions within JSON strings despite JSON's native limitations.

Version 2.0 merged the capabilities of the original HCL 1.0 with those of HashiCorp's interpolation language HIL, creating a unified configuration language with robust expression support. This consolidation required a complete reimplementation with different architectural approaches to address rough edges in the original design and improve error handling capabilities.

According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 2.8 hours across 36 tracked items, indicating active maintenance. The most frequently addressed issue categories are enhancements with 6 tracked items, hclwrite-related issues with 4 items, and bugs with 4 items. Primary contributors include apparentlymart with 34 tracked events, crw with 14 events, and bflad with 4 events. The repository maintains overlapping contributor relationships with opentofu/opentofu, golang/go, and jenkinsci/docker, reflecting its role as foundational infrastructure tooling.

HCL originated in HashiCorp Terraform and has evolved through contributions from multiple developers who ported parsers from yacc to pure Go and designed the merged language architecture. The toolkit provides both high-level and low-level APIs, allowing applications ranging from simple configuration parsing to complex declarative language implementations to leverage HCL's structured approach to configuration management.

hcl
by
hashicorphashicorp/hcl

Repository Details

Fetching additional details & charts...