An Introduction to Dragon/Lessons/Introduction
Introduction
[edit | edit source]Dragon is an innovative, practical, general-purpose programming language designed to be simple, small, flexible, and fast. It has an expressive, readable syntax that is easy to pick up, and it supports multiple programming paradigms: imperative, object-oriented, functional, and declarative.
Dragon programs can be run directly as scripts, explored interactively in a REPL, bundled into a single self-contained executable for distribution, or compiled into a shared library for embedding inside other applications.
This book will walk through the language from the ground up: variables and operators, control structures, functions, collections, classes and object-oriented programming, error handling, the standard library, concurrency, and finally how to compile and distribute finished Dragon programs.
Who this book is for
[edit | edit source]This book assumes basic familiarity with programming concepts (variables, loops, functions) but does not assume prior knowledge of Dragon itself. Readers coming from JavaScript, Python, or Lua will recognize many of Dragon's constructs.
How to use this book
[edit | edit source]Each chapter builds on the previous one. Code samples are written to be typed into a file with a .dgn extension and run with:
dragon myfile.dgn
or explored directly in the interactive REPL, covered in the next lesson.