Slag is an elegant, powerful, and efficient statically-typed, object-oriented language designed to be the high-level language of choice for game engines and frameworks. Light and portable, its virtual machine can be easily integrated with any C++ program. Slag's semantics (nature and purpose of operations) are similar to those of Java and C# while its clear and concise syntax resembles a blend of Java and BASIC.
Many languages have attempted to improve programmer efficiency by using minimalistic names, cryptic symbols, and implicit operations while leaving a fundamental problem untouched: that of legacy organizational patterns requiring tedious, repetitive coding. Slag's approach is one of ergonomic simplicity, where simple, explicit commands are paired with the removal of repetitive and redundant operations. Slag offers the following benefits:
- Ergonomic programming
- Similar to how a garbage-collected language abstracts memory management and allows the programmer to operate at a higher level, Slag abstracts away tedious operations and enables even more sophisticated programming - all the while remaining an efficient, statically-typed language underneath. Why type "ArrayList<String> names = new ArrayList<String>(4);" when you can type "local String names(4)"? Even with its verbose keywords ("forEach ... endForEach") and Java-style semantics, a typical Slag program is 30% to 60% smaller than its Java equivalent in both lines of code and number of characters typed.
- A wish list of features
- Slag is a total replacement for C++ and Java within its domain, and as such it was designed with all of the conveniences you'd expect as well as many that you won't. It includes: full inheritance support, inline class definitions, aspect-oriented programming, transparent access methods, standardized Reader/Writer I/O architecture, integrated collections, a slew of both new and familiar control structures, true templated types (including lists of primitives), exception handling, easy string formatting, default parameters, and much more.
- Small, self-contained, and portable
- For development: Slag tools have a small footprint are embedded in each project's development directory, meaning that if you download an existing Slag-based project on a new computer, everything you need to compile and run can be already included.
- For distribution: any standard library calls used in a Slag program are compiled into the output bytecode. Anyone can run a compiled Slag program without having any sort of "Slag language platform" installed. Compiled Slag programs may be run on any platform by porting the C++ virtual machine or by cross-compiling the Slag program to C++ (or potentially any language).
- Open source
- The Slag compiler, virtual machine, and standard library as well as the Plasmacore 2D game programming library are freely available in both source and executable form. Slag may be used commercially or non-commercially, either in the creation of standalone programs or as part of other projects. It is available under the terms of the permissive Apache License 2.0, which essentially means use it as you like!
Slag is the language of the Plasmacore 2D game development framework.