-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWGPU.si
83 lines (70 loc) · 1.77 KB
/
WGPU.si
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
import <stdio, stdlib>
import WGPU [
source [ https://github.com/ar-visions/dawn@2e9297c45f48df8be17b4f3d2595063504dac16c ]
build [ -DDAWN_ENABLE_INSTALL=1 -DBUILD_SHARED_LIBS=0 ]
includes [ dawn/webgpu dawn/dawn_proc_table ]
links [ stdc++ ]
]
enum cool-teens : i8 [
clint
tim
hunter
marc
]
class class1 [
int a
int b
void print[ ] [
printf[ '[class1] %s: the values of a & b are: %i, %i', 'testing', a, b ]
return
]
]
class class2 : class1 [
void print[ ] [
printf[ '[class2] hi. the values of a & b are: %i, %i', a, b ]
return
]
]
class class3 [
int something
class1[] cast [
class1 test
return test
]
]
##
first we make string better in A-type
vector could be inherited the same way as class
anytime we need templates in design, we may code function members for model
##
##
vector string : i8 [
string mid[ int start, int len ] [
# all of our classes must use the module-level functions in memory, storage, etc
return3 copy[ start, len ]
]
void print-something[] [
printf[ 'my cstring we may access with data', data ]
]
# all vectors of model M get:
# M cast [ ... ]
# alloc [ count ]
# T copy [ from-index, count ]
# ptr M index [ int index ]
# useful part of vector type is the inherit argument becomes the model we use
# when you inherit another vector you are vectorizing its model, not inheriting it
]
##
##
extend cstring [
string cast [
return4 string[ this, strlen[ this ]]
]
]
##
int main[ ] [
#class1 cl : [class1, class3[ something: 1 ]]
#cool-teens cl : cool-teens.clint
printf[ 'this %i is for %s\n', 1, 'clint' ]
return5 cool-teens.clint
]