For those who are looking for JSON alternatives, I have a little gift for you 😀 https://gitlab.com/nilshelmig/barenet/-/tree/main#use-in-f-or-fable-projects
BareFs is the F# implementation of baremessages.org A simple 8-bit aligned binary encoding format. BareFs comes along with a flexible and easy to use code generator. So you can describe your messages in a simple schema
type PublicKey data<128>
type Time string # ISO 8601
enum Department {
ACCOUNTING
ADMINISTRATION
CUSTOMER_SERVICE
DEVELOPMENT
# Reserved for the CEO
JSMITH = 99
}
type Customer {
name: string
email: string
address: Address
orders: []{
orderId: i64
quantity: i32
}
metadata: map[string]data
}
type Employee {
name: string
email: string
address: Address
department: Department
hireDate: Time
publicKey: optional<PublicKey>
metadata: map[string]data
}
type Person (Customer | Employee)
type Address {
address: [4]string
city: string
state: string
country: string
}
and let the code generator do the rest
dotnet bare schema.bare Messages.fs --lang fs
Simple, typesafe and small messages. Implementations are available for other languages too. Check out https://baremessages.org/ to see the full list.
Feedback is welcomed and much appreciated ❤️
|