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 result = 
    let input = r#"{ "x": 123, "y": 456.78, "name": null }"#
    do v = de.deserialize input
    let v : Vec = v
    let updated = { x = v.x, y = v.y, name = Some "Vector" }
    ser.to_string_pretty updated

match result with
| Ok s -> s
| Err err -> err
                

Documentation