SlideShare a Scribd company logo
Ring Documentation, Release 1.10
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> 'See' Expr
==================================================================
==================================================================
Byte Code - Before Execution by the VM
==================================================================
PC OPCode Data
1 FuncExE
2 PushC Hello, World!
3 Print
4 ReturnNull
==================================================================
Hello, World!
3.11 Visual Implementation
The Ring programming language is designed using the PWCT visual programming tool and you will find the visual
source of the language in the folder “visualsrc” - *.ssf files and the generated source code (In the C Language) in the
src folder and the include folder.
The next screen shot from the ring_vm.ssf file (Generate ring_vm.c and ring_vm.h)
3.11. Visual Implementation 38
Ring Documentation, Release 1.10
The next screen shot from the ring_list.ssf file (Generate ring_list.c and ring_list.h)
3.12 Smart Garbage Collector
Avoid memory problems :-
• Invalid Memory Access
• Memory leaks
• Uninitialized Memory Access
• Dangling pointer
Rules :-
• Global variables always stay in the memory, until you delete these variables using the assignment statement.
• Local variables always deleted after the end of the function.
• The programmer have full control on when to delete the variable from the memory using the Assignment state-
ment.
Example:
aList = [1,2,3,4,5]
aList = "nice"
After the second line directly, The list [1,2,3,4,5] will be deleted from the memory and we will have a string “nice”
• The programmer can call the function callgc() to force running the garbage collector.
• If we have a reference to a variable (when we pass objects and lists to functions), then deleting variables will be
based on reference counting, if no references everything will be deleted, but if we have a reference, the data will
stay in memory.
3.12. Smart Garbage Collector 39
Ring Documentation, Release 1.10
3.13 No Global Interpreter (VM) Lock - No GIL
When we use threads in Ring applications, We don’t have global interpreter (VM) lock (No GIL)
So threads can work in parallel and execute Ring instructions at the same time
This is better for threads and concurrency (More Faster!)
3.14 Fast Enough For Many Applications
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!
3.13. No Global Interpreter (VM) Lock - No GIL 40
CHAPTER
FOUR
WHAT IS NEW IN RING 1.10?
In this chapter we will learn about the changes and new features in Ring 1.10 release.
4.1 List of changes and new features
Ring 1.10 comes with the next features!
• Chess Game
• Minesweeper Game
• Knight Tour Game
• Game of Life Game
• Pong Game
• Snakes and Ladder Game
• More Games
• Ring Extension for Visual Studio Code
• The Ring Package Manager (RingPM)
• Better Tests
• More Improvements
4.2 Chess Game
Chess Game (2 Players)
41
Ring Documentation, Release 1.10
4.3 Minesweeper Game
The objective of the game is to clear a rectangular board containing hidden “mines” or bombs without detonating any
of them.
4.3. Minesweeper Game 42
Ring Documentation, Release 1.10
4.4 Knight Tour Game
Move to every square on the chess board, using only the moves of a knight.
Can you visit every square in just 63 moves?
4.4. Knight Tour Game 43
Ring Documentation, Release 1.10
4.5 Game of Life Game
The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input.
One interacts with the Game of Life by creating an initial configuration and observing how it evolves, or, for advanced
players, by creating patterns with particular properties.
4.5. Game of Life Game 44
Ring Documentation, Release 1.10
4.6 Pong Game
Simple “tennis like” game features two paddles and a ball.
The goal is to defeat your opponent once the opponent misses a ball.
4.6. Pong Game 45
Ring Documentation, Release 1.10
4.7 Snakes And Ladder Game
The Snakes and Ladder Game using Ring Game Engine for 2D Games
4.7. Snakes And Ladder Game 46
Ring Documentation, Release 1.10
4.8 More Games
The next games are added to the application folder
• Lights Out Game
• Dots and Boxes Game
• Magic Four Game
• Sum Puzzle Game
The next screen shot for the Sum Puzzle Game
4.8. More Games 47

More Related Content

PDF
最後の楽園の開発をちょこっとだけ手伝った話
PDF
Apache con na_2013_updated_2016
PDF
Apache con na_2013_updated_2016
PPTX
Ac cuda c_3
PDF
The Ring programming language version 1.6 book - Part 7 of 189
PDF
The Ring programming language version 1.9 book - Part 8 of 210
PDF
The Ring programming language version 1.9 book - Part 12 of 210
PDF
The Ring programming language version 1.10 book - Part 9 of 212
最後の楽園の開発をちょこっとだけ手伝った話
Apache con na_2013_updated_2016
Apache con na_2013_updated_2016
Ac cuda c_3
The Ring programming language version 1.6 book - Part 7 of 189
The Ring programming language version 1.9 book - Part 8 of 210
The Ring programming language version 1.9 book - Part 12 of 210
The Ring programming language version 1.10 book - Part 9 of 212

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

