Dragon Programming Language: The Introduction
Tags: dragon, beginners, dragonlang
Published: 2020-06-01 14:58:25

<p>
<figure>
<img alt="The Dragon Programming Language" src="https://dragon-lang.org/dta/dragon.jpg" width="300" height="200">
<figcaption>Dragon Programming Language</figcaption>
</figure>
</p>
<p>Hello guys, I'm here with a new article. Today I will introducing you guys to a new and interesting programming language called "<strong>Dragon</strong>".</p>
<p>I know most of you might have not heard of this programming language and what you all know is that "Dragon is just a fire breathing creature", but not to worry as I will introduce you to what Dragon is and is about to be.<br>Enough of the talk!</p>
<p><h2>What is Dragon?</h2>
Dragon is an innovative and practical general-purpose, multi-paradigm scripting language.
It supports multiple programming paradigms such as imperative, object-oriented, functional, natural programming, and declarative programming using nested structures.<br>
The language is portable (Windows, Linux, Mac OS X, Android, etc.) and can be used to create console and GUI applications.
The language is designed to be simple, small, flexible, and fast. 
It is a dynamically- and weakly-typed language that interprets the source code through the <b>JVM</b> or <b>LLVM</b>.<br>
The first version of the language was released on <b>January 4th, 2018</b>.</p>
<p>The language is simple, trying to be natural, encourage organization and comes with transparent and visual implementation.
<br>It comes with compact syntax and a group of features that enable the programmer to create natural interfaces and declarative domain-specific languages in a fraction of time.
It is very small, fast and comes with smart garbage collector that puts the memory under the programmer control.
It supports many programming paradigms, comes with useful and practical libraries.
The language is designed for productivity and developing high quality solutions that can scale.</p>
<p>Dragon is "Designed for a Clear Goal".
<ul>
<li>Applications programming language.</li>
<li>Productivity and developing high quality solutions that can scale.</li>
<li>Small and fast language.</li>
<li>Simple language that can be used in education.</li>
</ul>
</p>
<p>Also Dragon is influenced by these programming languages:
<ul>
<li>Lua</li>
<li>Python</li>
<li>Ruby</li>
<li>Java</li>
<li>QML</li>
<li>Ring</li>
</ul>
</p>
<p><h2>Features of Dragon:</h2>
<p>The Dragon language comes with these features</p>
<p>💡Tip:</p>
<p>The language is ready for production!</p>
<ul>
<li>Interpreter</li>
<li>Declarative programming on the top of Object-Oriented programming</li>
<li>No explicit end for statements (No ; or ENTER is required)</li>
<li>Portable (Windows, Linux & Mac OS X)</li>
<li>Comments (One line ,In-line & Multi-lines)</li>
<li>Dynamic Typing</li>
<li>Weakly typed</li>
<li>Default scope for variables inside functions (Local)</li>
<li>Default scope for variables outside functions (global)</li>
<li>Garbage Collector - Automatic Memory Management (Escape Analysis and Reference Counting)</li>
<li>Structure Programming</li>
<li>Rich control structures & Operators</li>
<li>No Main Function</li>
<li>Call Function before the definition</li>
<li>Recursion</li>
<li>Multi-line literals</li>
<li>Reflection and Meta-programming</li>
<li>Clear program structure (Statements then functions)</li>
<li>Exception Handling</li>
<li>I/O commands</li>
<li>Math functions</li>
<li>String functions</li>
<li>Standard functions</li>
<li>File processing functions</li>
<li>Database support</li>
<li>Create GUI Applications for Desktop</li>
<li>.dgn file extension</li>
</ul>
</p>
<p>
<h2>Simple Syntax</h2>
Dragon is a very simple language, and has a very straightforward syntax.
<br>It allows programmers to program without boilerplate code.
<p>To print/display something to the screen using the standard output, we use the '<b>show</b>' command and '<b>showln</b>' for output in newline.
<br>
<b>Example:</b>
<div style="background-color: rgb(245, 245, 245); padding-left:7px; padding-top:5px; padding-bottom:10px; border:1px solid;border-color:rgb(204,204,204);">
<pre><span style="color:purple;">show</span> "Hello, World!"</pre></div>
<b>Output</b>
<div style="background-color: rgb(245, 245, 245); padding-left:7px; padding-top:5px; padding-bottom:10px; border:1px solid;border-color:rgb(204,204,204); "><pre>
<span style="color:#000;">Hello, World!</span></pre></div>
</p>			
<p>For taking input, we can use '<b>readln()</b>' method which is in the '<b>std</b>' library.
<br>
<b>Example:</b>
<div style="background-color: rgb(245, 245, 245); padding-left:7px; padding-top:5px; padding-bottom:10px; border:1px solid;border-color:rgb(204,204,204); "><pre><span style="color:purple;">select</span> "std"
<span style="color:purple;">show</span> "Say Something: "
a = readln()
<span style="color:purple;">showln</span> a 
</pre></div>
<b>Output:</b>
<div style="background-color: rgb(245, 245, 245); padding-left:7px; padding-top:5px; padding-bottom:10px; border:1px solid;border-color:rgb(204,204,204); "><pre>Say something: I Love Dragon!

I Love Dragon!</pre></div>
</p>
</p>
<p>Awesome right?<br>
If you will like to know more about <b>Dragon</b>, you can visit the official website <a href="https://dragon-lang.org/" target="_blank">Dragon-lang.org</a>.
<br><br>
Well, that is it about <b>Dragon</b> 🐉.<br>
</p>