Quail-Language

Quail Specification

Back to index

Chapter 1: A Brief Introduction

The Quail is a general-purpose, multiparadigmal, object-oriented, interpretable programming language driven by Java 8, developed by single developer and oriented to be simple and friendly for new developers as well as for experienced programmers moving from other language.

1.0 Acronyms, shortens, replacements

  1. Throughout this documentation you are likely to see different console commands for launching Quail. E.g. quail run prog.q and java -jar quail.jar run prog.q. From here and after quail and java -jar path_to_your_quail.jar are interchangeable.

1.1 Specification organisation

Specification is split into chapters:

  1. A brief introduction

    Contains general information, organization of specification, a couple of “Hello, World!” programs and contact info.

  2. Grammar and execution flow

    Contains grammar definition arranged in block-schemas.

    Describes execution flow.

  3. Preprocessing

    Describes the work of preprocessor.

  4. Lexical analysis

    Describes the work of lexical analyser.

  5. Parsing

    Describes type of nodes and the work of parser.

  6. Typing and classes

    Describes Quail’s type and OOP system

  7. Memory system

    Describes how memory and scopes in Quail work.

  8. Statement executions

    Describes how statements and expressions are executed in Quail.

  9. External Libraries

    Describes how external libraries in Quail are imported.

  10. Exceptions and errors

    Describes how exceptions and errors are raised and handled.

  11. Standard library

    Describes Quail’s standard library

  12. Console operation

    Describes how you should operate Quail in terminal

  13. Documentation

    Describes inbuilt documentation engine

  14. Debugger

    Describes debugger protocol, usage of debugger and how it works in general

  15. QRE and QDK

    Contains information about QRE and QDK

1.2 Example programs

Hello, World!:

print("Hello, World!")

Looping factorial:

function fact(x) {
    n = 1
    through 1:+x as i
        n *= i
    return n
}

print(fact(5))

Recursive factorial:

function fact(x) {
    if x >= 1
        return x * fact(x - 1)
    else
        return 1
}

print(fact(5))

One-liner factorial:

use "lang/math" = math

function fact(x) math.product(1:+x)

print(fact(5))

1.3 Contact info

For reporting any bugs please use Issues · Quail-Language/quail · GitHub

If you want to ask a question, write to our Discord server, or to email: dev.quail.lang@gmail.com

Keep in mind that Quail is still in development, so if you spot a bug, a variance in Documentation/Specification or if you have a great idea about improving Quail, you are very welcome to one of the above written locations.