符合 ISO 3166-1 alpha-2 国家代码的编程语言文件扩展名
Programming language file extensions that match ISO 3166-1 alpha-2 country code

原始链接: https://www.bruh.ltd/blog/programming-language-file-extensions-that-match-an-iso-3166-1-alpha-2-country-code/

ISO 3166-1 alpha-2 标准为各个国家和地区分配了双字母代码,这些代码常被用于顶级域名和数字图标。有趣的是,其中许多代码与流行的编程语言及标记语言的文件扩展名重合。 一个典型的例子是 `.rs`,它是塞尔维亚的国家代码,同时也作为 Rust 编程语言的文件扩展名。这种重合使得许多 Rust 相关项目都会使用塞尔维亚域名。 除了 Rust 之外,这种现象还存在于许多其他语言中。例如: * **.py** (Python) 对应巴拉圭。 * **.pl** (Perl) 对应波兰。 * **.ru** (Ruby) 对应俄罗斯。 * **.md** (Markdown) 是摩尔多瓦的代码。 * **.cc** (C++) 属于科科斯群岛。 这在全球地理和软件开发之间创造了一种独特的交集,开发者经常使用特定国家的域名来托管与其所选语言扩展名相同的项目。

Hacker News 最新 | 往日 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 匹配 ISO 3166-1 alpha-2 国家代码的编程语言文件扩展名 (bruh.ltd) 11 点 | 作者: speckx | 58 分钟前 | 隐藏 | 往日 | 收藏 | 3 条评论 | 帮助 cachius 3 分钟前 | 下一条 [-] 我喜欢这种不同概念之间的随机联想! 而且当页面不活动时,标题会变成“Michaelsoft Teams” <3 回复 yeputons 28 分钟前 | 上一条 [-] 我记得 Ruby 使用的是 .rb(不是 .ru),Scala 使用的是 .scala(不是 .sc)。 回复 b3orn 23 分钟前 | 父评论 [-] 是的,Ruby 应该是 .rb。另外,.mm 不是 Objective-C,而是 Objective-C++。 回复 考虑申请 YC 2026 年秋季批次!申请开放至 7 月 27 日。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

So there's this standard called ISO 3166-1 alpha-2 that defines a 2 letter code for every country on the planet (like ME = Montenegro) and a bunch of places that aren't countries (like EU = European Union). You've probably encountered such a code before in top level domain names (.im belongs to the Isle of Man) and on Discord (typing :flag_fm: yields a 🇫🇲 emoji).

One of these codes is RS (= Serbia). Either by a sheer coincidence or someone playing 5D chess, .rs is also the file extension for the Rust programming language, which is why the domain name of every other Rust project now belongs to Serbia. This made me curious about other cases like this, so here's an incomplete list of programming languages, domain-specific languages, markup languages, etc which file extensions match a country code. If you think something is missing, let me know!

CodeFlagLanguageCountry
AM🇦🇲AutomakeArmenia
AS🇦🇸ActionScriptAmerican Samoa
CC🇨🇨C++Cocos Islands
EC🇪🇨eCEcuador
ES🇪🇸ECMAScriptSpain
GY🇬🇾GroovyGuyana
IN🇮🇳AutoconfIndia
MD🇲🇩MarkdownMoldova
MK🇲🇰MakefileNorth Macedonia
MM🇲🇲Objective CMyanmar
PL🇵🇱Perl, PL/I, PrologPoland
PS🇵🇸PostScriptPalestine
PY🇵🇾PythonParaguay
RS🇷🇸RustSerbia
RU🇷🇺RubyRussia
SB🇸🇧ScratchSolomon Islands
SC🇸🇨ScalaSeychelles
SH🇸🇭Unix ShellSaint Helena
SL🇸🇱S-LangSierra Leone
SM🇸🇲SmallTalkSan Marino
ST🇸🇹SmallTalk, Structured TextSao Tome and Principe
SV🇸🇻SystemVerilogEl Salvador
联系我们 contact @ memedata.com