5 ms·
I've always felt that YAML was incomplete.
by lwis 10y ago
I've always felt that YAML was incomplete.
- TillE 10y agoIf you want to use it for complex things, sure, there's no end of potential features. If you need some logic with your data, I like Lua. But I think most uses of YAML are basically just a much more flexible JSON.
- AstroJetson 10y agoIf you want to use it for complex things, sure, there's no end of potential features. If you need some logic with your data, I like Lua. Say some more about this. I look at YAML as a way to do data exchange, like using JSON/SON. How does Lua fit into this?
- Avshalom 10y agoNot TillE, but I suspect the point is you can exchange data with Lua tables just as easily as JSON and because you would do it by just embedding the Lua interpreter you can also send Lua functions around with the data and/or process the data in Lua before making it accessible from the actual program.
- justincormack 10y agoLua was originally a configuration language. Its syntax is very human readable especially for just data use cases, but you can add functions etc too.
- AstroJetson 10y agoThanks. I was looking at the process to process data sharing that you would use YAML or JSON for and how Lua would be used. It's never occurred to me to serialize a table and send it. I'll put that on the stack of things to research.
- andybak 10y agoI use YAML as human-editable JSON - especially for non-programmers (although it's surely more pleasant to write even for programmers). I would like a clearly documented YAML subset that left out some of the more complex stuff and avoided a few 'more than one way to do it' features. That would go a long way to removing some of the criticism of YAML with very little cost in functionality.
- espadrine 10y ago> I would like a clearly documented YAML subset that left out some of the more complex stuff and avoided a few 'more than one way to do it' features. That's the goal of dotset (https://github.com/espadrine/dotset https://github.com/espadrine/dotset).
- byuu 10y agoI made BML for that purpose. I posted about it before: https://news.ycombinator.com/item?id=8645591 https://news.ycombinator.com/item?id=8645591 To copy-paste the example: server path: /core/www/ host: example.com port: 80 service: true proxy host: proxy.example.com port: 8080 authentication: plain description :Primary web-facing server :Provides commerce-related functionality server ... proxy host="proxy.example.com" port=8080 authentication: plain There's no character escaping, brackets, distinction between attributes and elements, data types (up to the one parsing the document how to decode values), etc. BOM-free UTF-8 is mandatory. It's the bare minimum for an extensible tree-based data structure, but I threw in three ways to assign values to nodes to help craft smaller documents. Turns out it's hugely important to be able to assign multiple child nodes on the same line as the parent for certain classes of documents. My implementation of BML uses my string library, so I can't offer a portable parser. But it shouldn't take more than an hour or two to write a BML parser. Still, my reference example is here: https://gitlab.com/higan/higan/tree/master/nall/string/markup https://gitlab.com/higan/higan/tree/master/nall/string/marku... -- 177 lines for the base parser, which can also save back modified BML documents. Downside is that I have no clue how to market it, and I hate writing documentation, so there's only a few people using it.
- 10y ago