![]() ![]() JXC has first-class support for Base-64 encoded strings ( b64"anhjIGZvcm1hdA=") to make it easy to include binary data when needed. When using the Python bindings, these parse and serialize directly to datetime objects.īase64 Strings. Having a standard, first-class way to store dates and timestamps is incredibly useful for data such as log files or exported database tables. DateTime strings ( dt"" or dt"T10:40:05.025Z") are strings that only support ISO-8601 datetimes. Raw strings are excellent for regular expressions or embedding other languages.ĭateTime Strings. ![]() If you add a heredoc, they also allow line breaks for even greater flexibility ( r'HEREDOC()HEREDOC'). Raw strings ( r'()') are strings that do not support escape characters, allowing a much greater range of possible values without dealing with escaping every single backslash or quote character. These pair very well with annotations, which you could use to select how to parse an expression. These are tokenized but not parsed, so you can use expressions to effectively add custom syntax when needed. In addition to lists and objects, JXC has a third "container" type - expressions. This data can be read as a string, or, for more complex use-cases, it can be read as a list of tokens you can parse yourself (for example, to implement generics).Įxpressions. While their primary purpose is to store type information, they can also be used to store arbitrary metadata. The annotation syntax is flexible and you can use it for whatever purpose you need for your application - there are no built-in or reserved annotations. JXC allows annotations at the beginning of any value (eg. These suffixes can be evaluated at runtime and handled by your application however is needed, such as for conversion, storage, or data validation.Īnnotations. JXC allows custom suffixes on numeric types, such as 10px, 20.5%, or 2.34_f32. If you find any valid JSON that JXC does not handle, please submit a bug report! If you're already using JSON for your config files and want more flexibility, it's easy to migrate to JXC. All valid JSON syntax is also valid JXC syntax. If you want a data format that can elegantly support features such as calc() in CSS, you can build it with JXC. These can be useful for simple math expressions or even embedding snippets of scripting language code. JXC is extensible via expressions, which you can parse yourself to support custom syntaxes. Different applications have different needs. Indentation is not syntactically relevant. To avoid ambiguity and maintain clarity, JXC does not allow unquoted strings as a normal value type. Value annotations and numeric suffixes show the intended use of objects, lists, and numbers. In lists and objects, trailing commas are allowed, and line breaks may be used in place of commas if desired. ![]() Unquoted identifiers may be used as object keys. JXC allows single, double quoted, and multi-line raw strings. So you don't need to worry about escaping anything Raw strings, which support standard heredoc syntax Until 1.0 is released, expect a few language and API changes. If you have feedback on the language syntax or semantics, now is the best time to offer them, while breaking changes are still allowed. The version numbers for the language and reference libraries will also likely be decoupled at this time, so they can evolve independently. Along with this, the reference implementation will switch to semantic versioning - no breaking changes allowed except for major version bumps. The 1.0 release will come with a strong commitment to backwards compatibility for the language syntax. The current goal is to ship a 1.0 release in early 2023. Important Note: JXC has not yet reached version 1.0. It also does not sacrifice speed - benchmarks show that the reference implementation is about as fast as many commonly used C++ JSON libraries. It's a perfect fit for config files, especially ones with more complex needs. ![]() It's fantastic in many use-cases that can be awkward in other data formats. JXC is a structured data language similar to JSON, but with a focus on being expressive, extensible, and human-friendly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |