GithubHelp home page GithubHelp logo

gmh5225 / sss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bruce-hill/sss

0.0 0.0 0.0 2 MB

The SSS programming language

License: Other

Shell 0.08% C 88.70% Lua 0.03% Makefile 0.51% Roff 0.22% SugarSS 10.47%

sss's Introduction

The SSS Programming Language

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.

Example

A quick demo of the code

See docs/quickstart.sss for a quick rundown of the language, or see the test folder for more comprehensive examples of each feature.

Dependencies

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.

Usage

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.

Language Features

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

Usage

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.

License

SSS is released under the MIT license with the Commons Clause, see LICENSE for full details.

sss's People

Contributors

bruce-hill avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.