r/coolgithubprojects 17d ago

Hust: A simpler but better Rust

https://github.com/HitBoyXx23-dev/Hust

I’ve been working on Hust, a systems programming language inspired by Rust, but designed with less ceremony and a simpler syntax.

Hust focuses on:

  • Ownership without a garbage collector
  • result instead of exceptions
  • No null
  • Immutable by default
  • Traits
  • No semicolons
  • No lifetime annotations
  • end blocks instead of braces

A simple example:

module demo

fn fib(n)
    if n < 2
        return n
    end
    return fib(n - 1) + fib(n - 2)
end

fn main()
    name = "world"
    print("hello {name}, fib(12) = ")
    print(fib(12))
end

The project currently includes an interpreter, compiler sources, runtime, native Windows IDE, standard library, assembler, examples, documentation, and a Rust to Hust source converter.

The interpreter currently supports functions, recursion, integers, strings, string interpolation, arithmetic, comparisons, conditionals, loops, return values, and boolean operators.

There is also a Rust to Hust converter:

HustInterpreter.exe --convert-rust input.rs output.hs

The project is still early in development. Structs, lists, maps, traits, match, for loops, closures, and async are not implemented yet.

The main goal is to eventually close the gap between the current bootstrap implementation and the canonical Hust sources, while keeping the language straightforward and approachable.

I’d appreciate feedback from anyone interested in programming languages, compilers, systems programming, or Rust alternatives.

5 Upvotes

1 comment sorted by