Daslang

Daslang (former daScript) is a high-level programming language that features strong static typing. It is designed to provide high performance and serves as an embeddable 'scripting' language for C++ applications that require fast and reliable performance, such as games or back end/servers. Additionally, it functions effectively as a standalone programming language.

News

  • Feb 20th, 2026: We are getting ready for the release of version 0.6. You can preview the documentation online.
  • Jan 22nd, 2026: Life improvements in Daslang! Little things with big impact.
  • Jan 20th, 2026: Say hello to templates and typemacros in Daslang! It's trurtles all the way down.
  • December 30th, 2025: Pre-releases are available, RELEASES are coming soon. Bundle has JIT and modules. Bare bones version is just to play with the language.
  • June 10th, 2025: We now have LINQ-like capabilities in Daslang. See blog for details.
  • May 6th, 2025: Overview of gen2 syntax as well as gen1.5 syntax, as well as conversion process. All about 'options gen2'
  • Oct 10th, 2024: Version 0.5 of Daslang has been released. This version includes a lot of new features and improvements, such as JIT, serialization, performance improvements, new syntax features. See plans for 0.6 for more details.
  • July 28th, 2024: Massive update on data initialization syntax. Table and set comprehensions are now available. See the Data Initialization in DAS for more details.
  • July 7th, 2024: Version 0.5 is coming very soon. It will include a lot of new features and improvements. Stay tuned! Expect JIT, serialization, performance improvements, new syntax features, and more.
  • July 1st, 2024: daScript renamed to Daslang!
  • May 1st, 2023: Version 0.4 of Daslang has been released. The development team is currently working on the next major release, which will include a fully featured JIT compiler. This JIT compiler is currently available as a preview.
  • 1st Jan 2023: Daslang now happily runs in the web browser. Check it out.
  • 14 Dec 2022: We now have an official blog
  • November 18th, 2021: Version 0.3 released.
  • September 5th, 2020: Version 0.2 released.
  • 24 August 2020: A lot of documentation has been added.
    tio.run sandbox added.
  • 28 October 2019: Benchmarks has been updated. All lang compilers were built in LLVM8.0, architecture AVX.
  • 15 August 2019: Daslang site has been released, check it out.

Overview

Daslang is:

Daslang offers a wide range of features like:

Daslang takes inspiration from languages like Python, Ruby, Kotlin, and Haxe when it comes to its explicitness and readability. However, it is also designed to be extremely fast, making it an ideal choice for performance-critical applications.

A Visual Studio Code extension is available for Daslang, providing comprehensive support for the language. This extension offers features such as code diagnostics, code completion, code navigation, hints, and more. Additionally, it provides a rich debugging environment, allowing developers to easily debug their Daslang code. It also includes a profiler for measuring and optimizing code performance. You can find this extension on the Visual Studio Code Marketplace at the following link: https://marketplace.visualstudio.com/items?itemName=profelis.dascript-plugin.

What Does it look like?

Daslang's syntax is reminiscent of Kotlin and (Typed) Python, while its static strong typed nature is similar to ML or Zig. Its POD types are closely aligned with hardware/machine types. Additionally, the language makes use of type inference, as can be seen in the following Fibonacci code snippet.


def fibR(n) {
    if (n < 2) {
        return n
    } else {
        return fibR(n - 1) + fibR(n - 2)
    }
}
def fibI(n) {
    var last = 0
    var cur = 1
    for ( i in 0..n-1 ) {
        let tmp = cur
        cur += last
        last = tmp
    }
    return cur
}
Also, for those who prefer Python-style indenting over curly brackets, it is also possible to write:
options gen2=false

def fibR(n)
    if n < 2
        return n
    else
        return fibR(n - 1) + fibR(n - 2)

def fibI(n)
    var last = 0
    var cur = 1
    for i in 0..n-1
        let tmp = cur
        cur += last
        last = tmp
    return cur

Development state

Daslang's current version is 0.6 (or just about), and it's already being used in production projects at Gaijin Entertainment. Until the release of version 1.0, there will be no patches or fixes for older versions. Instead, all updates and fixes will be made available exclusively in the master branch.

Daslang has been successfully compiled and run on a wide range of platforms, including Windows (x86 & x64), Linux (x64), macOS, Xbox One, Xbox One Series X, PlayStation 4, PlayStation 5, Nintendo Switch, iOS, Android, and WebAssembly.

Has been tested with the following compilers with C++17 support:

MS Visual C++ 17, 19, and 22 (x86 & x64)
Linux GCC
LLVM 7 and above

To compile, Daslang requires support for C++17.

Performance

Interpreted  |  AOT or JIT

As an interpreted language, Daslang typically outperforms everything, including the blazing fast LuaJIT.

Daslang particularly excels in interop with C++ functions, providing an easy and seamless experience when it comes to integrating new functions and types.

The overhead of data-oriented processing in interpretation mode in Daslang is comparable to C++ in Debug mode, as demonstrated by the Particles sample.

