https://dascript.org/ Overview What does it look like? Download Development State Performance Work in Progress Documentation Sandbox Wiki daScript News As of May 1st, 2023, version 0.4 of daScript 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. daScript now happily runs in the web browser. Check it out. 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: daScript site has been released, check it out. Overview 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. daScript is: * Extremely fast programming language that can rival compiled or JIT languages even in interpreter mode. It consistently outperforms dynamically interpreted scripting languages such as Lua. When used in AOT mode, daScript is often faster than naively written C++ due to its SSE-friendly POD-types, and it even surpasses some of the best JIT VMs like V8 or LuaJIT. As a result, there's no need to rewrite your daScript code in C++ to optimize your application. * Safe and versatile programming language that provides all the benefits of static typing. Many errors that would break an application in runtime in languages like Lua or JavaScript won't even compile in daScript. Additionally, due to its support for generics, type inference, and macros, daScript is easy and fluid to use. Safety is a fundamental pillar of daScript's design, making it safer in many cases than languages like C++ or Java. * Real embedded programming language that requires no external dependencies other than a C++17 compiler. Its interop capabilities are both super easy to use and safe, as is expected from any embedded scripting language that's meant to call native code. daScript offers a wide range of features like: * amazing performance * strong static typing * instant hot reload * Ruby-like blocks * semantic indenting * lexical scoping * high performance interpretation * Ahead-of-Time compilation (optimization for release build) * generators * generics and type inference * macros * optional types (i.e. pointers) * native HW friendly POD types * C++ friendly and fast interop * semi-manual memory management * fast and easy-to-reset execution context, allowing automatic burst free memory management for stored procedures no memory leaks with no GC/reference counting cost. * extendable type and function system * cheap multi-threading support - explicit separation of execution context and code context. * Open Source BSD licence * powerful embedding API + e.g. functions can be defined by scripts or in C++ + e.g. objects can fully exist in the Context or be bound to native code + and more daScript 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 daScript, 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 daScript 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? daScript's syntax is reminiscent of (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 range(0, n-1) let tmp = cur cur += last last = tmp return cur Also, for those who for some reason prefer curly brackets over Python-style indenting, it is also possible to write: 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 range(0, n-1); { let tmp = cur; cur += last; last = tmp; } return cur; } (Note that within curly brackets semicolons (;) are required to separate statements). Development state daScript's current version is 0.4, 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. daScript 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, daScript requires support for C++17. Performance As an interpreted language, daScript typically outperforms everything, including the blazing fast LuaJIT. daScript 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 daScript is comparable to C++ in Debug mode, as demonstrated by the Particles sample. As a compiled Ahead-of-Time language, daScript is significantly faster than both LuaJIT and Chrome JS, both of which have extremely fast Just-in-Time compilers. In terms of performance, daScript 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, daScript can even outperform C++. 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. All times are in milliseconds, all results are measured as best-out-of-20 runs on Intel Core i5. All samples for all languages in comparison are available in GitHub You can also compare performance online in a sandbox: Particles in interpreted daScript vs. C++. vs. Particles in interpreted LuaJit. (These tests above are straightforward copy-paste of examples in GitHub running on some virtualized CPU in some cloud, so only relative performance matters. Your mileage may vary.) Work in Progress * Just-in-time and LLVM AoT backend * AOT optimizations * Tutorials Documentation daScript 0.4 Online daScript 0.4 reference manual and Standard Libraries manual Offline Reference Manual (PDF) Offline Standard Libraries Manual (PDF) Sandbox Try it in your browser implemented with Emscripten, runs in your browser. Try it online implemented with tio.run fork. Download GitHub Repository daScript's GitHub repository is here Authors blog Boris Batkin blog on daScript (in English) Other useful links Language server plugin for VSCode with auto-completion, help, etc - itself written in daScript. dasBox - simple framework allowing create games in daScript. Article on history of daScript. Spiiin's blog on daScript (in Russian) Copyright (c)2023 Gaijin Entertainment| All Rights Reserved.