- The easier to learn, the better.
- Best if easy to mentally parse "at a glance".
- Easy to understand structure "at a glance".
- Easy to type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax: | |
# [key] <name> [attributes] [types] | |
type Sprite | |
{ | |
var pos Vector | |
var rot Rotation | |
} | |
type Ship Sprite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Person | |
{ | |
var name : text | |
var age : uint | |
init new(.name, .age=) | |
init load(path) { # load from path # } | |
func greet() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Foo = | |
value : int | |
init Foo.new(v) = | |
value = v | |
proc Foo.bar = | |
echo(value) | |
proc main = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() | |
{ | |
var nums = text[] # a dynamic array | |
ref n : text # a 'int' reference | |
nums += "foo" # add "foo" | |
nums += "bar" # add "bar" | |
nums += "baz" # add "baz" | |
n => nums[1] # 'n' refers to 'num[1]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Foo | |
{ | |
var bar = 0 | |
} | |
func main() | |
{ | |
ref f : Foo | |
ref b : int | |
NewerOlder