HOME

TheInfoList



OR:

Ring is a
dynamically typed In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usua ...
,
general-purpose programming language In computer software, a general-purpose programming language (GPL) is a programming language for building software in a wide variety of application Domain (software engineering), domains. Conversely, a Domain-specific language, domain-specific pro ...
. It can be embedded in C/C++ projects, extended using C/C++ code or used as a standalone language. The supported
programming paradigm A programming paradigm is a relatively high-level way to conceptualize and structure the implementation of a computer program. A programming language can be classified as supporting one or more paradigms. Paradigms are separated along and descri ...
s are imperative, procedural,
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
, functional, meta, declarative using nested structures, and natural programming. The language is portable (
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
,
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
,
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
, Android,
WebAssembly WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating communication between such programs and their host environment. The main goal of ...
, etc.) and can be used to create
console Console may refer to: Computing and video games * System console, a physical device to operate a computer ** Virtual console, a user interface for multiple computer consoles on one device ** Command-line interface, a method of interacting with ...
, GUI,
web Web most often refers to: * Spider web, a silken structure created by the animal * World Wide Web or the Web, an Internet-based hypertext system Web, WEB, or the Web may also refer to: Computing * WEB, a literate programming system created by ...
,
game A game is a structured type of play usually undertaken for entertainment or fun, and sometimes used as an educational tool. Many games are also considered to be work (such as professional players of spectator sports or video games) or art ...
and
mobile app A mobile application or app is a computer program or software application designed to run on a mobile device such as a smartphone, phone, tablet computer, tablet, or smartwatch, watch. Mobile applications often stand in contrast to desktop appli ...
lications.


History

In 2009, Mahmoud Samir Fayed created a minor
domain-specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging ...
called Supernova that focuses on User interface (UI) creation and uses some ideas related to Natural Language Programming, then he realized the need for a new language that is general-purpose and can increase the
productivity Productivity is the efficiency of production of goods or services expressed by some measure. Measurements of productivity are often expressed as a ratio of an aggregate output to a single input or an aggregate input used in a production proce ...
of natural language creation. Ring aims to offer a language focused on helping the developer with building natural interfaces and declarative DSLs.


Goals

The general goals behind Ring: * Applications programming language. * Productivity and developing high quality solutions that can scale. * Small and flexible language that can be embedded in C/C++ projects. * Simple language that can be used in education and introducing Compiler/VM concepts. * General-Purpose language that can be used for creating domain-specific libraries, frameworks and tools. * Practical language designed for creating the next version of the Programming Without Coding Technology software.


Examples


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 first style:
see "Hello, World!"
The second style:
put "Hello, World!"
The third style:
print("Hello, World!")
Another style: similar to xBase languages like
Clipper A clipper was a type of mid-19th-century merchant sailing vessel, designed for speed. The term was also retrospectively applied to the Baltimore clipper, which originated in the late 18th century. Clippers were generally narrow for their len ...
and
Visual FoxPro Visual FoxPro is a programming language that was developed by Microsoft. It is a data-centric and procedural programming language with object-oriented programming (OOP) features. It was derived from FoxPro (which was itself descended from FoxB ...
? "Hello, World!"


Change the keywords and operators

Ring supports changing the language keywords and
operators Operator may refer to: Mathematics * A symbol indicating a mathematical operation * Logical operator or logical connective in mathematical logic * Operator (mathematics), mapping that acts on elements of a space to produce elements of another ...
. This could be done many times in the same source file, and is useful for * Translating the keywords from English to other human languages (
Non-English-based programming languages Non-English-based programming languages are programming languages that do not use keywords taken from or inspired by English vocabulary. Prevalence of English-based programming languages The use of the English language in the inspiration fo ...
) * Customizing the language for use of a favorite style * Porting
Legacy code Legacy or Legacies may refer to: Arts and entertainment Comics * " Batman: Legacy", a 1996 Batman storyline * '' DC Universe: Legacies'', a comic book series from DC Comics * ''Legacy'', a 1999 quarterly series from Antarctic Press * ''Legacy ...
written in other languages Translate Ring keywords to Japanese
ChangeRingKeyword See 手紙を出す
ChangeRingOperator + そして
改行 = nl
します。 = :します。

手紙を出す "こんにちは、世界" そして 改行 します。

ChangeRingKeyword 手紙を出す See // キーワードの復旧
ChangeRingOperator そして + // 演算子の復旧
Translate Ring keywords to
Arabic Arabic (, , or , ) is a Central Semitic languages, Central Semitic language of the Afroasiatic languages, Afroasiatic language family spoken primarily in the Arab world. The International Organization for Standardization (ISO) assigns lang ...
ChangeRingKeyword See إطبع

إطبع "Hello, World!"

ChangeRingKeyword إطبع See
Use style similar to the
Pascal programming language Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named after French ...
ChangeRingKeyword func function ChangeRingKeyword see write begin = :begin function main begin write("Hello, World!"); return 0; end ChangeRingKeyword function func ChangeRingKeyword write see


Loop command

The Loop command can take an integer to apply the continue semantics to enclosing outer loops
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.)
new point                       # 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
? "Creating a new class dynamically..."
eval("class DynamicClass a b")

