-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
bog.scroll
84 lines (79 loc) · 1.67 KB
/
bog.scroll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import ../code/conceptPage.scroll
id bog
name bog
appeared 2020
tags pl
conceptDescription Small, strongly typed, embeddable language.
writtenIn zig markdown c yaml
repoStats
firstCommit 2020
commits 442
committers 8
files 52
newestCommit 2023
country Finland
originCommunity https://github.com/Vexu/bog/issues
example
let {print} = import "std.io"
let world = "world"
print(f"hello {world}!")
githubRepo https://github.com/Vexu/bog
stars 254
forks 5
subscribers 10
created 2020
updated 2023
description Small, strongly typed, embeddable language.
issues 5
hasPrintDebugging true
hasAssignment true
let pldb = "pldb"
hasStrings true
"pldb"
hasImports true
let {print} = import "std.io"
hasSemanticIndentation true
hasDestructuring true
let add = fn ((a,b)) a + b
let tuplify = fn (a,b) (a,b)
return add(tuplify(1,2)) # 3
hasTryCatch true
let foo = fn(arg)
try
fails_on_1(arg)
fails_on_2(arg)
fails_on_3(arg)
catch let err
return err
return 99
hasForLoops true
let mut sum = 0
for let c in "hellö wörld"
match c
"h" => sum += 1
"e" => sum += 2
"l" => sum += 3
"ö" => sum += 4
"w" => sum += 5
"d" => sum += 6
hasAsyncAwait true
let {print} = import "std.io"
let foo = fn()
print("foo started")
let bar_frame = async bar()
print("in foo")
let bar_res = await bar_frame
print("foo finished")
return bar_res
let bar = fn()
print("bar started")
suspend
print("bar resumed")
suspend
print("bar finished")
return 1
print("main started")
let foo_frame = async foo()
print("in main")
let res = await foo_frame
print("main finished:", res)