Difference between revisions of "TyD"
(Created page with "TyD (Tynan's Tidy Data Language) is an open source data language created by Tynan Sylvester, to improve the layout of game-oriented data. You can read the official specificati...") |
|||
| Line 26: | Line 26: | ||
{ | { | ||
Record “This is an anonymous table, since elements in lists can’t have names” | Record “This is an anonymous table, since elements in lists can’t have names” | ||
| − | } | + | } |
| − | { | + | { |
| − | Record “Here’s another table” | + | Record “Here’s another table” |
| − | } | + | } |
| − | ] | + | ] |
SubTable | SubTable | ||
{ | { | ||
Record “I heard you like tables” | Record “I heard you like tables” | ||
| − | } | + | } |
| − | }</nowiki> | + | }</nowiki> |
| + | |||
==In Software Inc.== | ==In Software Inc.== | ||
Software Inc. uses a fork of Tynan’s C# implementation of TyD, which you can find here(https://github.com/khornel/TyDSharp). | Software Inc. uses a fork of Tynan’s C# implementation of TyD, which you can find here(https://github.com/khornel/TyDSharp). | ||
If you want to know why Software Inc. switched from XML to TyD, and not something else, you should read the comparison section of the TyD specification.(https://github.com/TynanSylvester/TyD#comparisons) Other than the reasons listed, TyD resembled C# a lot, which reduces friction during development and I would rather not rely on a third party closed-source solution when parsing data. | If you want to know why Software Inc. switched from XML to TyD, and not something else, you should read the comparison section of the TyD specification.(https://github.com/TynanSylvester/TyD#comparisons) Other than the reasons listed, TyD resembled C# a lot, which reduces friction during development and I would rather not rely on a third party closed-source solution when parsing data. | ||
Revision as of 17:17, 2 February 2020
TyD (Tynan's Tidy Data Language) is an open source data language created by Tynan Sylvester, to improve the layout of game-oriented data. You can read the official specification here(https://github.com/TynanSylvester/TyD).
Quick overview
Values in TyD can be simple_values, “quoted strings”, numbers, lists, tables or null. Values can be given a name, making them a record of name/value. You can make a table using curly brackets, and putting a list of records in it, separated by new lines or semicolons, e.g.
{
Name “Troll”
Health 10
}
You can also make a list using square brackets, and putting a list of values (not records), separated by new lines or semicolons, e.g.
[ 1; 2; 3 ]
You can put lists in tables and tables in lists, but note that when you put a table in a list, it shouldn’t have a name (since it’s not a record). A TyD Document should contain a list of records. Most TyD documents in Software Inc. contain a single table record. Localizations contain a list of string records.
Example
Table
{#I’m a comment
Record SimpleValue
Record2 “Quoted string” #Quoted strings can span multiple lines
Record3 5.6 #This is a simple number value
Record4 null #TyD recognizes null values
List [ very ; simple; list ]
List2
[
“Multi line” #Remember to escape quotes in a quoted string like this \”
“List”
] #Lists can also have numbers
ListOfTables
[
{
Record “This is an anonymous table, since elements in lists can’t have names”
}
{
Record “Here’s another table”
}
]
SubTable
{
Record “I heard you like tables”
}
}
In Software Inc.
Software Inc. uses a fork of Tynan’s C# implementation of TyD, which you can find here(https://github.com/khornel/TyDSharp). If you want to know why Software Inc. switched from XML to TyD, and not something else, you should read the comparison section of the TyD specification.(https://github.com/TynanSylvester/TyD#comparisons) Other than the reasons listed, TyD resembled C# a lot, which reduces friction during development and I would rather not rely on a third party closed-source solution when parsing data.