SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.10
===================================================
Byte Code - Before Execution by the VM
===================================================
PC OPCode Data
1 ReturnNull
2 Func main
3 NewLine 2
4 FuncExE
5 PushC Hello World
6 LoadA nl 0
7 PushV
8 SUM 0
9 Print
10 NewLine 3
11 ExitMark 29 28
12 LoadAFirst x
13 PushN 1.000000
14 BeforeEqual 0
15 Assignment
16 PushN 1.000000
17 StepNumber
18 JumpVarLENum x 10.000000 29
19 NewLine 4
20 FuncExE
21 LoadA x 0
22 PushV
23 LoadA nl 0
24 PushV
25 SUM 0
26 Print
27 NewLine 5
28 IncJump x 18
29 POPExitMark
30 POPStep
31 NewLine 6
32 LoadFunc test
33 Call 0
34 NoOperation
35 NewLine 8
36 PushV
37 FreeStack
38 ReturnNull
39 Func test
40 NewLine 9
41 FuncExE
42 PushC welcome
43 LoadA nl 0
44 PushV
45 SUM 0
46 Print
47 NewLine 10
48 LoadA o1 0
49 AssignmentPointer
50 New point
51 SetScope
52 PushV
74.3. Printing Intermediate Code 848
Ring Documentation, Release 1.10
53 BraceStart
54 LoadA x 0 58
55 AssignmentPointer
56 PushN 10.000000
57 BeforeEqual 0
58 Assignment 0 0
59 FreeStack
60 LoadA y 0 64
61 AssignmentPointer
62 PushN 20.000000
63 BeforeEqual 0
64 Assignment 0 0
65 FreeStack
66 LoadA z 0 70
67 AssignmentPointer
68 PushN 30.000000
69 BeforeEqual 0
70 Assignment 0 0
71 FreeStack
72 LoadFunc ismethod
73 LoadA self 0
74 PushV
75 PushC braceend
76 Call
77 NoOperation
78 PushV
79 JumpZ 85
80 LoadFunc braceend
81 Call
82 NoOperation
83 PushV
84 FreeStack
85 BraceEnd
86 FreeStack
87 NewLine 11
88 FuncExE
89 LoadA o1 0
90 PushV
91 Print
92 NewLine 13
93 ReturnNull
94 Class point 006E8BC0
95 NewLabel
96 LoadA x 0
97 PushV
98 FreeStack
99 LoadA y 0
100 PushV
101 FreeStack
102 LoadA z 0
103 PushV
104 FreeStack
105 ReturnNull
===================================================
74.3. Printing Intermediate Code 849
Ring Documentation, Release 1.10
74.4 Printing Final Intermediate Code
Command:
ring test.ring -icfinal
Output:
Hello World
1
2
3
4
5
6
7
8
9
10
welcome
x: 10.000000
y: 20.000000
z: 30.000000
===================================================
Byte Code - After Execution by the VM
===================================================
PC OPCode Data
1 ReturnNull
2 Func main
3 NewLine 2
4 FuncExE
5 PushC Hello World
6 PushP 007D3670 0
7 PushV
8 SUM 0
9 Print
10 NewLine 3
11 ExitMark 29 28
12 LoadAFirst x
13 PushN 1.000000
14 BeforeEqual 0
15 Assignment
16 PushN 1.000000
17 StepNumber
18 JumpVarLPLENum x 10.000000 29
19 NewLine 4
20 FuncExE
21 PushPLocal x 0
22 PushV
23 PushP 007D3670 0
24 PushV
25 SUM 0
26 Print
27 NewLine 5
74.4. Printing Final Intermediate Code 850
Ring Documentation, Release 1.10
28 IncLPJump x 18
29 POPExitMark
30 POPStep
31 NewLine 6
32 LoadFuncP test
33 Call 0
34 NoOperation
35 NewLine 8
36 PushV
37 FreeStack
38 ReturnNull
39 Func test
40 NewLine 9
41 FuncExE
42 PushC welcome
43 PushP 007D3670 0
44 PushV
45 SUM 0
46 Print
47 NewLine 10
48 PushPLocal o1 0
49 AssignmentPointer
50 New point
51 SetScope
52 PushV
53 BraceStart
54 LoadA x 0 58
55 AssignmentPointer
56 PushN 10.000000
57 BeforeEqual 0
58 SetProperty 0 106
59 FreeStack
60 LoadA y 0 64
61 AssignmentPointer
62 PushN 20.000000
63 BeforeEqual 0
64 SetProperty 0 141
65 FreeStack
66 LoadA z 0 70
67 AssignmentPointer
68 PushN 30.000000
69 BeforeEqual 0
70 SetProperty 0 176
71 FreeStack
72 LoadFunc ismethod
73 LoadA self 0
74 PushV
75 PushC braceend
76 Call
77 NoOperation
78 PushV
79 JumpZ 85
80 LoadFunc braceend
81 Call
82 NoOperation
83 PushV
84 FreeStack
85 BraceEnd
74.4. Printing Final Intermediate Code 851
Ring Documentation, Release 1.10
86 FreeStack
87 NewLine 11
88 FuncExE
89 PushPLocal o1 0
90 PushV
91 Print
92 NewLine 13
93 ReturnNull
94 Class point 007D8470
95 NewLabel
96 LoadA x 0
97 PushV
98 FreeStack
99 LoadA y 0
100 PushV
101 FreeStack
102 LoadA z 0
103 PushV
104 FreeStack
105 ReturnNull
106 LoadFunc ismethod
107 LoadA ring_gettemp_var 0
108 PushV
109 PushC setx
110 Call 0
111 NoOperation
112 PushV
113 JumpZ 132
114 NewLine 2
115 LoadA ring_gettemp_var 0
116 LoadMethod setx
117 LoadA ring_settemp_var 0
118 PushV
119 Call 0 1
120 AfterCallMethod
121 PushV
122 FreeStack
123 NewLine 3
124 LoadA ring_tempflag_var 0 128
125 AssignmentPointer
126 PushN 0.000000
127 BeforeEqual 0
128 Assignment 0 0
129 FreeStack
130 NewLine 4
131 Jump 140
132 NewLine 5
133 PushP 007D37D8 0 137
134 AssignmentPointer
135 PushN 1.000000
136 BeforeEqual 0
137 Assignment 0 0
138 FreeStack
139 NewLine 6
140 Return
141 LoadFunc ismethod
142 LoadA ring_gettemp_var 0
143 PushV
74.4. Printing Final Intermediate Code 852
Ring Documentation, Release 1.10
144 PushC sety
145 Call 0
146 NoOperation
147 PushV
148 JumpZ 167
149 NewLine 2
150 LoadA ring_gettemp_var 0
151 LoadMethod sety
152 LoadA ring_settemp_var 0
153 PushV
154 Call 0 1
155 AfterCallMethod
156 PushV
157 FreeStack
158 NewLine 3
159 LoadA ring_tempflag_var 0 163
160 AssignmentPointer
161 PushN 0.000000
162 BeforeEqual 0
163 Assignment 0 0
164 FreeStack
165 NewLine 4
166 Jump 175
167 NewLine 5
168 PushP 007D37D8 0 172
169 AssignmentPointer
170 PushN 1.000000
171 BeforeEqual 0
172 Assignment 0 0
173 FreeStack
174 NewLine 6
175 Return
176 LoadFunc ismethod
177 LoadA ring_gettemp_var 0
178 PushV
179 PushC setz
180 Call 0
181 NoOperation
182 PushV
183 JumpZ 202
184 NewLine 2
185 LoadA ring_gettemp_var 0
186 LoadMethod setz
187 LoadA ring_settemp_var 0
188 PushV
189 Call 0 1
190 AfterCallMethod
191 PushV
192 FreeStack
193 NewLine 3
194 LoadA ring_tempflag_var 0 198
195 AssignmentPointer
196 PushN 0.000000
197 BeforeEqual 0
198 Assignment 0 0
199 FreeStack
200 NewLine 4
201 Jump 210
74.4. Printing Final Intermediate Code 853
Ring Documentation, Release 1.10
202 NewLine 5
203 PushP 007D37D8 0 207
204 AssignmentPointer
205 PushN 1.000000
206 BeforeEqual 0
207 Assignment 0 0
208 FreeStack
209 NewLine 6
210 Return
===================================================
74.5 CGI Support
Command:
ring test.ring -cgi
74.6 No Run
Command:
ring test.ring -norun
74.7 Printing Instruction Operation Code
Command:
ring test.ring -ins
Output:
===================================================
Operation : ReturnNull
PC : 1
Line Number : 1 , File test.ring
SP (After) : 0 - FuncSP : 0
LineNumber 1
===================================================
.....
.....
.....
Tip: Output removed from the previous example because it’s very large!
74.8 Performance
Command:
74.5. CGI Support 854
Ring Documentation, Release 1.10
ring test.ring -performance
Output:
===================================================
Date : 2015/09/15 Time : 15:56:17
Clock : 0
===================================================
Hello World
1
2
3
4
5
6
7
8
9
10
welcome
x: 10.000000
y: 20.000000
z: 30.000000
===================================================
Date : 2015/09/15 Time : 15:56:17
Clock : 0
===================================================
74.9 Generate Object File
You can generate object file (.ringo) from your source code file (.ring) using -go option
Tip: You will get one object file to use for distributing/running your application which may contains one or many
ring source files that you can keep or distribute based on the application (commercial or open source).
Command:
ring test.ring -go
To run the compiled object file
ring test.ringo
74.9. Generate Object File 855
CHAPTER
SEVENTYFIVE
PERFORMANCE TIPS
In this chapter we will learn more about the Ring performance.
75.1 Introduction
Ring is designed to be a simple, small and flexible language in the first place, but also it is fast enough for many
applications.
Ring can do each of the next tasks in around 1 second using normal computers in the market during the last 5 years
1. Compiling 100,000 lines of code
2. Executing empty loop that count from 1 to 10,000,000
3. Executing 1000 search operation using linear search in a list contains 100,000 items, trying to find the last item
(The worst case)
4. Creating list contains 1,000,000 items then summing all of the list items
5. Adding 20,000 items to the ListWidget in GUI applications
6. Adding 5,000 nodes to the TreeWidget in GUI applications
7. Printing 10,000 messages to the terminal in Console applications
Also when we need more speed we can use C/C++ extensions!
Example:
? "Create list contains 100,000 items"
aList = 1:100000
? "Do 1000 search operation - Find the last item (Worst Case!)"
c = clock()
for t = 1 to 1000
find(alist,100000)
next
? "Time: " + ( clock() - c ) / clockspersecond() + " seconds"
Output:
Create list contains 100,000 items
Do 1000 search operation - Find the last item (Worst Case!)
Time: 0.87 seconds
856
Ring Documentation, Release 1.10
Example:
load "guilib.ring"
func main
new qApp {
win = new qWidget() {
move(100,100) resize(500,500)
setWindowTitle("Many Tree Items - Testing Performance")
tree = new qTreeWidget(win) {
blocksignals(True) setUpdatesEnabled(False)
root = new qTreeWidgetItem()
root.setText(0,"The Root Node")
t1 = clock()
for t = 1 to 5000
oItem = new qTreeWidgetItem()
oItem.settext(0,"Item " + t)
root.addchild(oItem)
next
cTime = (clock()-t1)/clockspersecond()
setHeaderLabel("Creating 5000 nodes in " + cTime + " seconds.")
addTopLevelItem(root)
expanditem(root)
blocksignals(False) setUpdatesEnabled(True)
}
oLayout = new qVBoxLayout() {
addWidget(tree)
}
setLayout(oLayout)
show()
}
exec()
}
Output:
75.1. Introduction 857

