The language

Dove is a strictly typed programming language featuring a modern, clean syntax with a single type system. It provides the same benefits that C++ does but with the ease and convenience of modern technology. It is designed to be significantly safer than C++ and faster because of its over-obsession with optimization. Dove also comes with an built-in package manager called feather. The feather package manager allows for easy installation of legacy C/C++ libraries and also natively written Dove ones. Dove's syntax closely resembles C++ with shorter abbreviated keywords. Many of the basic concepts of C++ still persist but have been reworked to be more modern.

C++ Simple Program

#include <iostream>
using namespace std

int main() 
{
    int sum = 0;
    for (int i = 0; i < 20; i++) 
    {
        sum += i;
    }
    cout << "Hello World! " << sum << endl;
}

Dove Simple Program

$loadsc 'tty' // the most basic library to write to console
$loadsc 'stdio' // a better version, but not available on embedded

// we use term for this example
$loadsc 'term' // best, available on most major OSes
fun int main()
{
    int sum = for 20 ~> sum += _;
    write("Hello World!", sum, EOL);
}

Compilation

Compiling Dove code requires use of the Dove Compiler. The Dove compiler along with the feather package manager, and Dove Extended Toolset (ET) can be downloaded as an install bundle from the homepage.

dvc source_file.dove -o app.exe

You can also specify libraries to use with the w/ flag, or -w or --libs

dvc source_file.dove w/my_library.dll,my_other.dll out.exe

Using the feather package manager is just as easy

You can specify on install wether you would like the ft alias or fthr alias. You can still, at all times use feather

ft add qt

This command links the qt libraries in the feather.prop file

ft add ffmpeg:48a0bc08

Feather also support git version numbers similar to what ffmpeg uses. The above command adds that specific version into the project.

Feather install location

Feather libraries are all installed under

/cache/dove/*

/lib/*.rsrc (for runtime & shared libraries)

After the specific version is installed in the cache, the project generates a feather.prop file.

links.prop
prop
${req:cachepath}
!libraries
[email protected]*.5* = #/cache/dove/qt/15.6.5.rsrc

At compile time, the Dove Compiler will read the feather.prop file and automatically link the libraries.

Dove Extended Toolset

In order to prevent constant updating of new Dove language changes, the Dove Extended Toolset was created. The Dove language itself will only be updated when new syntax or types are added. However, when new library functions are added, the Dove Extended Toolset will be updated instead. The Dove compiler will automatically install all non-breaking updates of the Dove Extended Toolset whenever compiling any file. Some example functions provided by the Dove ET are sin, cos, min, max, clamp, etc.

The Dove extended toolset also provides functions for manipulating arrays as well.

Person[] contacts;
int[] ages = contacts.map(x ~> x.age); // or
int[] ages = contacts.select(Person.age);
int[] ages18 = contacts.pick(x ~> x.age >= 18); // or
int[] ages18 = contacts.where(x ~> x.age >= 18);

Note that even though functions like "select" and "where" are provided by the Dove ET, they are not as efficient as using "map" or "pick" when doing simple filtering.

However, for complex datasets, "select" and "where" are more concise and performant.

Last updated