Tested on AMD Ryzen Threadripper 3990X 64-Core Processor at Mon Sep 30 15:32:40 2024
CLANG 17.0.6

Interpreted

dictionary

DAS INTERPRETER
0.0189  (1.13)
LUA
0.0660  (3.96)
LUAJIT -joff
LUAU
0.0307  (1.84)
QUICKJS
0.1020  (6.13)
QUIRREL
0.0880  (5.28)
SQUIRREL3
0.1110  (6.67)

exp loop

DAS INTERPRETER
LUA
0.0520  (4.18)
LUAJIT -joff
0.0382  (3.08)
LUAU
0.0204  (1.64)
QUICKJS
0.0870  (7.00)
QUIRREL
0.0860  (6.92)
SQUIRREL3
0.0850  (6.84)

fibonacci loop

DAS INTERPRETER
LUA
0.0900  (2.53)
LUAJIT -joff
0.0454  (1.28)
LUAU
0.0775  (2.18)
QUICKJS
0.1260  (3.54)
QUIRREL
0.1390  (3.91)
SQUIRREL3
0.1110  (3.12)

fibonacci recursive

DAS INTERPRETER
LUA
0.1020  (1.91)
LUAJIT -joff
0.0588  (1.10)
LUAU
0.0892  (1.67)
QUICKJS
0.1670  (3.12)
QUIRREL
0.2580  (4.82)
SQUIRREL3
0.2750  (5.14)

float2string

DAS INTERPRETER
LUA
0.6210  (8.19)
LUAJIT -joff
0.1723  (2.27)
LUAU
QUICKJS
3.6120  (47.63)
QUIRREL
0.1080  (1.42)
SQUIRREL3
0.1070  (1.41)

mandelbrot

DAS INTERPRETER
LUA
0.1640  (53.93)
LUAJIT -joff
0.0597  (19.64)
LUAU
0.0555  (18.24)

n-bodies

DAS INTERPRETER
LUA
1.2500  (5.96)
LUAJIT -joff
0.5590  (2.66)
LUAU
0.6912  (3.29)
QUICKJS
2.4450  (11.65)
QUIRREL
0.2400  (1.14)
SQUIRREL3
0.2870  (1.37)

native loop

DAS INTERPRETER
LUAJIT -joff
0.8819  (23.68)

particles kinematics

DAS INTERPRETER
LUA
1.2270  (103.66)
LUAJIT -joff
0.3007  (25.41)
LUAU
0.3925  (33.16)
QUICKJS
1.4440  (121.99)
QUIRREL
0.6090  (51.45)
SQUIRREL3
1.4890  (125.79)

primes loop

DAS INTERPRETER
LUA
0.0960  (2.34)
LUAJIT -joff
0.0690  (1.68)
LUAU
0.0942  (2.29)
QUICKJS
0.1310  (3.19)
QUIRREL
0.3340  (8.13)
SQUIRREL3
0.3360  (8.17)

queen

DAS INTERPRETER
0.0013  (1.01)
LUA
0.0020  (1.60)
LUAJIT -joff
LUAU
0.0018  (1.40)
QUIRREL
0.0040  (3.19)
SQUIRREL3
0.0040  (3.19)

sha256

DAS INTERPRETER
LUAJIT -joff
0.2541  (2.10)
LUAU
0.7353  (6.06)

sort

DAS INTERPRETER
0.0320  (1.33)
LUA
0.0920  (3.83)
LUAJIT -joff
0.0701  (2.92)
LUAU
0.0531  (2.21)
QUIRREL
SQUIRREL3
0.0280  (1.17)

spectral norm

DAS INTERPRETER
LUA
0.5930  (2.90)
LUAJIT -joff
0.2894  (1.42)
LUAU
0.2391  (1.17)
QUICKJS
0.8880  (4.35)
QUIRREL
1.4390  (7.05)
SQUIRREL3
1.4800  (7.25)

string2float

DAS INTERPRETER
LUA
0.2040  (7.00)
LUAJIT -joff
0.1362  (4.67)
LUAU
0.1271  (4.36)
QUICKJS
0.4590  (15.75)
QUIRREL
0.3060  (10.50)
SQUIRREL3
0.4290  (14.72)

tree

DAS INTERPRETER
1.7543  (1.17)
LUA
2.9080  (1.94)
LUAJIT -joff
LUAU
1.7688  (1.18)

As a compiled Ahead-of-Time language, Daslang is significantly faster than both LuaJIT and Chrome JS, both of which have extremely fast Just-in-Time compilers.

In terms of performance, Daslang is nearly on par with naive C++ (compiled with clang-cl llvm 8.0.1 with all optimizations), typically differing by no more than 10%. In some cases, Daslang can even outperform C++.

Daslang Just-in-Time compilation is based on LLVM backend, and often outperforms C++, due to Daslang providing more information to LLVM than AOT.

It is worth noting that unlike Just-in-Time compilation, Ahead-of-Time compilation can be used on any platform, including those with signed binary executables like iOS or consoles.

