• bob@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    4
    ·
    edit-2
    7 months ago

    vlang

    hello world:

    fn main() {
        areas := ['game', 'web', 'tools', 'science', 'systems',
                  'embedded', 'drivers', 'GUI', 'mobile']
        for area in areas {
            println('Hello, ${area} developers!')
        }
    }
    

    http + time:

    import time
    import net.http
    resp := http.get('https://vlang.io/utc_now') or {
        println('failed to fetch data from the server')
        return
    }
    t := time.unix(resp.body.int())
    println(t.format()) // 2019-08-16 17:48