Documentation for Koy, the human-friendly data serialization language
### ๐ Koy Lang Koy is designed to be a minimal, simple and intuitive data serialization language; easy for you, your dog and your average 5 year-old. It has a small set of symbols, not too many rules and only one singular statement. Its lack of complexity makes it the perfect language for your project! easy to implement, debug and modularize. Go ahead and check out the [Conventions](https://github.com/Pocco81/koy-lang/blob/main/docs/conventions.md) to learn about the generalities of the language! if you end up liking it, consider checking out the [Specs sheet](https://github.com/Pocco81/koy-lang/blob/main/docs/specs.md) and the [Style Guide](https://github.com/Pocco81/koy-lang/blob/main/docs/style-guide.md). ### ๐ Cheat sheetSymbols | Function | Example |
// |
Single-line comment | ``` // hello world! ``` |
/**/ |
Multi-line comment | ``` /* This is a multi-line comment and you are watcing Disney channel! */ ``` |
: |
Set a key, followed by its data type (optional) and then the value. To define a literal key put it between single quotes ('' ) |
``` hello: "world!" // specifying data type temperature:int 12.23 ``` |
${} |
Call a variable | ``` // simple usage name: "Michael Theodor Mouse" hello: "Good evening ${name}" // with arrays (using the `.` notation) user: { name: "Michael", surnames: "Theodor Mouse" } hi: "Good morning ${user.name}" ``` |
"" |
Define a normal string | ``` hello: "world" ``` |
""" """ |
Define a multi-line string | ``` hello: """My name is Michael Theodor Mouse, but you can call me Peter. """ ``` |
'' |
Define a literal value | ``` weird_path: 'pc/\fds!fd/\&24324%!@' ``` |
[] |
Define an array | ``` hosts: [ "omega", "alpha", "gama" ] ``` |
{} |
Define an object | ``` user: { name: "Michael Theodor Mouse", age: 92 } ``` |
import |
Import other .koy files |
``` // single import import "./directory/settings.koy" // multiple imports import { "./directory/user0.koy", "./directory/user1.koy", "./directory/user2.koy" } ``` |
<< |
Overwrite values from objects | ``` user: { name: "Michael Theodor Mouse", age: 93 } laptop: { name: "Lenovo Thinkpad", owner: ${user} << { name: "Dominic Toretto" } } ``` |
.koy
file using every feature