SSS is a language that prioritizes safety, simplicity, and speed, with lightweight syntax and garbage collection. It's statically typed, compiled, and imperative. It uses libgccjit as a backend, which compiles to a binary. SSS lets you write SSS-tier software.
See docs/quickstart.sss for a quick rundown of the language, or see the test folder for more comprehensive examples of each feature.
The SSS compiler is written in C and uses
libgccjit as the backend for
compilation. SSS also uses the Boehm garbage
collector for runtime garbage collection. (both
are available from your package manager of choice, for example: pacman -S libgccjit gc
). The compiler uses a few GCC extensions, so other C compilers
are not supported.
If you use Vim, you may also want to use the SSS Vim Language Plugin.
To build the compiler, simply run make
. To install the compiler run sudo make install
.
The REPL can be run by running the command sss
(or ./sss
in this
directory). SSS files can be run directly via sss myprogram.sss
, compiled
to a static executable via sss -c myprogram.sss -o myprogram
, or compiled to a
library module via sss -c myprogram.sss -o libmyprogram.so
.
Additional command line arguments can be found in the manpages (man ./sss.1
) or by running sss --help
.
See docs/features.md for writeups of some of the features in SSS. These include:
- Memory safety (garbage collection, compiler-enforced null safety, automatic array bounds checking, and no uninitialized variables)
- Simple, low-boilerplate type system with type inference
- Useful and efficient built-in types: arrays, hash tables, tuples, structs, tagged unions
- Comprehensions for arrays and tables
- Well-defined reference and value semantics and mutability rules
- Language-level support for correct and automatic function memoization
- Type-safe strings representing different languages with automatic prevention of code injection
- Destructuring pattern matching with exhaustiveness checking
- Beautiful and helpful compiler and runtime error messages with emphasis on user-friendliness
- Units of measure with automatic unit conversions
- Better loops
- Vectorized math operations (array programming style)
- Structs with known-at-compile-time methods, not OOP objects with vtable lookups
- Module system with useful built-in modules: file operations, command line argument parsing, environment variable access, unicode support, shell interoperability, HTTP requests (work in progress)
- Easy interoperability with C
- Semantic versioning
- Built-in doctests with syntax highlighting
defer
statement for safe, automatic cleanup- Percentages as a distinct type
Once the necessary dependencies are installed, you can run ./sss
to get a
REPL or use ./sss your-file.sss
to run a file directly or ./sss -c your-file.sss
to compile it into a binary called your-file
. See sss --help
for full usage info.
SSS is released under the MIT license with the Commons Clause, see LICENSE for full details.