Crates.io | iknow |
lib.rs | iknow |
version | 0.1.0 |
source | src |
created_at | 2022-08-04 18:55:32.74794 |
updated_at | 2022-08-04 18:55:32.74794 |
description | A self-describing knowledge format with support for Rust-like syntax |
homepage | https://github.com/advancedresearch/iknow |
repository | https://github.com/advancedresearch/iknow.git |
max_upload_size | |
id | 638875 |
size | 42,867 |
A self-describing knowledge format with support for Rust-like syntax
Bootstrap knowledge format from a root knowledge format that is capable of describing other knowledge formats.
The following is both valid Rust code and Iknow format. It describes the internal representation of the Iknow format in Rust.
"assets/self_root.txt":
enum Root {
Ty(Arc<String>),
Str(Arc<String>),
F64(f64),
Bool(bool),
Avatar(Box<(Self, Self)>),
Tup(Vec<Self>),
Struct {name: Box<Self>, fields: Vec<Self>},
Enum {name: Box<Self>, variants: Vec<Self>},
Instance {class: usize, data: Option<Box<Self>>},
InstanceTy {ty: Box<Self>, data: Option<Box<Self>>},
}
The root knowledge format can describe a generic version of itself.
This is not valid Rust code, due to a limitation
in how to annotate a custom/generic type using .
before the name, e.g. .T
.
"source/test/generics/gen_root.txt":
enum Root<.T> {
Ty(Arc<String>),
Val(.T),
Avatar(Box<(Self<.T>, Self<.T>)>),
Tup(Vec<Self<.T>>),
Struct {name: Box<Self<.T>>, fields: Vec<Self<.T>>},
Enum {name: Box<Self<.T>>, variants: Vec<Self<.T>>},
Instance {class: usize, data: Option<Box<Self<.T>>>},
InstanceTy {ty: Box<Self<.T>>, data: Option<Box<Self<.T>>>},
}
In the Star Wars V movie, Han Solo is frozen while Leia is watching.
Leia: "I love you"
Han: "I know"