More Related Content

What's hot

The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180Mahmoud Samir Fayed
 
Numerical Methods with Computer Programming
Numerical Methods with Computer ProgrammingNumerical Methods with Computer Programming
Numerical Methods with Computer ProgrammingUtsav Patel
 
Windows debugging sisimon
Windows debugging   sisimonWindows debugging   sisimon
Windows debugging sisimonSisimon Soman
 
The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185Mahmoud Samir Fayed
 
API Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random movesAPI Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random movesYao Yao
 
The Ring programming language version 1.6 book - Part 55 of 189
The Ring programming language version 1.6 book - Part 55 of 189The Ring programming language version 1.6 book - Part 55 of 189
The Ring programming language version 1.6 book - Part 55 of 189Mahmoud Samir Fayed
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersConnor McDonald
 
Ethereum virtual machine for Developers Part 1
Ethereum virtual machine for Developers Part 1Ethereum virtual machine for Developers Part 1
Ethereum virtual machine for Developers Part 1ArcBlock
 
Show Us: SS7 Update
Show Us: SS7 UpdateShow Us: SS7 Update
Show Us: SS7 UpdateESUG
 
Node.js flow control
Node.js flow controlNode.js flow control
Node.js flow controlSimon Su
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event LoopDesignveloper
 
Mnesiaで分散ノードに入門してみた
Mnesiaで分散ノードに入門してみたMnesiaで分散ノードに入門してみた
Mnesiaで分散ノードに入門してみたTakahiro Kobaru
 
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~Atsushi Torikoshi
 