? "Printing the instance..."
? new DynamicClass 


Implementation


Compiler and virtual machine

Ring programs are not interpreted directly from the textual Ring file, but are compiled into
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (normal ...
, which is then run on the Ring
virtual machine In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
. 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. The
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
and the
virtual machine In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
are designed using visual programming through the Programming Without Coding Technology software then the C code is generated.


Extensions

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. * RingAllegro ( Allegro Game Library) * RingConsoleColor (Text coloring library for command prompt or the terminal) * RingCurl ( CURL Library) * RingFreeGLUT ( FreeGLUT) * RingInternet (Internet related library) * RingLibUV ( LibUV-asynchronous I / O library) * RingMurMurHash ( Hash Function Library) * RingMySQL (
MySQL MySQL () is an Open-source software, open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A rel ...
) * RingODBC (
Open Database Connectivity In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. An ...
) * RingOpenGL (
OpenGL OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
1.1-4.6) * RingOpenSSL (
OpenSSL OpenSSL is a software library for applications that provide secure communications over computer networks against eavesdropping, and identify the party at the other end. It is widely used by Internet servers, including the majority of HTTPS web ...
) * RingPostgreSQL (
PostgreSQL PostgreSQL ( ) also known as Postgres, is a free and open-source software, free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. PostgreSQL features transaction processing, transactions ...
) * RingQt ( Qt framework) * RingRayLib ( raylib) * RingSDL ( SDL-Simple DirectMedia Layer Library) * RingSQLite (
SQLite SQLite ( "S-Q-L-ite", "sequel-ite") is a free and open-source relational database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it ...
) * RingWinAPI (
Windows API The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
) * RingWinCREG (
Windows Registry The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, a ...
) * RingZIP ( zip file processing library)


Libraries

Ring comes with libraries written in Ring itself, such as libraries related to web and game development.


Applications

Ring is distributed with over 60 applications written in the language. Some of these applications are *
Analog Clock A clock or chronometer is a device that measures and displays time. The clock is one of the oldest human inventions, meeting the need to measure intervals of time shorter than the natural units such as the day, the lunar month, and the yea ...
application * Calculator application * The Checkers Game * The Chess Game *
Fifteen Puzzle The 15 puzzle (also called Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square and more) is a sliding puzzle. It has 15 square tiles numbered 1 to 15 in a frame that is 4 tile positions high and 4 tile positions wide, with one unoccupied pos ...
3D Game * Game 2048 * Knight Tour Game *
Minesweeper A minesweeper is a small warship designed to remove or detonate naval mines. Using various mechanisms intended to counter the threat posed by naval mines, minesweepers keep waterways clear for safe shipping. History The earliest known usage of ...
Game *
Othello ''The Tragedy of Othello, the Moor of Venice'', often shortened to ''Othello'' (), is a tragedy written by William Shakespeare around 1603. Set in Venice and Cyprus, the play depicts the Moorish military commander Othello as he is manipulat ...
Game * Sokoban Game *
Sudoku Sudoku (; ; originally called Number Place) is a logic puzzle, logic-based, combinatorics, combinatorial number-placement puzzle. In classic Sudoku, the objective is to fill a 9 × 9 grid with digits so that each column, each row, and ...
Game *
Tic-tac-toe Tic-tac-toe (American English), noughts and crosses (English in the Commonwealth of Nations, Commonwealth English), or Xs and Os (Canadian English, Canadian or Hiberno-English, Irish English) is a paper-and-pencil game for two players who ta ...
3D Game * Video Music Player application * Windows Startup Manager application


Tools

Ring is distributed with a Standard IDE that includes the following tools: * Ring REPL (
Read–eval–print loop A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written ...
) * Ring2EXE ( Distributing executable applications) * RingPM (The Ring
Package manager A package manager or package management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner. A package manager deals wi ...
) * Ring Notepad (
Source-code editor A source-code editor is a text editor program designed specifically for editing source code of computer programs. It may be a standalone application or it may be built into an integrated development environment (IDE). Features Source-code editor ...
) * Form Designer ( WYSIWYG GUI designer) Ring is also distributed with extensions for many code editors such as
Emacs Emacs (), originally named EMACS (an acronym for "Editor Macros"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, s ...
,
Notepad++ Notepad++ (sometimes npp or NPP) is a text and source code editor for use with Microsoft Windows. It supports tabbed editing, which allows working with multiple open files in one window. The program's name comes from the C postfix increment op ...
, Geany,
Atom Atoms are the basic particles of the chemical elements. An atom consists of a atomic nucleus, nucleus of protons and generally neutrons, surrounded by an electromagnetically bound swarm of electrons. The chemical elements are distinguished fr ...
, Sublime Text 2, and
Visual Studio Code Visual Studio Code, commonly referred to as VS Code, is an integrated development environment developed by Microsoft for Windows, Linux, macOS and web browsers. Features include support for debugging, syntax highlighting, intelligent code comp ...
.


Documentation

Ring is distributed with documentation written using
Sphinx A sphinx ( ; , ; or sphinges ) is a mythical creature with the head of a human, the body of a lion, and the wings of an eagle. In Culture of Greece, Greek tradition, the sphinx is a treacherous and merciless being with the head of a woman, th ...
. A Japanese translation of the documentation is also available.


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). As of October 2020, Ring holds position 93 on the TIOBE index. Ring is listed by GitHub in the list of programming languages that are actively developed.


Criticism

Ring critics pointed to some features in Ring that are not common in widely used programming languages. * The list index starts from 1 instead of 0 (See:
Zero-based numbering Zero-based numbering is a way of numbering in which the initial element of a sequence is assigned the index 0, rather than the index 1 as is typical in everyday non-mathematical or non-programming circumstances. Under zero-based number ...
) * Implicit type conversions (See: Implicit type conversions and "type punning")


The list index starts from 1 instead of 0

In Ring, the index of the first item in lists and the first character in strings is 1.
cName = "Ring"
? cName      # print R
aList =  One","Two","Three"? aList      # print One


Implicit type conversions

The language can automatically convert between numbers and strings.
/*
** Rules:
**  +  --> 
**  +  --> 
*/

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)


