Dragon (programming language)
Dragon is a dynamic and multi-paradigm programming language for Cross-platform (multi-platform) operating systems. The supported programming paradigms are imperative, object-oriented, declarative using nested structures, functional and natural programming. Console and GUI applications can be developed with Dragon. It was first released in the year 2018 by Aavesh Jilani. The syntax is a bit of similar like Python but instead of indentation Dragon uses structural and procedural syntax approach.[2]
Paradigm(s) | Object-oriented |
---|---|
Appeared in | 2018 |
Designed by | Aavesh Jilani |
Developer | Aavesh Jilani |
Stable release | 1.9.8 / 24 February 2021[1] |
Typing discipline | dynamic |
OS | Cross-platform (multi-platform) |
Usual filename extensions | .dgn |
Website | dragon-lang |
Dragon at Wikibooks |
As of the 1.9.7 version Dragon started supporting procedural syntax along with the structural syntax. It is used for the block of codes similarly like the Visual Basic .NET uses. Although both of syntax can be used together in a program. There is a keyword "end" to complete the code block in procedural syntax for the loops, functions, classes, and conditions.
Uses
Dragon has multiple different versions. Although it doesn't have own VM, it uses the JVM and IKVM. It generates the VM instructions to any of these VM to execute the tasks. The Dragon native is made with C, Native version has its own VM. It is the fastest one among all versions.
Some things that Dragon is often used for are:
- Desktop applications development
- Internet of Things programming
- Android applications development
- Web applications development
Syntax
To print something using the standard output, Dragon has the 'show' keyword and 'showln' for output in newline.
<syntaxhighlight lang="python">
show "Hello, World!"
</syntaxhighlight>
Function creation with structural syntax
<syntaxhighlight lang="python"> one() two()
func one() {
showln "One"
}
func two() {
showln "two"
}
</syntaxhighlight>
With procedural syntax.
<syntaxhighlight lang="python"> one() two()
func one()
showln "One"
end
func two()
showln "two"
end
</syntaxhighlight>