Skip to content

Commit e0d8438

Browse files
committed
feat: add language hcl
1 parent 234b3b5 commit e0d8438

13 files changed

Lines changed: 225 additions & 122 deletions

File tree

LANGUAGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@
7474
- [x] SVN (`svn`)
7575
- [x] Erlang (`erlang`)
7676
- [x] Nix (`nix`)
77+
- [x] HCL (`hcl`)
7778

7879
## Pending
7980

80-
- [ ] HCL (`hcl`)
8181
- [ ] Jupyter Notebook (`jupyter-notebook`)
8282
- [ ] Elixir (`elixir`)
8383
- [ ] Haskell (`haskell`)

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ import { gradle } from "code-languages/gradle";
7272
import { glsl } from "code-languages/glsl";
7373
import { graphql } from "code-languages/graphql";
7474
import { groovy } from "code-languages/groovy";
75+
import { hcl } from "code-languages/hcl";
76+
import { html } from "code-languages/html";
7577
import { ini } from "code-languages/ini";
7678
import { javascript } from "code-languages/javascript";
7779
import { java } from "code-languages/java";
78-
import { html } from "code-languages/html";
7980
import { julia } from "code-languages/julia";
8081
import { kotlin } from "code-languages/kotlin";
8182
import { less } from "code-languages/less";
@@ -140,10 +141,11 @@ console.log(gradle.extensions);
140141
console.log(glsl.extensions);
141142
console.log(graphql.version);
142143
console.log(groovy.version);
144+
console.log(hcl.extensions);
145+
console.log(html.extensions);
143146
console.log(ini.extensions);
144147
console.log(javascript.website);
145148
console.log(java.version);
146-
console.log(html.extensions);
147149
console.log(julia.version);
148150
console.log(kotlin.version);
149151
console.log(less.extensions);
@@ -213,6 +215,7 @@ import {
213215
glsl,
214216
graphql,
215217
groovy,
218+
hcl,
216219
html,
217220
ini,
218221
java,
@@ -282,6 +285,7 @@ console.log(localizeLanguage(fsharp, "es").description);
282285
console.log(localizeLanguage(glsl, "es").description);
283286
console.log(localizeLanguage(graphql, "es").description);
284287
console.log(localizeLanguage(groovy).description);
288+
console.log(localizeLanguage(hcl, "es").description);
285289
console.log(localizeLanguage(ini, "es").description);
286290
console.log(localizeLanguage(java).name);
287291
console.log(html.website);
@@ -441,6 +445,7 @@ console.log(detectLanguages("include/config.h").map((language) => language.slug)
441445
| <img src="https://cdn.simpleicons.org/opengl/5586A4" alt="GLSL logo" width="24" height="24"> | GLSL | `glsl` | `.glsl`, `.vert`, `.frag`, `.geom`, `.tesc`, `.tese`, `.comp`, `.vs`, `.fs` | `4.60` | `code-languages/glsl` |
442446
| <img src="https://upload.wikimedia.org/wikipedia/commons/1/17/GraphQL_Logo.svg" alt="GraphQL logo" width="24" height="24"> | GraphQL | `graphql` | `.graphql`, `.gql`, `.graphqls` | `September 2025` | `code-languages/graphql` |
443447
| <img src="https://upload.wikimedia.org/wikipedia/commons/3/36/Groovy-logo.svg" alt="Groovy logo" width="24" height="24"> | Groovy | `groovy` | `.groovy`, `.gvy`, `.gy`, `.gsh` | `5.0.5` | `code-languages/groovy` |
448+
| <img src="https://cdn.simpleicons.org/hashicorp/844FBA" alt="HCL logo" width="24" height="24"> | HCL | `hcl` | `.hcl`, `.tf`, `.tfvars`, `.pkr.hcl`, `.nomad` | `2.24.0` | `code-languages/hcl` |
444449
| <img src="https://www.w3.org/html/logo/downloads/HTML5_Badge.svg" alt="HTML logo" width="24" height="24"> | HTML | `html` | `.html`, `.htm` | `Living Standard` | `code-languages/html` |
445450
| <img src="https://commons.wikimedia.org/wiki/Special:FilePath/Configure.svg" alt="INI logo" width="24" height="24"> | INI | `ini` | `.ini` | `Informal format` | `code-languages/ini` |
446451
| <img src="https://www.vectorlogo.zone/logos/java/java-icon.svg" alt="Java logo" width="24" height="24"> | Java | `java` | `.java` | `26` | `code-languages/java` |

docs/data/bench-results.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
11
{
2-
"generatedAt": "2026-05-15T04:14:49.197Z",
2+
"generatedAt": "2026-05-15T12:12:12.193Z",
33
"runtime": "v25.9.0",
44
"results": [
55
{
66
"name": "detectLanguage for TypeScript file",
77
"group": "detect",
88
"iterations": 100000,
9-
"totalMs": 165.854,
10-
"meanMs": 0.001659,
11-
"opsPerSecond": 602941
9+
"totalMs": 167.164,
10+
"meanMs": 0.001672,
11+
"opsPerSecond": 598215
1212
},
1313
{
1414
"name": "detectLanguages for ambiguous header",
1515
"group": "detect",
1616
"iterations": 100000,
17-
"totalMs": 164.504,
18-
"meanMs": 0.001645,
19-
"opsPerSecond": 607888
17+
"totalMs": 175.059,
18+
"meanMs": 0.001751,
19+
"opsPerSecond": 571235
2020
},
2121
{
2222
"name": "detectLanguage mixed filenames",
2323
"group": "detect",
2424
"iterations": 20000,
25-
"totalMs": 41.004,
26-
"meanMs": 0.00205,
27-
"opsPerSecond": 487757
25+
"totalMs": 40.98,
26+
"meanMs": 0.002049,
27+
"opsPerSecond": 488044
2828
},
2929
{
3030
"name": "localize TypeScript to es-PE",
3131
"group": "i18n",
3232
"iterations": 250000,
33-
"totalMs": 60.832,
34-
"meanMs": 0.000243,
35-
"opsPerSecond": 4109659
33+
"totalMs": 61.665,
34+
"meanMs": 0.000247,
35+
"opsPerSecond": 4054183
3636
},
3737
{
3838
"name": "localize complete catalog to Spanish",
3939
"group": "i18n",
4040
"iterations": 10000,
41-
"totalMs": 204.944,
42-
"meanMs": 0.020494,
43-
"opsPerSecond": 48794
41+
"totalMs": 209.7,
42+
"meanMs": 0.02097,
43+
"opsPerSecond": 47687
4444
},
4545
{
4646
"name": "api.language().locale().get()",
4747
"group": "api",
4848
"iterations": 100000,
49-
"totalMs": 46.346,
50-
"meanMs": 0.000463,
51-
"opsPerSecond": 2157707
49+
"totalMs": 46.617,
50+
"meanMs": 0.000466,
51+
"opsPerSecond": 2145150
5252
},
5353
{
5454
"name": "api.detect().locale().get()",
5555
"group": "api",
5656
"iterations": 100000,
57-
"totalMs": 204.893,
58-
"meanMs": 0.002049,
59-
"opsPerSecond": 488059
57+
"totalMs": 211.893,
58+
"meanMs": 0.002119,
59+
"opsPerSecond": 471936
6060
},
6161
{
6262
"name": "api.language().locale().load()",
6363
"group": "api",
6464
"iterations": 10000,
65-
"totalMs": 4.712,
66-
"meanMs": 0.000471,
67-
"opsPerSecond": 2122016
65+
"totalMs": 4.691,
66+
"meanMs": 0.000469,
67+
"opsPerSecond": 2131742
6868
}
6969
]
7070
}

docs/data/languages.json

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"generatedAt": "2026-05-15T04:14:49.402Z",
3-
"total": 72,
4-
"extensions": 210,
2+
"generatedAt": "2026-05-15T12:12:12.391Z",
3+
"total": 73,
4+
"extensions": 215,
55
"locales": ["en", "es"],
66
"languages": [
77
{
@@ -115,7 +115,7 @@
115115
"packageManagers": ["npm", "pnpm", "Yarn", "Bun"],
116116
"ecosystems": ["Web", "Static Sites", "Content"]
117117
},
118-
"version": "6.3.2",
118+
"version": "6.3.3",
119119
"logo": "https://astro.build/assets/press/astro-icon-light.svg"
120120
},
121121
{
@@ -598,6 +598,27 @@
598598
"version": "5.0.6",
599599
"logo": "https://upload.wikimedia.org/wikipedia/commons/3/36/Groovy-logo.svg"
600600
},
601+
{
602+
"slug": "hcl",
603+
"name": "HCL",
604+
"description": "HashiCorp Configuration Language for human-readable infrastructure and application configuration.",
605+
"longDescription": "HCL is HashiCorp Configuration Language, a structured configuration language designed to be readable by humans while remaining easy for tools to parse. It supports blocks, attributes, expressions, variables, functions, object values, and references used to describe infrastructure and application settings.\n\nIt is best known through Terraform, but it is also used across HashiCorp tools such as Packer, Nomad, Vault, and Consul. HCL files commonly define cloud resources, modules, providers, jobs, policies, templates, and environment-specific variables.",
606+
"esName": "HCL",
607+
"esDescription": "El lenguaje de configuracion de HashiCorp para infraestructura y configuracion legible por humanos.",
608+
"esLongDescription": "HCL es HashiCorp Configuration Language, un lenguaje de configuracion estructurado disenado para ser legible por humanos y facil de analizar por herramientas. Soporta bloques, atributos, expresiones, variables, funciones, valores de objeto y referencias usadas para describir infraestructura y configuracion de aplicaciones.\n\nEs conocido principalmente por Terraform, pero tambien se usa en herramientas de HashiCorp como Packer, Nomad, Vault y Consul. Los archivos HCL suelen definir recursos cloud, modulos, providers, jobs, politicas, templates y variables especificas por entorno.",
609+
"publishedDate": "2014-01-01",
610+
"extensions": [".hcl", ".tf", ".tfvars", ".pkr.hcl", ".nomad"],
611+
"author": "HashiCorp",
612+
"website": "https://github.com/hashicorp/hcl",
613+
"paradigms": ["declarative", "configuration", "data-serialization"],
614+
"tooling": {
615+
"runtimes": ["Terraform", "Packer", "Nomad", "Vault", "Consul"],
616+
"packageManagers": ["Terraform Registry"],
617+
"ecosystems": ["Infrastructure as Code", "DevOps", "Cloud", "HashiCorp"]
618+
},
619+
"version": "2.24.0",
620+
"logo": "https://cdn.simpleicons.org/hashicorp/844FBA"
621+
},
601622
{
602623
"slug": "html",
603624
"name": "HTML",
@@ -920,7 +941,7 @@
920941
"runtimes": ["nginx", "NGINX Plus", "OpenResty"],
921942
"ecosystems": ["Web Servers", "Reverse Proxies", "Load Balancing", "DevOps"]
922943
},
923-
"version": "1.30.0",
944+
"version": "1.30.1",
924945
"logo": "https://upload.wikimedia.org/wikipedia/commons/c/c5/Nginx_logo.svg"
925946
},
926947
{
@@ -1067,7 +1088,7 @@
10671088
"packageManagers": ["npm", "pnpm", "Yarn"],
10681089
"ecosystems": ["Web", "Node.js"]
10691090
},
1070-
"version": "3.0.3",
1091+
"version": "3.0.4",
10711092
"logo": "https://cdn.simpleicons.org/pug/A86454"
10721093
},
10731094
{
@@ -1130,7 +1151,7 @@
11301151
"packageManagers": ["RubyGems", "Bundler"],
11311152
"ecosystems": ["Web", "Rails", "DevOps", "Automation"]
11321153
},
1133-
"version": "4.0.3",
1154+
"version": "4.0.4",
11341155
"logo": "https://www.ruby-lang.org/images/header-ruby-logo.png"
11351156
},
11361157
{
@@ -1193,7 +1214,7 @@
11931214
"packageManagers": ["sbt", "Maven", "Gradle", "Scala CLI"],
11941215
"ecosystems": ["JVM", "Web", "Data Engineering", "Distributed Systems"]
11951216
},
1196-
"version": "3.7.4",
1217+
"version": "3.8.3",
11971218
"logo": "https://cdn.simpleicons.org/scala/DC322F"
11981219
},
11991220
{
@@ -1231,7 +1252,7 @@
12311252
"packageManagers": ["npm", "pnpm", "Yarn", "Bun"],
12321253
"ecosystems": ["Web", "SvelteKit", "Vite"]
12331254
},
1234-
"version": "5.55.5",
1255+
"version": "5.55.7",
12351256
"logo": "https://upload.wikimedia.org/wikipedia/commons/1/1b/Svelte_Logo.svg"
12361257
},
12371258
{
@@ -1309,7 +1330,7 @@
13091330
"website": "https://toml.io",
13101331
"paradigms": ["configuration", "declarative", "data-serialization"],
13111332
"tooling": {},
1312-
"version": "1.0.0",
1333+
"version": "1.1.0",
13131334
"logo": "https://cdn.simpleicons.org/toml/9C4221"
13141335
},
13151336
{

0 commit comments

Comments
 (0)