See also

*
Tcl TCL or Tcl or TCLs may refer to: Business * TCL Technology, a Chinese consumer electronics and appliance company ** TCL Electronics, a subsidiary of TCL Technology * Texas Collegiate League, a collegiate baseball league * Trade Centre Limited ...
* Lua * Python *
Ruby Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...
*
Squirrel Squirrels are members of the family Sciuridae (), a family that includes small or medium-sized rodents. The squirrel family includes tree squirrels, ground squirrels (including chipmunks and prairie dogs, among others), and flying squirrel ...
* Gambas * Julia


References


Further reading

* Fayed, Alohali. (2024)
Ring: A Lightweight and Versatile Cross-Platform Dynamic Programming Language Developed Using Visual Programming
',
Electronics Electronics is a scientific and engineering discipline that studies and applies the principles of physics to design, create, and operate devices that manipulate electrons and other Electric charge, electrically charged particles. It is a subfield ...
* Ghanem (2021)
Developing Poet Software using Ring language (Arabic Book)
', MetaBook (Egypt - Mansoura) * Ayouni (2020)
Beginning Ring Programming
', Apress (part of Springer Nature) * Hassouna (2019)
Ring Basics (Arabic Book)
'
Hassouna Academy
* Sobain (2017)
RingWinCReg Extension Documentation
',
SourceForge SourceForge is a web service founded by Geoffrey B. Jeffery, Tim Perdue, and Drew Streib in November 1999. SourceForge provides a centralized software discovery platform, including an online platform for managing and hosting open-source soft ...
* Fayed (2016)
The Ring Programming Language
', CodeProject


External links

*
RosettaCode samples




{{Programming languages Programming languages Cross-platform free software Programming languages created in 2016 High-level programming languages 2016 software Dynamically typed programming languages Egyptian inventions Free software projects Software using the MIT license Free software programmed in C Multi-paradigm programming languages Extensible syntax programming languages