什么是TOML?

配置文件的使用由来已久,从.ini、XML、JSON、YAML再到TOML,语言的表达能力愈来愈强,同时书写便捷性也在不断提高。 TOML是前GitHub CEO, Tom Preston-Werner,于2013年建立的语言,其目标是成为一个小规模的易于使用的语义化配置文件格式。TOML被设计为能够无二义性的转换为一个哈希表(Hash table)。html


Comparison with Other Formats

In some ways TOML is very similar to JSON: simple, well-specified, and maps easily to ubiquitous data types. JSON is great for serializing data that will mostly be read and written by computer programs. Where TOML differs from JSON is its emphasis on being easy for humans to read and write. Comments are a good example: they serve no purpose when data is being sent from one program to another, but are very helpful in a configuration file that may be edited by hand.git

The YAML format is oriented towards configuration files just like TOML. For many purposes, however, YAML is an overly complex solution. TOML aims for simplicity, a goal which is not apparent in the YAML specification: http://www.yaml.org/spec/1.2/spec.htmlgithub

The INI format is also frequently used for configuration files. The format is not standardized, however, and usually does not handle more than one or two levels of nesting.segmentfault


参考资料

toml-lang/toml: Tom's Obvious, Minimal Language
https://github.com/toml-lang/tomlapp

TOML简介 (转) - 孤独信徒 - 博客园
http://www.javashuo.com/article/p-tceeddbi-kz.htmlui

深刻对比TOML,JSON和YAML - sunsky303 - 博客园
http://www.javashuo.com/article/p-xqbxnpou-kz.html设计

TOML: GitHub 这是要革 YAML 的命呀! - SegmentFault 业界资讯 - SegmentFault 思否
http://www.javashuo.com/article/p-xpvcybre-h.htmlrest

相关文章
相关标签/搜索