annotate backendutils.rhope @ 90:c25d75c2440b

Implemented Next@Dictionary and Print@Dictionary
author Mike Pavone <pavone@retrodev.com>
date Sat, 31 Jul 2010 15:08:15 -0400
parents 0083b2f7b3c7
children e73a93fb5de1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
2 Escape Rhope Name NU[name:escaped]
12
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 {
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
4 escaped <- [[[[[[[[[[[[[[[[[[[[[[[name]Replace["_","UN_"]
48
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
5 ]Replace["@","AT_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
6 ]Replace[" ","SP_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
7 ]Replace[":","CN_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
8 ]Replace["?","QN_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
9 ]Replace["+","PL_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
10 ]Replace["-","MN_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
11 ]Replace["*","TM_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
12 ]Replace["/","DV_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
13 ]Replace["<","LT_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
14 ]Replace[">","GT_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
15 ]Replace["(","LP_"]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
16 ]Replace[")","RP_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
17 ]Replace["!","NT_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
18 ]Replace["=","EQ_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
19 ]Replace["'","PR_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
20 ]Replace["\"","DP_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
21 ]Replace["\t","TB_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
22 ]Replace[",", "CM_"]
75
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
23 ]Replace[".", "PD_"]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
24 ]Replace["\n", "NL_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
25 ]Replace["{", "LC_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
26 ]Replace["}", "RC_"]
12
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 }
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
28
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
29 Escape Rhope Name[name:escaped]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
30 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
31 escaped <- Escape Rhope Name NU[[name]Replace["_","__"]]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
32 }
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
33
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
34 Blueprint AddRef
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
35 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
36 Value
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
37 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
38
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
39 AddRef[value:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
40 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
41 out <- [Build["AddRef"]]Value <<[value]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
42 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
43
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
44 Make Op@AddRef[addref,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
45 {
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
46 //TODO: Make me work with other backends
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
47 out <- [["add_ref((object *)"]Append[ [[addref]Value >>]Make Op[func] ]]Append[")"]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
48 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
49
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
50 Strip Addref@AddRef[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
51 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
52 out <- [[op]Value >>]Strip Addref
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
53 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
54
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
55 Make Op@String[string,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
56 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
57 out <- [func]Resolve[string]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
58 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
59
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
60 Strip Addref@String[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
61 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
62 out <- op
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
63 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
64
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
65 Make Op@Whole Number[num,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
66 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
67 out <- num
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
68 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
69
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
70 Strip Addref@Whole Number[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
71 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
72 out <- op
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
73 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
74
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
75 Make Op@Real Number[num,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
76 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
77 out <- num
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
78 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
79
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
80 Strip Addref@Real Number[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
81 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
82 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
83 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
84
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
85 Blueprint Output
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
86 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
87 Name
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
88 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
89
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
90 Output[name:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
91 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
92 out <- [Build["Output"]]Name <<[name]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
93 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
94
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
95 Make Op@Output[op,func:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
96 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
97 out <- [func]Resolve Output[[op]Name >>]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
98 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
99
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
100 Strip Addref@Output[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
101 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
102 out <- op
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
103 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
104
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
105 Blueprint Constant
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
106 {
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
107 Value
74
a844c623c7df Add support for Worker type
Mike Pavone <pavone@retrodev.com>
parents: 49
diff changeset
108 Need Addref
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
109 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
110
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
111 Constant[var:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
112 {
74
a844c623c7df Add support for Worker type
Mike Pavone <pavone@retrodev.com>
parents: 49
diff changeset
113 out <- [[Build["Constant"]]Value <<[var]]Need Addref <<[Yes]
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
114 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
115
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
116 Make Op@Constant[const,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
117 {
74
a844c623c7df Add support for Worker type
Mike Pavone <pavone@retrodev.com>
parents: 49
diff changeset
118 out <- [func]Lookup Constant[[const]Value >>, [const]Need Addref >>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
119 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
120
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
121 Strip Addref@Constant[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
122 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
123 out <- [op]Need Addref <<[No]
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
124 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
125
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
126 Blueprint Result
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
127 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
128 Output Num
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
129 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
130
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
131 Result[num:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
132 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
133 out <- [Build["Result"]]Output Num <<[num]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
134 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
135
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
136 Make Op@Result[result,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
137 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
138 out <- [func]Result Reference[[result]Output Num>>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
139 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
140
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
141 Strip Addref@Result[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
142 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
143 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
144 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
145
75
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
146 Blueprint Check Result
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
147 {
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
148 Output Num
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
149 }
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
150
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
151 Check Result[num:out]
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
152 {
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
153 out <- [Build["Check Result"]]Output Num <<[num]
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
154 }
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
155
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
156 Make Op@Check Result[result,func:out]
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
157 {
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
158 out <- [func]Checked Result Reference[[result]Output Num>>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
159 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
160
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
161 Strip Addref@Check Result[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
162 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
163 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
164 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
165
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
166 Make Condition[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
167 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
168 If[[Type Of[op]]=["OrValue"]]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
169 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
170 out <- OrCond[Make Condition[[op]Left >>], Make Condition[[op]Right >>]]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
171 }{
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
172 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
173 }
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
174 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
175
21
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
176 Blueprint OrValue
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
177 {
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
178 Left
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
179 Right
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
180 }
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
181
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
182 OrValue[left,right:out]
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
183 {
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
184 out <- [[Build["OrValue"]]Left <<[left]]Right <<[right]
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
185 }
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
186
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
187 Make Op@OrValue[orval,func:out]
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
188 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
189 out <- [func]If Null Else[[orval]Left >>, [orval]Right >>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
190 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
191
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
192 Strip Addref@OrValue[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
193 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
194 out <- [[op]Left <<[ [[op]Left >>]Strip Addref ]]Right <<[ [[op]Right >>]Strip Addref ]
21
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
195 }
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
196
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
197 Blueprint NotCond
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
198 {
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
199 Condition
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
200 }
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
201
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
202 NotCond[cond:out]
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
203 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
204 out <- [Build["NotCond"]]Condition <<[[cond]Strip Addref]
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
205 }
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
206
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
207 Make Op@NotCond[cond,func:out]
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
208 {
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
209 out <- ["!"]Append[[[cond]Condition >>]Make Op[func]]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
210 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
211
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
212 Strip Addref@NotCond[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
213 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
214 out <- op
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
215 }
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
216
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
217 Blueprint OrCond
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
218 {
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
219 Condition1
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
220 Condition2
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
221 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
222
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
223 OrCond[cond1,cond2:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
224 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
225 out <- [[Build["OrCond"]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
226 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
227
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
228 Make Op@OrCond[cond,func:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
229 {
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
230 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" || "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
231 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
232
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
233 Strip Addref@OrCond[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
234 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
235 out <- op
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
236 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
237
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
238 Blueprint AndCond
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
239 {
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
240 Condition1
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
241 Condition2
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
242 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
243
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
244 AndCond[cond1,cond2:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
245 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
246 out <- [[Build["AndCond"]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
247 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
248
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
249 Make Op@AndCond[cond,func:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
250 {
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
251 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" && "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
252 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
253
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
254 Strip Addref@AndCond[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
255 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
256 out <- op
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
257 }
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
258
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
259 Blueprint Field Ref
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
260 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
261 Variable
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
262 Field
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
263 }
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
264
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
265 Field Ref[var,field:out]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
266 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
267 out <- [[Build["Field Ref"]]Variable <<[var]]Field <<[field]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
268 }
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
269
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
270 Make Op@Field Ref[ref,func:out]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
271 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
272 out <- [func]Field Result[[ref]Variable >>,[ref]Field >>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
273 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
274
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
275 Strip Addref@Field Ref[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
276 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
277 out <- op
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
278 }
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
279
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
280 Blueprint Type Instance
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
281 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
282 Name
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
283 Params
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
284 Variant
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
285 Mutable?
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
286 }
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
287
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
288 Type Instance[raw name:out]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
289 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
290 If[[raw name]=[""]]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
291 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
292 name <- "Any Type"
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
293 }{
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
294 name <- raw name
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
295 }
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
296 out <- [[[[Build["Type Instance"]]Name <<[name]]Params <<[()]]Variant <<["Boxed"]]Mutable? <<[No]
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
297 }
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
298
42
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
299 Set Variant@Type Instance[type,variant:out,invalid]
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
300 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
301 [("Boxed","Naked","Pointer","Raw Pointer")]Find[variant]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
302 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
303 out <- [type]Variant <<[variant]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
304 }{
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
305 invalid <- type
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
306 }
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
307 }
42
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
308
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
309 =@Type Instance[type,compare:out]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
310 {
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
311 If[[Type Of[compare]] = ["String"]]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
312 {
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
313 out <- [[type]Name >>] = [compare]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
314 }{
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
315 //TODO: Compare parameters
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
316 ,out <- If[[[type]Name >>] = [[compare]Name >>]]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
317 { out <- [[type]Variant >>] = [[compare]Variant >>] }
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
318 }
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
319 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
320
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
321 Blueprint Worker Literal
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
322 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
323 Name
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
324 Args
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
325 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
326
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
327 Worker Literal[name:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
328 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
329 out <- [[Build["Worker Literal"]]Name <<[name]]Args <<[()]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
330 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
331
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
332 Set Input@Worker Literal[worker,argnum,val:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
333 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
334 out <- [worker]Args <<[ [[worker]Args >>]Set[argnum, val] ]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
335 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
336