Experimental human-friendly data serialization language
Β
Koy is a new flexible and feature-rich data serialization language; easy for you, your dog and your average 5 year-old. Its design focuses on being visually unobtrusive while keeping an overall sense of verbosity, allowing easy-to-write parsers (in multiple languages) to effortlessly map the data to hash tables.
Β
/*
Hello world! this is a simple Koy document
and you are reading a multi-line comment :^)
*/
// let's import some settings, shall we?
import "./settings/screen.koy"
title: "Koy Example"
person: {
name: "Michael Theodor Mouse",
age: 34
}
laptop: {
owner: ${person} << {
username: "mickey1234"
},
temp:int 203.04,
married: true,
document: ${title}
}
ports: [ 8001, 8002, 8003 ]
As shown here, Koy isn't only good for deeply nested data, but also for avoiding an unambiguous use of it, managing their data-types and modularizing them.
Β
- Friendly Syntax with Obvious Semantics: everything in a Koy file works on a
key
->value
basis, therefore you can nest data as much as you want and no matter what, it's easy to comprehend at a glance. - Standard Errors: Koy defines a list of semantic errors throwable for when the parser screams "oh crap! what is this?". This way developers get an implementation-agnostic definition that helps them debug their program's config faster.
- Unambiguous: Koy has one, and only ONE way to define each thing, because doing the opposite would increase the overall complexity of the language.
- Feature Rich: Koy supports:
- comments
- variables
- type casting & coercion
- data overwritting
- importing other koy files
- native data-types:
- Integer (
int
) - String (
str
) - Null (
null
) - Array (
arr
) - Boolean (
bool
) - Float (
flt
) - Object (
obj
)
- Integer (
Β
Β
Β
The following is a list of library implementations for Koy:
- π Lua:
parser
Β
The following is a list of IDE/DE plugins available for Koy:
π·π Under dev
Β
You can read Koy's docs here
Β
Check out the list here.
Β
- Why?
Disclaimers:
- these are just my thoughts on config/data serialization languages. Feel free to disagree (and to open an issue, I'm open to discussions.)
- all this is for the sake of creating a bettter language, however I still haven't decided if I'll end up making this. Initially this repo was just meant to be a rant, but I don't know, maybe something good will come out of here!
With that said, let's continue...
I like how XML is useful for porting data across platforms, however I dislike the fact that it "repeats itself" too much (opening and closing tags), so often times it feels visually jammed. JSON, however, is vastly nicer on the eyes due to its notable hierarchical structure. But now, looking more at its syntax I can't help but feel like it's too strict(?) (numbers and longstrings are a nightmare); apart from that, given that JSON is a data-only-type-of-config-language, nice stuff such as comments are not baked into it. On the other end of the spectrum, TOML, which focuses on being easy to read due to obvious sematic sucks for deeply nested data. The .
convention simply doesn't cut it for me. Furthermore, something that I wish any of these included by default is native support for variable placeholders. I know, YAML has aliases and anchors which sorta do the job? however these simply don't work as such because they can't be inserted arbitrarily throughout a YAML file, which sucks too. Speaking about YAML, it is unnecessarily complex. Like, c'mon? 4 ways to define a simple boolean?
Koy, in a sense, is just a proof of concept for what I ambition my ideal data serialization language to look like.
Β
Koy is released under the MIT license, which grants the following permissions:
- Commercial use
- Distribution
- Modification
- Private use
For more convoluted language, see the LICENSE.
Β