• 0 Posts
  • 8 Comments
Joined 1 year ago
cake
Cake day: June 16th, 2023

help-circle



  • bob@lemmy.worldtoProgramming@programming.dev...
    link
    fedilink
    arrow-up
    4
    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