Click here to Skip to main content
14,575,683 members

Different styles for writing Hello World program in the Ring programming language

Rate this:
5.00 (4 votes)
Please Sign up or sign in to vote.
5.00 (4 votes)
28 Dec 2017CPOL
A quick look around the different styles in the Ring programming language!



When we look at a new programming language, we start with the "Hello, World!" program. In Ring we can write this simple program with different styles that reflect the general scope of the language! The language documentation comes with three styles in the begining, In this article I will try to present all of the styles that we can use after learning the different aspects of the language!


The Ring programming language is a dynamic programming language for Windows, Linux and macOS. Very similar to Python and Ruby, but brings a lot of features from BASIC too!, The new ideas in the language are related to domain-specific languages and using declarative and natural programming. It's free open source language.


In Ring 1.0


see "Hello, World!"

(2) Using nl we can print new line!

see "Hello, World" + nl

(3) The language is not case-sensitive!

SEE "Hello, World!"

(4) Using nl we can print new line!

SEE "Hello, World" + nl


See "Hello, World!"

(6) Using nl we can print new line!

See "Hello, World" + nl

In Ring 1.1


put "Hello, World!"


put "Hello, World!" + nl


PUT "Hello, World!"


PUT "Hello, World!" + nl


Put "Hello, World!"


Put "Hello, World!" + nl

(13) Using the Standard Library "stdlib.ring"

load "stdlib.ring"
print("Hello, World!")

(14) Using the Standard Library "stdlib.ring" and \n for new lines!

load "stdlib.ring"
print("Hello, World!\n")


LOAD "stdlib.ring"
PRINT("Hello, World!")


LOAD "stdlib.ring"
PRINT("Hello, World!\n")


Load "stdlib.ring"
Print("Hello, World!")


Load "stdlib.ring"
Print("Hello, World!\n")

(19) In Ring 1.6 we can use ? as see <expr> + nl

? "Hello, World!"

(20) We can write multiline strings

? "
    Hello, World!


We can use functions|procedures, the main function will be executed in the start of the program.

(1) First Style

func main
   see "Hello, World!"

(2) Second Style

def main
   put "Hello, World!"

(3) Third Style

load "stdlib.ring"
func main() {
    print("Hello, World!") 


We can define a class, then create an object for this class!

(1) First Style

new MyApp { main() }
class MyApp
   func main
      see "Hello, World!"

(2) Second Style

new MyApp { main() }
class MyApp
   def main
      put "Hello, World!"

(3) Third Style

load "stdlib.ring"
new MyApp { main() }
class MyApp {
   func main() {
       print("Hello, World!") 


The web library can be used from weblib.ring

We have the package System.web

This packages contains many classes that we can use for web development.

#!ring -cgi 
load "weblib.ring" 
import System.Web 
new page { 
	text("Hello, World!") 


Games are based on Allegro and LibSDL

To use these libraries through the game engine, We have gameengine.ring

load "gameengine.ring" 
func main    
	oGame = new game {
    		title = "Hello, World!"    

GUI (Desktop|Mobile) - using Qt

Desktop and mobile development are based on the Qt framework

To use this framework we will load the guilib.ring

load "guilib.ring" 
new qApp { 
	new qWidget() { 
		setwindowtitle("Hello World") 
		move(100,100) resize(400,400) 


We can define new statments in the language, then use classes to implement our definition

The next example define Hello World as a new command!

new natural {
      Hello World
class natural 
         hello world
         func getHello ? "Hello"
         func getWorld ? "World!"

Points of Interest


(1) Different styles that match programmers with different backgrounds

(2) The language could be used in different domains


(1) All of these styles could be mixed in the same project!

(2) The language still new, A lot of libraries need more work!


Ring is a new programming language (just released in 2016)

The current version is Ring 1.6 (free open source - MIT License)


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Comments and Discussions

-- There are no messages in this forum --
Posted 28 Dec 2017