1
0
General purpose programming language and shell
Go to file
2024-07-28 13:11:42 -04:00
dust_examples Rearrange repo; Add rust example 2024-07-15 16:42:49 -04:00
dust-lang Fix and clean up interpreter changes 2024-07-28 13:11:42 -04:00
dust-shell Add interpreter context management 2024-07-15 16:58:54 -04:00
std Use rust-style type parameter syntax 2024-06-24 13:54:37 -04:00
.gitignore Do not ignore generated tree sitter files 2023-11-28 13:53:33 -05:00
Cargo.lock Add use statements with pre-compile std library 2024-07-01 14:23:01 -04:00
Cargo.toml Clean up 2024-03-22 17:22:39 -04:00
README.md Add error; Clean up struct values 2024-07-28 12:52:07 -04:00

Dust

High-level programming language with effortless concurrency, automatic memory management, type safety and familiar syntax.

io.write_line("Guess the number.")

secret_number = random.in_range(0..100)

loop {
  	io.write_line("Input your guess.")

  	input = io.read_line().expect("Failed to read line.")
  	guess = match input.trim().parse() {
    	Ok(value) => value,
      Err(_) => continue,
    }

  	if guess < secret_number {
  	  	io.write_line("Too low!")
	  } else if guess > secret_number {
	    	io.write_line("Too high!")
	  } else {
	    	io.write_line("You win!")
	    	break
	  }
}