Program(Output)
Program(Output)Program(Output)
Program(Output)princy75
 

What's hot (20)

GenServer in action
GenServer in actionGenServer in action
GenServer in action
 
The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180
 
Numerical Methods with Computer Programming
Numerical Methods with Computer ProgrammingNumerical Methods with Computer Programming
Numerical Methods with Computer Programming
 
Windows debugging sisimon
Windows debugging   sisimonWindows debugging   sisimon
Windows debugging sisimon
 
The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185
 
API Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random movesAPI Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random moves
 
The Ring programming language version 1.6 book - Part 55 of 189
The Ring programming language version 1.6 book - Part 55 of 189The Ring programming language version 1.6 book - Part 55 of 189
The Ring programming language version 1.6 book - Part 55 of 189
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
Ethereum virtual machine for Developers Part 1
Ethereum virtual machine for Developers Part 1Ethereum virtual machine for Developers Part 1
Ethereum virtual machine for Developers Part 1
 
Introducing to Asynchronous Programming
Introducing to Asynchronous  ProgrammingIntroducing to Asynchronous  Programming
Introducing to Asynchronous Programming
 
Show Us: SS7 Update
Show Us: SS7 UpdateShow Us: SS7 Update
Show Us: SS7 Update
 
ESUG15: SS7 Update
ESUG15: SS7 UpdateESUG15: SS7 Update
ESUG15: SS7 Update
 
