volt


Live code reloading
volt supports live code reloading, which makes it perfect for developing scientific applications and games:

About the language volt is written in

Originally volt app was written in Go, but after a couple of weeks of development I decided to re-write it in C for two reasons: easier integration with existing C graphics and UI libraries and much smaller and lighter binaries. The app size reduced from ~5 MB to ~100 KB.

C development is not very productive, so I spent two weeks in October 2017 to create a very light and minimalistic language that compiles to C. I haven't come up with a name yet, so I simply call it volt for now.

The language will be open-sourced later in 2018. The key features are:

Fast compilation
The entire volt project (~15 kloc) is compiled in ~400ms.

Simplicity
volt is very similar to Go in this regard. There's only one of way of doing things.

High performance
volt is compiled to C with no added overhead, so the performance is the same.

Safety
Variables are immutable by default, globals are not allowed, there's no null, functions are partially pure (only receivers can be modified).

Here's a Hello World GUI example:


package main

import ui 

type Context struct {
    input ui.TextBox
}

fn main() {
    mut wnd := ui.new_window(ui.WindowCfg{
        width: 600,
        height: 300,
        title: 'hello world',
    }) 
    ctx := Context{
        input: ui.new_textbox(wnd), 
    }
    ctx.input.set_placeholder('Enter your name')
    wnd.set_user_ptr(ctx)
    btn := ui.new_button(wnd, 'Click me', btn_click)
    for {
        ui.wait_events()
    }
}

// btn_click receives parent window's user pointer 
fn btn_click(ctx Context) { 
    name := ctx.input.text()
    ui.alert('Hello, $name!')
}