1
0

Clean up docs

This commit is contained in:
Jeff 2024-12-18 06:27:26 -05:00
parent a34a2c2db4
commit 46060a473d

View File

@ -1,31 +1,31 @@
# Dust # The Dust Programming Language
A programming language that is **fast**, **safe** and **easy to use**. A **fast**, **safe** and **easy to use** language for general-purpose programming.
Dust is **statically typed** to ensure that each program is valid before it is run. It offers Dust is **statically typed** to ensure that each program is valid before it is run. Compiling is
compile times of less than 100 microseconds on modern hardware. As a **bytecode interpreter** with a fast due to the purpose-built lexer and parser. Execution is fast because Dust uses instructions in
**register-based virtual machine**, Dust leverages compile-time safety guarantees and optimizations a highly optimizable, custom bytecode format that runs in a multi-threaded VM. Dust combines
along with beautiful syntax to deliver a unique set of features rarely found in other languages. It compile-time safety guarantees and optimizations with negligible compile times and satisfying speed
is designed to deliver the best qualities of two disparate categories of programming language: the to deliver a unique set of features. It offers the best qualities of two disparate categories of
highly optimized but slow-to-compile languages like Rust and C++ and the quick-to-start but often programming language: the highly optimized but slow-to-compile languages like Rust and C++ and the
slow and error-prone languages like Python and JavaScript. quick-to-start but often slow and error-prone languages like Python and JavaScript.
Dust's syntax, safety features and evaluation model are based on Rust. Its instruction set, Dust's syntax, safety features and evaluation model are based on Rust. Its instruction set,
optimization strategies and virtual machine are based on Lua. Unlike Rust and other languages that optimization strategies and virtual machine are based on Lua. Unlike Rust and other languages that
compile to machine code, Dust has a very low time to execution. Unlike Lua and most other compile to machine code, Dust has a very low time to execution. Unlike Lua and most other
interpreted languages, Dust enforces static typing to improve clarity and prevent bugs. While some interpreted languages, Dust enforces static typing to improve clarity and prevent bugs.
languages currently offer high-level features and strict typing (e.g. TypeScript), Dust has a simple
approach to syntax that offers flexibility and expressiveness while still being *obvious*, even Dust is developed with an emphasis on achieving foundational soundness before adding new features.
those who know how to code but don't know the language. Dust is developed with an emphasis on Dust's planned features and design favor programmers who prefer their code to be simple and clear
achieving foundational soundness before adding new features. Dust's planned features and design rather than clever and complex.
favor programmers who prefer their code to be simple and clear rather than clever and complex.
**Dust is under active development and is not yet ready for general use.** **Dust is under active development and is not yet ready for general use.**
**Features discussed in this README may be unimplemented, partially implemented or temporarily **Features discussed in this README may be unimplemented, partially implemented or temporarily
removed** removed.**
```rust ```rust
// "Hello, world" using Dust's built-in I/O functions
write_line("Enter your name...") write_line("Enter your name...")
let name = read_line() let name = read_line()
@ -34,6 +34,7 @@ write_line("Hello " + name + "!")
``` ```
```rust ```rust
// The classic, unoptimized Fibonacci sequence
fn fib (n: int) -> int { fn fib (n: int) -> int {
if n <= 0 { if n <= 0 {
return 0 return 0
@ -47,16 +48,15 @@ fn fib (n: int) -> int {
write_line(fib(25)) write_line(fib(25))
``` ```
Dust uses a custom register-based virtual machine with its own set of instructions and a compiler Dust is an interpreted language that is compiled to bytecode by a hand-written lexer and parser. It
based on recursive descet to emit them. This should not be confused with a machine code compiler. uses a custom multi-threaded register-based virtual machine with separate-thread garbage collection.
Despite having **compile-time guarantees**, Dust falls into the category of interpreted languages. Competing with the runtime performance of Rust or C++ *is not* a goal. But competing with the
Competing with the runtime performance of Rust or C++ *is not* a goal. Competing with the approachability and simplicity of those languages *is* a goal. Dust *does* intend to be faster than
approachability and simplicity of those languages *is* a goal. On the other hand Dust *does* intend Python, Ruby and NodeJS while also offering a superior development experience and more reliable code
to be faster than Python, Ruby and NodeJS while also offering a superior development experience and due to its static typing. Dust's development approach is informed by some books[^1] and academic
more reliable code due to its static typing. Dust's development approach is informed by some research[^4] as well as practical insight from papers[^2] written by language authors. See the
books[^1] and academic research[^4] as well as practical insight from papers[^2] written by language [Inspiration](README#Inspiration) section for more information or keep reading to learn about Dust's
authors. See the [Inspiration](README#Inspiration) section for more information or keep reading to features.
learn about Dust's features.
## Goals ## Goals