Tested on AMD Ryzen Threadripper 3990X 64-Core Processor at Mon Sep 30 15:32:40 2024
CLANG 17.0.6

AOT or JIT

dictionary

.NET
0.0795  (7.87)
C++
0.0439  (4.34)
DAS AOT
DAS JIT
0.0105  (1.03)
LUAJIT
0.0121  (1.20)
LUAU --codegen
0.0233  (2.31)
MONO
0.0766  (7.58)

exp loop

.NET
0.0060  (1.63)
C++
DAS AOT
0.0062  (1.68)
DAS JIT
LUAJIT
0.0179  (4.85)
LUAU --codegen
0.0085  (2.30)
MONO
0.0100  (2.72)

fibonacci loop

.NET
0.0030  (1.89)
C++
DAS AOT
DAS JIT
0.0019  (1.21)
LUAJIT
0.0048  (3.02)
LUAU --codegen
0.0328  (20.72)
MONO
0.0030  (1.89)

fibonacci recursive

.NET
0.0063  (1.56)
C++
0.0043  (1.07)
DAS AOT
DAS JIT
0.0045  (1.11)
LUAJIT
0.0129  (3.17)
LUAU --codegen
0.0602  (14.83)
MONO
0.0085  (2.10)

float2string

.NET
0.2835  (4.22)
C++
0.3021  (4.49)
DAS AOT
DAS JIT
LUAJIT
0.1564  (2.33)
LUAU --codegen
0.0695  (1.03)
MONO
0.4566  (6.79)

mandelbrot

.NET
0.0020  (4.45)
C++
DAS AOT
0.0006  (1.40)
DAS JIT
0.0005  (1.02)
LUAJIT
0.0076  (16.92)
LUAU --codegen
0.0379  (84.48)
MONO
0.0040  (8.90)

n-bodies

.NET
0.0390  (1.89)
C++
0.0270  (1.31)
DAS AOT
0.0274  (1.33)
DAS JIT
LUAJIT
0.0820  (3.97)
LUAU --codegen
0.2302  (11.13)
MONO
0.0805  (3.89)

native loop

.NET
0.1615  (13.20)
DAS AOT
DAS JIT
LUAJIT

particles kinematics

.NET
0.0069  (2.32)
C++
0.0035  (1.17)
DAS AOT
DAS JIT
LUAJIT
0.1997  (67.00)
LUAU --codegen
0.2144  (71.96)
MONO
0.0915  (30.71)

primes loop

.NET
0.0380  (2.82)
C++
0.0386  (2.87)
DAS AOT
DAS JIT
LUAJIT
0.0137  (1.01)
LUAU --codegen
0.0350  (2.60)
MONO
0.0380  (2.82)

queen

.NET
0.0050  (43.86)
C++
0.0001  (1.03)
DAS AOT
0.0001  (1.25)
DAS JIT
LUAJIT
0.0004  (3.87)
LUAU --codegen
0.0009  (7.69)

sha256

.NET
0.0080  (1.64)
DAS AOT
0.0052  (1.06)
DAS JIT
LUAJIT
0.0339  (6.94)
LUAU --codegen
0.5664  (115.84)

sort

.NET
0.0130  (2.37)
C++
0.0057  (1.04)
DAS AOT
DAS JIT
0.0096  (1.74)
LUAJIT
0.0730  (13.28)
LUAU --codegen
0.0478  (8.69)
MONO
0.0100  (1.82)

spectral norm

.NET
C++
0.0123  (1.03)
DAS AOT
0.0123  (1.03)
DAS JIT
0.0124  (1.03)
LUAJIT
0.0147  (1.22)
LUAU --codegen
0.0574  (4.78)
MONO
0.0260  (2.17)

string2float

.NET
0.1065  (4.41)
C++
0.1015  (4.20)
DAS AOT
DAS JIT
LUAJIT
0.1173  (4.86)
LUAU --codegen
0.1158  (4.80)
MONO
0.1853  (7.68)

tree

.NET
0.2465  (1.41)
C++
DAS AOT
0.1777  (1.02)
DAS JIT
0.1776  (1.02)
LUAJIT
0.9647  (5.52)
LUAU --codegen
1.3965  (7.99)
MONO
0.2590  (1.48)

All samples for all languages in comparison are available in GitHub

Work in Progress

Documentation

Daslang 0.6

Online Daslang 0.6 reference manual and Standard Libraries manual

Try it online!

Try it in your browser implemented with Emscripten, runs in your browser.
Try it online implemented with tio.run fork.

Downloads and links

GitHub Repository

Daslang's GitHub repository is here

Authors blog

Boris Batkin blog on Daslang (in English)

Other useful links

Language server plugin for VSCode with auto-completion, help, etc - itself written in Daslang.
dasBox - simple framework allowing create games in Daslang.
Edenspark - Open Source AI-assisted platform for making games on PC and consoles.
Article on history of Daslang.
Spiiin's blog on Daslang (in Russian)