PDF
The Ring programming language version 1.8 book - Part 10 of 202
PDF
The Ring programming language version 1.10 book - Part 12 of 212
PDF
Inside Winnyp
PDF
The Ring programming language version 1.7 book - Part 8 of 196
PDF
The Ring programming language version 1.9 book - Part 9 of 210
PDF
Know your platform. 7 things every scala developer should know about jvm
PDF
Scalability & Big Data challenges in real time multiplayer games
PDF
速度——敏捷开发的丹田之气(2011敏捷中国大会)
PDF
The Ring programming language version 1.10 book - Part 13 of 212
PDF
The Ring programming language version 1.3 book - Part 8 of 88
PDF
The Ring programming language version 1.5.4 book - Part 15 of 185
PDF
The Ring programming language version 1.5.3 book - Part 13 of 184
PDF
The Ring programming language version 1.10 book - Part 208 of 212
PDF
The Ring programming language version 1.9 book - Part 19 of 210
PDF
Getting Started with iBeacons (Designers of Things 2014)
PDF
The Ring programming language version 1.5.3 book - Part 11 of 184
PDF
MultiThreading-in-system-and-android-logcat-42-.pdf
PDF
Kafka short
PDF
Linux Process Manager The Internals Of Scheduling Interrupts And Signals John...
PDF
Columnar processing for SQL-on-Hadoop: The best is yet to come
The Ring programming language version 1.8 book - Part 10 of 202
The Ring programming language version 1.10 book - Part 12 of 212
Inside Winnyp
The Ring programming language version 1.7 book - Part 8 of 196
The Ring programming language version 1.9 book - Part 9 of 210
Know your platform. 7 things every scala developer should know about jvm
Scalability & Big Data challenges in real time multiplayer games
速度——敏捷开发的丹田之气(2011敏捷中国大会)
The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.3 book - Part 8 of 88
The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.3 book - Part 13 of 184
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.9 book - Part 19 of 210
Getting Started with iBeacons (Designers of Things 2014)
The Ring programming language version 1.5.3 book - Part 11 of 184
MultiThreading-in-system-and-android-logcat-42-.pdf
Kafka short
Linux Process Manager The Internals Of Scheduling Interrupts And Signals John...
Columnar processing for SQL-on-Hadoop: The best is yet to come
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 212 of 212
PDF
The Ring programming language version 1.10 book - Part 211 of 212
PDF
The Ring programming language version 1.10 book - Part 210 of 212
PDF
The Ring programming language version 1.10 book - Part 207 of 212
PDF
The Ring programming language version 1.10 book - Part 205 of 212
PDF
The Ring programming language version 1.10 book - Part 206 of 212
PDF
The Ring programming language version 1.10 book - Part 204 of 212
PDF
The Ring programming language version 1.10 book - Part 203 of 212
PDF
The Ring programming language version 1.10 book - Part 202 of 212
PDF
The Ring programming language version 1.10 book - Part 201 of 212
PDF
The Ring programming language version 1.10 book - Part 200 of 212
PDF
The Ring programming language version 1.10 book - Part 199 of 212
PDF
The Ring programming language version 1.10 book - Part 198 of 212
PDF
The Ring programming language version 1.10 book - Part 197 of 212
PDF
The Ring programming language version 1.10 book - Part 196 of 212
PDF
The Ring programming language version 1.10 book - Part 195 of 212
PDF
The Ring programming language version 1.10 book - Part 194 of 212
PDF
The Ring programming language version 1.10 book - Part 193 of 212
PDF
The Ring programming language version 1.10 book - Part 192 of 212
PDF
The Ring programming language version 1.10 book - Part 191 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 210 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 206 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 202 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 199 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 196 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 193 of 212
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 191 of 212
Ad

Recently uploaded (20)

PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
top salesforce developer skills in 2025.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Digital Strategies for Manufacturing Companies
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Transform Your Business with a Software ERP System
PDF
System and Network Administration Chapter 2
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
medical staffing services at VALiNTRY
PDF
Nekopoi APK 2025 free lastest update
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
assetexplorer- product-overview - presentation
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Navsoft: AI-Powered Business Solutions & Custom Software Development
top salesforce developer skills in 2025.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How to Choose the Right IT Partner for Your Business in Malaysia
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Digital Strategies for Manufacturing Companies
PTS Company Brochure 2025 (1).pdf.......
Designing Intelligence for the Shop Floor.pdf
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Transform Your Business with a Software ERP System
System and Network Administration Chapter 2
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
medical staffing services at VALiNTRY
Nekopoi APK 2025 free lastest update
Computer Software and OS of computer science of grade 11.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
assetexplorer- product-overview - presentation

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

  • 1. Ring Documentation, Release 1.10 Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> 'See' Expr ================================================================== ================================================================== Byte Code - Before Execution by the VM ================================================================== PC OPCode Data 1 FuncExE 2 PushC Hello, World! 3 Print 4 ReturnNull ================================================================== Hello, World! 3.11 Visual Implementation The Ring programming language is designed using the PWCT visual programming tool and you will find the visual source of the language in the folder “visualsrc” - *.ssf files and the generated source code (In the C Language) in the src folder and the include folder. The next screen shot from the ring_vm.ssf file (Generate ring_vm.c and ring_vm.h) 3.11. Visual Implementation 38
  • 2. Ring Documentation, Release 1.10 The next screen shot from the ring_list.ssf file (Generate ring_list.c and ring_list.h) 3.12 Smart Garbage Collector Avoid memory problems :- • Invalid Memory Access • Memory leaks • Uninitialized Memory Access • Dangling pointer Rules :- • Global variables always stay in the memory, until you delete these variables using the assignment statement. • Local variables always deleted after the end of the function. • The programmer have full control on when to delete the variable from the memory using the Assignment state- ment. Example: aList = [1,2,3,4,5] aList = "nice" After the second line directly, The list [1,2,3,4,5] will be deleted from the memory and we will have a string “nice” • The programmer can call the function callgc() to force running the garbage collector. • If we have a reference to a variable (when we pass objects and lists to functions), then deleting variables will be based on reference counting, if no references everything will be deleted, but if we have a reference, the data will stay in memory. 3.12. Smart Garbage Collector 39
  • 3. Ring Documentation, Release 1.10 3.13 No Global Interpreter (VM) Lock - No GIL When we use threads in Ring applications, We don’t have global interpreter (VM) lock (No GIL) So threads can work in parallel and execute Ring instructions at the same time This is better for threads and concurrency (More Faster!) 3.14 Fast Enough For Many Applications 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! 3.13. No Global Interpreter (VM) Lock - No GIL 40
  • 4. CHAPTER FOUR WHAT IS NEW IN RING 1.10? In this chapter we will learn about the changes and new features in Ring 1.10 release. 4.1 List of changes and new features Ring 1.10 comes with the next features! • Chess Game • Minesweeper Game • Knight Tour Game • Game of Life Game • Pong Game • Snakes and Ladder Game • More Games • Ring Extension for Visual Studio Code • The Ring Package Manager (RingPM) • Better Tests • More Improvements 4.2 Chess Game Chess Game (2 Players) 41
  • 5. Ring Documentation, Release 1.10 4.3 Minesweeper Game The objective of the game is to clear a rectangular board containing hidden “mines” or bombs without detonating any of them. 4.3. Minesweeper Game 42
  • 6. Ring Documentation, Release 1.10 4.4 Knight Tour Game Move to every square on the chess board, using only the moves of a knight. Can you visit every square in just 63 moves? 4.4. Knight Tour Game 43
  • 7. Ring Documentation, Release 1.10 4.5 Game of Life Game The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves, or, for advanced players, by creating patterns with particular properties. 4.5. Game of Life Game 44
  • 8. Ring Documentation, Release 1.10 4.6 Pong Game Simple “tennis like” game features two paddles and a ball. The goal is to defeat your opponent once the opponent misses a ball. 4.6. Pong Game 45
  • 9. Ring Documentation, Release 1.10 4.7 Snakes And Ladder Game The Snakes and Ladder Game using Ring Game Engine for 2D Games 4.7. Snakes And Ladder Game 46
  • 10. Ring Documentation, Release 1.10 4.8 More Games The next games are added to the application folder • Lights Out Game • Dots and Boxes Game • Magic Four Game • Sum Puzzle Game The next screen shot for the Sum Puzzle Game 4.8. More Games 47