Different styles for writing the source codeDeclarative Programming (Web Development)Natural Language ProgrammingTesting TreeView Control Performance using RingQt
Hello World program
The same program can be written using different styles. Here is an example of the standard "Hello, World!" program using four different styles.
The Loop command can take an integer to apply the continue semantics to enclosing outer loops[25]
changeRingKeyword loop continue
count = 2
for x in 1:5
for y = 1 to 2
if x = 3
? "About to execute 'loop', count = " + count
continue count
ok
? "x: " + x + ", y: " + y
next
next
Object-oriented programming
Ring supports object-oriented programming (classes, objects, composition, inheritance, encapsulation, etc.)[26]
new point { # Create new object from the Point class the access the object using braces
x=10 y=20 z=30 # Set the object attributes
print() # Call the print() method
} # end of object access using braces
class point # Define the class
x y z # Define the attributes (x,y,z)
func print # Define the print() method
? x + nl + y + nl + z # Print the attributes values (nl means printing a new line)
In Ring classes can be defined at runtime using the Eval() function[27]
? "Creating a new class dynamically..."
eval("class DynamicClass a b")
? "Printing the instance..."
? new DynamicClass {a=1 b=2}
Implementation
Compiler and virtual machine
Ring VM implementation using PWCT - Virtual Machine InstructionsRing VM implementation using PWCT - List Structure
Ring programs are not interpreted directly from the textual Ring file, but are compiled into bytecode, which is then run on the Ring virtual machine. The compilation process is typically invisible to the user and is performed at run-time, but it can be done offline in order to increase loading performance or reduce the memory footprint of the host environment by leaving out the compiler.
Online Form Designer (WebAssembly) - Using RingQtSokoban Implementation using Ring Game Engine for 2D GamesUsing Qt3D through RingQt
The following are extensions that can be used immediately after the installation of the full installation version (with a file size of about 280 MB for Ring 1.12). Since these are officially provided and maintained on the Ring side, the users are not bothered by library dependencies that may cause problems in other languages, and there is a concern that they can not be used suddenly even if there are destructive language specification changes.
The extensions are implemented in approximately 500,000 lines of C and C++ code.
Ring is distributed with documentation written using Sphinx. A Japanese translation of the documentation is also available.[33]
Reception
Popularity
Ring had a rapid rise and fall in popularity as measured by the TIOBE Programming Community Index. In February 2018, Ring broke into the top 50 for the first time (position 45).[34] As of October 2020, Ring holds position 93 on the TIOBE index.[35] Ring is listed by GitHub in the list of programming languages that are actively developed.[36]
Criticism
Ring critics pointed to some features in Ring that are not common in widely used programming languages.[37]
In Ring, the index of the first item in lists and the first character in strings is 1.
cName = "Ring"
? cName[1] # print R
aList = ["One","Two","Three"]
? aList[1] # print One
Implicit type conversions
The language can automatically convert between numbers and strings.[38]
/*
** Rules:
** <NUMBER> + <STRING> --> <NUMBER>
** <STRING> + <NUMBER> --> <STRING>
*/
x = 10 # x is a number
y = "20" # y is a string
nSum = x + y # nSum is a number (y will be converted to a number)
cMsg = "Sum = " + nSum # cMsg is a string (nSum will be converted to a string)
^Omar Selim (January 2018). "The Ring programming language Review"(PDF). BIMArabia Magazine. Archived from the original on 2023-11-17. Retrieved 2024-03-24.{{cite web}}: CS1 maint: bot: original URL status unknown (link)
^Fayed, Mahmoud S.; Al-Qurishi, Muhammad; Alamri, Atif; Hossain, M. Anwar; Al-Daraiseh, Ahmad A. (October 2020). "PWCT: a novel general-purpose visual programming language in support of pervasive application development". CCF Transactions on Pervasive Computing and Interaction. 2 (3): 164–177. doi:10.1007/s42486-020-00038-y. S2CID225395711.