Node.js flow control
Node.js flow controlNode.js flow control
Node.js flow control
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Mnesiaで分散ノードに入門してみた
Mnesiaで分散ノードに入門してみたMnesiaで分散ノードに入門してみた
Mnesiaで分散ノードに入門してみた
 
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
 
Program(Output)
Program(Output)Program(Output)
Program(Output)
 
Kotlin Coroutines - the new async
Kotlin Coroutines - the new asyncKotlin Coroutines - the new async
Kotlin Coroutines - the new async
 

Similar to The Ring programming language version 1.10 book - Part 89 of 212

The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180 The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180 Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 99 of 210
The Ring programming language version 1.9 book - Part 99 of 210The Ring programming language version 1.9 book - Part 99 of 210
The Ring programming language version 1.9 book - Part 99 of 210Mahmoud Samir Fayed
 
TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.lnikolaeva
 
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 9 of 189
The Ring programming language version 1.6 book - Part 9 of 189The Ring programming language version 1.6 book - Part 9 of 189
The Ring programming language version 1.6 book - Part 9 of 189Mahmoud Samir Fayed
 
Quantum Computing Notes Ver1.0
Quantum Computing Notes Ver1.0Quantum Computing Notes Ver1.0
Quantum Computing Notes Ver1.0Vijayananda Mohire
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 10 of 212
The Ring programming language version 1.10 book - Part 10 of 212The Ring programming language version 1.10 book - Part 10 of 212
The Ring programming language version 1.10 book - Part 10 of 212Mahmoud Samir Fayed
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestConnor McDonald
 
The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196Mahmoud Samir Fayed
 
PID Tuning using Ziegler Nicholas - MATLAB Approach
PID Tuning using Ziegler Nicholas - MATLAB ApproachPID Tuning using Ziegler Nicholas - MATLAB Approach
PID Tuning using Ziegler Nicholas - MATLAB ApproachWaleed El-Badry
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealTzung-Bi Shih
 
Arduino programming 101
Arduino programming 101Arduino programming 101
Arduino programming 101visual28
 

Similar to The Ring programming language version 1.10 book - Part 89 of 212 (20)

The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202
 
The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84
 
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
 
The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180 The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180
 
The Ring programming language version 1.9 book - Part 99 of 210
The Ring programming language version 1.9 book - Part 99 of 210The Ring programming language version 1.9 book - Part 99 of 210
The Ring programming language version 1.9 book - Part 99 of 210
 
TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.
 
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210
 
Erlang/OTP in Riak
Erlang/OTP in RiakErlang/OTP in Riak
Erlang/OTP in Riak
 
The Ring programming language version 1.6 book - Part 9 of 189
The Ring programming language version 1.6 book - Part 9 of 189The Ring programming language version 1.6 book - Part 9 of 189
The Ring programming language version 1.6 book - Part 9 of 189
 
