Dragon (programming language)

Dragon is a dynamic and portable (Windows, Linux, Mac OS X, Android, etc.) programming language that supported Imperative and Procedural programming. It is developed by Aavesh Jilani. The language is designed for developing applications, also it can be used for educational purpose. Imperative, Object-Oriented, Functional, Declarative programming using nested structures, and Natural programming are the supported programming paradigms. The language is designed to be Simple, Small, Flexible and Fast. Its Dynamic Language (Dynamic Typing and Weakly Typed) that interpret the source code to byte code then executes it.

Strings
''Strings are defined in double quotes and can be multiline. Escaping Unicode characters is also supported''.:

Loops
While loop

Parentheses in condition are not necessary.

do-while loop

Parentheses in condition are not necessary.

for loop

foreach loop Iterates elements of an array or map.

FUNCTIONS DEFINITION
To define function uses the func keyword:

Shorthand definition There is short syntax for function body:

Which is equivalent to:

Default arguments Function arguments can have default values.

In this case only str argument is required.

Default arguments can't be declared before required arguments.

Causes parsing error:

Inner functions You can define function in other function.

CLASSES
To define classes use the class keyword:

Constructor Constructor name should be same as class name and will be created with func keyword:

DESTRUCTURING ASSIGNMENT Destructuring assignment allows to define multiple variables for each element of an array or map.

For arrays, value is assigned to variable:

Which is equivalent to:

For maps, key and value are assigned to variable:

To skip value just leave argument empty:

Examples
Here is an example of the standard "Hello, World!" program

Another example

Versions
The first version of the Dragon language 1.0 was released on January 4th, 2018


 * Dragon version 1.1 was released on March 6th, 2018


 * Dragon version 1.2 was released on May 24th, 2018


 * Dragon version 1.3 was released on August 14th, 2018


 * Dragon version 1.4 was released on January 18th, 2019


 * Dragon version 1.5 was released on April 25th, 2019


 * Dragon 1.6 was released on May 27th 2019


 * Dragon 1.7 was released on July 11th 2019


 * Dragon 1.8 was released on August 9th 2019


 * Dragon 1.9 was released on August 29th 2019


 * Dragon 1.9.1 was released on September 15th 2019


 * Dragon 1.9.2 was released on September 18th 2019


 * Dragon 1.9.3 was released on October 13th 2019


 * Dragon 1.9.4 was released on October 22nd 2019


 * Dragon-native was released on January 7th 2020


 * Dragon 1.9.5 was released on February 20th 2020


 * Dragon 1.9.6 was released on February 28th 2020


 * Dragon 1.9.7 was released on April 28th 2020