Gluon

Gluon is a static, type inferred and embeddabble language written in Rust.

Try gluon from your browser!

Gluon on Github

let de @ { Deserialize, ? } = import! std.json.de
let ser @ { Serialize, ? } = import! std.json.ser
let { Result, ? } = import! std.result

#[derive(Serialize, Deserialize)]
type Vec = { x : Float, y : Float, name : Option String }

let input = r#"{ "x": 123, "y": 456.78, "name": null }"#
match de.deserialize input with
| Err err -> err
| Ok v ->
    let v : Vec = v
    let updated = { x = v.x, y = v.y, name = Some "Vector" }
    match ser.to_string_pretty updated with
    | Err err -> err
    | Ok s -> s
                

Documentation