Quantum Computing Notes Ver1.0
Quantum Computing Notes Ver1.0Quantum Computing Notes Ver1.0
Quantum Computing Notes Ver1.0
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212
 
The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194
 
The Ring programming language version 1.10 book - Part 10 of 212
The Ring programming language version 1.10 book - Part 10 of 212The Ring programming language version 1.10 book - Part 10 of 212
The Ring programming language version 1.10 book - Part 10 of 212
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolest
 
The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196
 
C++ file
C++ fileC++ file
C++ file
 
PID Tuning using Ziegler Nicholas - MATLAB Approach
PID Tuning using Ziegler Nicholas - MATLAB ApproachPID Tuning using Ziegler Nicholas - MATLAB Approach
PID Tuning using Ziegler Nicholas - MATLAB Approach
 
C# Loops
C# LoopsC# Loops
C# Loops
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
 
Arduino programming 101
Arduino programming 101Arduino programming 101
Arduino programming 101
 

More from Mahmoud Samir Fayed

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212Mahmoud Samir Fayed
 

More from Mahmoud Samir Fayed (20)

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212
 

Recently uploaded

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 

Recently uploaded (20)

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 

The Ring programming language version 1.10 book - Part 89 of 212

  • 1. Ring Documentation, Release 1.10 =================================================== Byte Code - Before Execution by the VM =================================================== PC OPCode Data 1 ReturnNull 2 Func main 3 NewLine 2 4 FuncExE 5 PushC Hello World 6 LoadA nl 0 7 PushV 8 SUM 0 9 Print 10 NewLine 3 11 ExitMark 29 28 12 LoadAFirst x 13 PushN 1.000000 14 BeforeEqual 0 15 Assignment 16 PushN 1.000000 17 StepNumber 18 JumpVarLENum x 10.000000 29 19 NewLine 4 20 FuncExE 21 LoadA x 0 22 PushV 23 LoadA nl 0 24 PushV 25 SUM 0 26 Print 27 NewLine 5 28 IncJump x 18 29 POPExitMark 30 POPStep 31 NewLine 6 32 LoadFunc test 33 Call 0 34 NoOperation 35 NewLine 8 36 PushV 37 FreeStack 38 ReturnNull 39 Func test 40 NewLine 9 41 FuncExE 42 PushC welcome 43 LoadA nl 0 44 PushV 45 SUM 0 46 Print 47 NewLine 10 48 LoadA o1 0 49 AssignmentPointer 50 New point 51 SetScope 52 PushV 74.3. Printing Intermediate Code 848
  • 2. Ring Documentation, Release 1.10 53 BraceStart 54 LoadA x 0 58 55 AssignmentPointer 56 PushN 10.000000 57 BeforeEqual 0 58 Assignment 0 0 59 FreeStack 60 LoadA y 0 64 61 AssignmentPointer 62 PushN 20.000000 63 BeforeEqual 0 64 Assignment 0 0 65 FreeStack 66 LoadA z 0 70 67 AssignmentPointer 68 PushN 30.000000 69 BeforeEqual 0 70 Assignment 0 0 71 FreeStack 72 LoadFunc ismethod 73 LoadA self 0 74 PushV 75 PushC braceend 76 Call 77 NoOperation 78 PushV 79 JumpZ 85 80 LoadFunc braceend 81 Call 82 NoOperation 83 PushV 84 FreeStack 85 BraceEnd 86 FreeStack 87 NewLine 11 88 FuncExE 89 LoadA o1 0 90 PushV 91 Print 92 NewLine 13 93 ReturnNull 94 Class point 006E8BC0 95 NewLabel 96 LoadA x 0 97 PushV 98 FreeStack 99 LoadA y 0 100 PushV 101 FreeStack 102 LoadA z 0 103 PushV 104 FreeStack 105 ReturnNull =================================================== 74.3. Printing Intermediate Code 849
  • 3. Ring Documentation, Release 1.10 74.4 Printing Final Intermediate Code Command: ring test.ring -icfinal Output: Hello World 1 2 3 4 5 6 7 8 9 10 welcome x: 10.000000 y: 20.000000 z: 30.000000 =================================================== Byte Code - After Execution by the VM =================================================== PC OPCode Data 1 ReturnNull 2 Func main 3 NewLine 2 4 FuncExE 5 PushC Hello World 6 PushP 007D3670 0 7 PushV 8 SUM 0 9 Print 10 NewLine 3 11 ExitMark 29 28 12 LoadAFirst x 13 PushN 1.000000 14 BeforeEqual 0 15 Assignment 16 PushN 1.000000 17 StepNumber 18 JumpVarLPLENum x 10.000000 29 19 NewLine 4 20 FuncExE 21 PushPLocal x 0 22 PushV 23 PushP 007D3670 0 24 PushV 25 SUM 0 26 Print 27 NewLine 5 74.4. Printing Final Intermediate Code 850
  • 4. Ring Documentation, Release 1.10 28 IncLPJump x 18 29 POPExitMark 30 POPStep 31 NewLine 6 32 LoadFuncP test 33 Call 0 34 NoOperation 35 NewLine 8 36 PushV 37 FreeStack 38 ReturnNull 39 Func test 40 NewLine 9 41 FuncExE 42 PushC welcome 43 PushP 007D3670 0 44 PushV 45 SUM 0 46 Print 47 NewLine 10 48 PushPLocal o1 0 49 AssignmentPointer 50 New point 51 SetScope 52 PushV 53 BraceStart 54 LoadA x 0 58 55 AssignmentPointer 56 PushN 10.000000 57 BeforeEqual 0 58 SetProperty 0 106 59 FreeStack 60 LoadA y 0 64 61 AssignmentPointer 62 PushN 20.000000 63 BeforeEqual 0 64 SetProperty 0 141 65 FreeStack 66 LoadA z 0 70 67 AssignmentPointer 68 PushN 30.000000 69 BeforeEqual 0 70 SetProperty 0 176 71 FreeStack 72 LoadFunc ismethod 73 LoadA self 0 74 PushV 75 PushC braceend 76 Call 77 NoOperation 78 PushV 79 JumpZ 85 80 LoadFunc braceend 81 Call 82 NoOperation 83 PushV 84 FreeStack 85 BraceEnd 74.4. Printing Final Intermediate Code 851
  • 5. Ring Documentation, Release 1.10 86 FreeStack 87 NewLine 11 88 FuncExE 89 PushPLocal o1 0 90 PushV 91 Print 92 NewLine 13 93 ReturnNull 94 Class point 007D8470 95 NewLabel 96 LoadA x 0 97 PushV 98 FreeStack 99 LoadA y 0 100 PushV 101 FreeStack 102 LoadA z 0 103 PushV 104 FreeStack 105 ReturnNull 106 LoadFunc ismethod 107 LoadA ring_gettemp_var 0 108 PushV 109 PushC setx 110 Call 0 111 NoOperation 112 PushV 113 JumpZ 132 114 NewLine 2 115 LoadA ring_gettemp_var 0 116 LoadMethod setx 117 LoadA ring_settemp_var 0 118 PushV 119 Call 0 1 120 AfterCallMethod 121 PushV 122 FreeStack 123 NewLine 3 124 LoadA ring_tempflag_var 0 128 125 AssignmentPointer 126 PushN 0.000000 127 BeforeEqual 0 128 Assignment 0 0 129 FreeStack 130 NewLine 4 131 Jump 140 132 NewLine 5 133 PushP 007D37D8 0 137 134 AssignmentPointer 135 PushN 1.000000 136 BeforeEqual 0 137 Assignment 0 0 138 FreeStack 139 NewLine 6 140 Return 141 LoadFunc ismethod 142 LoadA ring_gettemp_var 0 143 PushV 74.4. Printing Final Intermediate Code 852
  • 6. Ring Documentation, Release 1.10 144 PushC sety 145 Call 0 146 NoOperation 147 PushV 148 JumpZ 167 149 NewLine 2 150 LoadA ring_gettemp_var 0 151 LoadMethod sety 152 LoadA ring_settemp_var 0 153 PushV 154 Call 0 1 155 AfterCallMethod 156 PushV 157 FreeStack 158 NewLine 3 159 LoadA ring_tempflag_var 0 163 160 AssignmentPointer 161 PushN 0.000000 162 BeforeEqual 0 163 Assignment 0 0 164 FreeStack 165 NewLine 4 166 Jump 175 167 NewLine 5 168 PushP 007D37D8 0 172 169 AssignmentPointer 170 PushN 1.000000 171 BeforeEqual 0 172 Assignment 0 0 173 FreeStack 174 NewLine 6 175 Return 176 LoadFunc ismethod 177 LoadA ring_gettemp_var 0 178 PushV 179 PushC setz 180 Call 0 181 NoOperation 182 PushV 183 JumpZ 202 184 NewLine 2 185 LoadA ring_gettemp_var 0 186 LoadMethod setz 187 LoadA ring_settemp_var 0 188 PushV 189 Call 0 1 190 AfterCallMethod 191 PushV 192 FreeStack 193 NewLine 3 194 LoadA ring_tempflag_var 0 198 195 AssignmentPointer 196 PushN 0.000000 197 BeforeEqual 0 198 Assignment 0 0 199 FreeStack 200 NewLine 4 201 Jump 210 74.4. Printing Final Intermediate Code 853
  • 7. Ring Documentation, Release 1.10 202 NewLine 5 203 PushP 007D37D8 0 207 204 AssignmentPointer 205 PushN 1.000000 206 BeforeEqual 0 207 Assignment 0 0 208 FreeStack 209 NewLine 6 210 Return =================================================== 74.5 CGI Support Command: ring test.ring -cgi 74.6 No Run Command: ring test.ring -norun 74.7 Printing Instruction Operation Code Command: ring test.ring -ins Output: =================================================== Operation : ReturnNull PC : 1 Line Number : 1 , File test.ring SP (After) : 0 - FuncSP : 0 LineNumber 1 =================================================== ..... ..... ..... Tip: Output removed from the previous example because it’s very large! 74.8 Performance Command: 74.5. CGI Support 854
  • 8. Ring Documentation, Release 1.10 ring test.ring -performance Output: =================================================== Date : 2015/09/15 Time : 15:56:17 Clock : 0 =================================================== Hello World 1 2 3 4 5 6 7 8 9 10 welcome x: 10.000000 y: 20.000000 z: 30.000000 =================================================== Date : 2015/09/15 Time : 15:56:17 Clock : 0 =================================================== 74.9 Generate Object File You can generate object file (.ringo) from your source code file (.ring) using -go option Tip: You will get one object file to use for distributing/running your application which may contains one or many ring source files that you can keep or distribute based on the application (commercial or open source). Command: ring test.ring -go To run the compiled object file ring test.ringo 74.9. Generate Object File 855
  • 9. CHAPTER SEVENTYFIVE PERFORMANCE TIPS In this chapter we will learn more about the Ring performance. 75.1 Introduction Ring is designed to be a simple, small and flexible language in the first place, but also it is fast enough for many applications. Ring can do each of the next tasks in around 1 second using normal computers in the market during the last 5 years 1. Compiling 100,000 lines of code 2. Executing empty loop that count from 1 to 10,000,000 3. Executing 1000 search operation using linear search in a list contains 100,000 items, trying to find the last item (The worst case) 4. Creating list contains 1,000,000 items then summing all of the list items 5. Adding 20,000 items to the ListWidget in GUI applications 6. Adding 5,000 nodes to the TreeWidget in GUI applications 7. Printing 10,000 messages to the terminal in Console applications Also when we need more speed we can use C/C++ extensions! Example: ? "Create list contains 100,000 items" aList = 1:100000 ? "Do 1000 search operation - Find the last item (Worst Case!)" c = clock() for t = 1 to 1000 find(alist,100000) next ? "Time: " + ( clock() - c ) / clockspersecond() + " seconds" Output: Create list contains 100,000 items Do 1000 search operation - Find the last item (Worst Case!) Time: 0.87 seconds 856
  • 10. Ring Documentation, Release 1.10 Example: load "guilib.ring" func main new qApp { win = new qWidget() { move(100,100) resize(500,500) setWindowTitle("Many Tree Items - Testing Performance") tree = new qTreeWidget(win) { blocksignals(True) setUpdatesEnabled(False) root = new qTreeWidgetItem() root.setText(0,"The Root Node") t1 = clock() for t = 1 to 5000 oItem = new qTreeWidgetItem() oItem.settext(0,"Item " + t) root.addchild(oItem) next cTime = (clock()-t1)/clockspersecond() setHeaderLabel("Creating 5000 nodes in " + cTime + " seconds.") addTopLevelItem(root) expanditem(root) blocksignals(False) setUpdatesEnabled(True) } oLayout = new qVBoxLayout() { addWidget(tree) } setLayout(oLayout) show() } exec() } Output: 75.1. Introduction 857