Program structure

Your every project has to have a main file. By default that is, but that can be changed using the main flag. In your main file you need to declare an init function, which needs to be exported. If it isn't exported, you will receive this error:

error: <PWD>/ (4, 11): Unknown identifier init

In this function, you can set up the window, load resources and register to the window.onFrame signal. This signal is emitted on every frame. The following script will print "init" when it is launched and then follow up by printing "frame" on every frame.

import (

fn init*() {
    window.setup("Main file structure example")