1
0
General purpose programming language and shell
Go to file
2024-02-22 23:49:07 -05:00
docs Clean up examples 2024-02-19 21:19:27 -05:00
examples Clean up examples 2024-02-19 21:19:27 -05:00
scripts Edit README; Improve bench script; Optimize 2024-02-19 20:44:26 -05:00
src Roll back changes from 0.4.3 2024-02-22 23:49:07 -05:00
tests Modify return/break syntax; Change Value::String 2024-02-19 22:32:06 -05:00
tree-sitter-dust Roll back changes from 0.4.3 2024-02-22 23:49:07 -05:00
.gitignore Do not ignore generated tree sitter files 2023-11-28 13:53:33 -05:00
build.rs Clean up build script 2024-01-31 10:19:26 -05:00
Cargo.lock Increment cargo version 2024-02-19 17:59:16 -05:00
Cargo.toml Increment cargo version 2024-02-19 17:59:16 -05:00
README.md Edit README; Improve bench script; Optimize 2024-02-19 20:44:26 -05:00

Dust

High-level programming language with effortless concurrency, automatic memory management, type safety and strict error handling.

Dust version of an example from The Rust Programming Language.

Features

Easy to Read and Write

Dust has simple, easy-to-learn syntax.

output('Hello world!')

Effortless Concurrency

Write multi-threaded code as easily as you would write code for a single thread.

async {
    output('Will this one print first?')
    output('Or will this one?')
    output('Who knows! Each "output" will run in its own thread!')
}

Helpful Errors

Dust shows you exactly where your code went wrong and suggests changes.

Example of syntax error output.

Static analysis

Your code is always validated for safety before it is run.

Example of type error output.

Dust

Debugging

Just set the environment variable DUST_LOG=info and Dust will tell you exactly what your code is doing while it's doing it. If you set DUST_LOG=trace, it will output detailed logs about parsing, abstraction, validation, memory management and runtime. Here are some of the logs from the end of a simple fizzbuzz example.

Example of debug output.

Automatic Memory Management

Thanks to static analysis, Dust knows exactly how many times each variable is used. This allows Dust to free memory as soon as the variable will no longer be used, without any help from the user.

Error Handling

Runtime errors are no problem with Dust. The Result type represents the output of an operation that might fail. The user must decide what to do in the case of an error.

match io:stdin() {
    Result::Ok(input) -> output("We read this input: " + input)
    Result::Error(message) -> output("We got this error: " + message)
}

Installation and Usage

There are two ways to compile Dust. It is best to clone the repository and compile the latest code, otherwise the program may be a different version than the one shown on GitHub. Either way, you must have rustup, cmake and a C compiler installed.

To install from the git repository:

git clone https://git.jeffa.io/jeff/dust
cd dust
cargo run --release

To install with cargo:

cargo install dust-lang
dust

Benchmarks

Development Status

Currently, Dust is being prepared for version 1.0. Until then, there may be breaking changes to the language and CLI.