Paradigm | Multi-paradigm: object-oriented, imperative, functional, procedural, reflective, declarative, natural language programming |
---|---|
Designed by | Mahmoud Samir Fayed [1] |
Developer | The Ring Development Team |
First appeared | January 25, 2016 |
Stable release | |
Typing discipline | Dynamic |
Implementation language | C |
OS | Windows, Linux and macOS |
License | MIT License |
Filename extensions | .ring, .rh, .rform |
Website | http://ring-lang.net |
Influenced by | |
Lua, Python, Ruby, C, C#, BASIC, QML, xBase, Supernova | |
Influenced | |
SimpleLang, [3] DragonLang [4] | |
|
Ring is a dynamically typed, general-purpose programming language. It can be embedded in C/C++ projects, extended using C/C++ code or used as a standalone language. [5] The supported programming paradigms are imperative, procedural, object-oriented, functional, meta, declarative using nested structures, and natural programming. [6] [7] The language is portable (Windows, Linux, macOS, Android, [8] WebAssembly, [9] etc.) [10] and can be used to create console, GUI, web, game and mobile applications. [11] [12] [13] [14]
In 2009, Mahmoud Samir Fayed created a minor domain-specific language 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 of natural language creation. Ring aims to offer a language focused on helping the developer with building natural interfaces and declarative DSLs. [15] [16] [17] [18]
The general goals behind Ring: [19] [20]
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 and Visual FoxPro
? "Hello, World!"
Ring supports changing the language keywords and operators.
This could be done many times in the same source file, and is useful for
Translate Ring keywords to Japanese
ChangeRingKeyword See 手紙を出す ChangeRingOperator + そして 改行 = nl します。 = :します。 手紙を出す "こんにちは、世界" そして 改行 します。 ChangeRingKeyword 手紙を出す See // キーワードの復旧 ChangeRingOperator そして + // 演算子の復旧
Translate Ring keywords to Arabic
ChangeRingKeyword See إطبع إطبع "Hello, World!" ChangeRingKeyword إطبع See
Use style similar to the Pascal programming language
ChangeRingKeywordfuncfunctionChangeRingKeywordseewritebegin=:beginfunctionmainbeginwrite("Hello,World!");return0;endChangeRingKeywordfunctionfuncChangeRingKeywordwritesee
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
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}
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.
The compiler and the virtual machine are designed using visual programming through the Programming Without Coding Technology software then the C code is generated.
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 comes with libraries written in Ring itself, such as libraries related to web and game development.
Library Name | Description |
---|---|
Standard Library | General Classes and functions. |
GUI Library | Classes and functions for creating GUI applications |
Objects Library | Classes and functions for creating GUI applications using the MVC design pattern |
Web Library | Simple framework for developing web applications using the MVC design pattern |
Game Engine | Support developing 2D Games for Desktop and Mobile using Declarative Programming based on Allegro and LibSDL |
Natural Library | General-Purpose Natural Language Programming Library. |
Trace Library | A library for debugging applications. |
Type Hints | A library for adding type hints to functions. |
Big Number Library | Support arithmetic operations on huge numbers. |
Fox Ring Library | Contains functions similar to Visual FoxPro. |
ZeroLib Library | Contains classes where the Index starts from 0 instead of 1. |
Ring is distributed with over 60 applications written in the language.
Some of these applications are
Ring is distributed with a Standard IDE that includes the following tools:
Ring is also distributed with extensions for many code editors such as Emacs, Notepad++, Geany, Atom, Sublime Text 2, and Visual Studio Code.
Ring is distributed with documentation written using Sphinx. A Japanese translation of the documentation is also available. [33]
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]
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
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)
Eiffel is an object-oriented programming language designed by Bertrand Meyer and Eiffel Software. Meyer conceived the language in 1985 with the goal of increasing the reliability of commercial software development; the first version becoming available in 1986. In 2005, Eiffel became an ISO-standardized language.
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.
OCaml is a general-purpose, high-level, multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez, and others.
Lua is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. Lua is cross-platform, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C API to embed it into applications.
Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. Although the ".NET" portion of the name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual Basic languages released since 2002, in order to distinguish between them and the classic Visual Basic. Along with C# and F#, it is one of the three main languages targeting the .NET ecosystem. Microsoft updated its VB language strategy on 6 February 2023, stating that VB is a stable language now and Microsoft will keep maintaining it.
F# is a general-purpose, high-level, strongly typed, multi-paradigm programming language that encompasses functional, imperative, and object-oriented programming methods. It is most often used as a cross-platform Common Language Infrastructure (CLI) language on .NET, but can also generate JavaScript and graphics processing unit (GPU) code.
Modula-3 is a programming language conceived as a successor to an upgraded version of Modula-2 known as Modula-2+. While it has been influential in research circles it has not been adopted widely in industry. It was designed by Luca Cardelli, James Donahue, Lucille Glassman, Mick Jordan, Bill Kalsow and Greg Nelson at the Digital Equipment Corporation (DEC) Systems Research Center (SRC) and the Olivetti Research Center (ORC) in the late 1980s.
ABAP is a high-level programming language created by the German software company SAP SE. It is currently positioned, alongside Java, as the language for programming the SAP NetWeaver Application Server, which is part of the SAP NetWeaver platform for building business applications.
Harbour is a computer programming language, primarily used to create database/business programs. It is a modernised, open source and cross-platform version of the older Clipper system, which in turn developed from the dBase database market of the 1980s and 1990s.
C# is a general-purpose high-level programming language supporting multiple paradigms. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
The syntax of the Python programming language is the set of rules that defines how a Python program will be written and interpreted. The Python language has many similarities to Perl, C, and Java. However, there are some definite differences between the languages. It supports multiple programming paradigms, including structured, object-oriented programming, and functional programming, and boasts a dynamic type system and automatic memory management.
C# and Visual Basic .NET are the two primary languages used to program on the .NET Framework.
A symbol in computer programming is a primitive data type whose instances have a human-readable form. Symbols can be used as identifiers. In some programming languages, they are called atoms. Uniqueness is enforced by holding them in a symbol table. The most common use of symbols by programmers is to perform language reflection, and the most common indirectly is their use to create object linkages.
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.
Newspeak is a programming language and platform in the tradition of Smalltalk and Self being developed by a team led by Gilad Bracha. The platform includes an integrated development environment (IDE), a graphical user interface (GUI) library, and standard libraries. Starting in 2006, Cadence Design Systems funded its development and employed the main contributors, but ended funding in January 2009.
Go is a statically typed, compiled high-level programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It is syntactically similar to C, but also has memory safety, garbage collection, structural typing, and CSP-style concurrency. It is often referred to as Golang because of its former domain name, golang.org
, but its proper name is Go.
Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system. Due to Apple macOS’s direct lineage from NeXTSTEP, Objective-C was the standard programming language used, supported, and promoted by Apple for developing macOS and iOS applications until the introduction of the Swift programming language in 2014.
Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.
Crystal is a high-level general-purpose, object-oriented programming language, designed and developed by Ary Borenszweig, Juan Wajnerman, Brian Cardiff and more than 400 contributors. With syntax inspired by the language Ruby, it is a compiled language with static type-checking, but specifying the types of variables or method arguments is generally unneeded. Types are resolved by an advanced global type inference algorithm. Crystal is currently in active development. It is released as free and open-source software under the Apache License version 2.0.
Mahmoud Samir Fayed is a computer programmer, known as the creator of the PWCT programming language. PWCT is a free open source visual programming language for software development. He also created or designed Ring. He is a researcher at King Saud University. Prior to that, he worked at the Riyadh Techno Valley in the Information and Communication Technology Incubator.
{{cite web}}
: CS1 maint: bot: original URL status unknown (link){{cite web}}
: CS1 maint: bot: original URL status unknown (link)