Skip to content

Latest commit

 

History

History
118 lines (88 loc) · 1.74 KB

readme.md

File metadata and controls

118 lines (88 loc) · 1.74 KB

🍖 ham, a programming language made in Rust

NOTE: I'm learning rust, I am still a noob

status: alpha

You can download it from here.

Goals

  • Speed
  • Security
  • Comfort

Language Ideas

  • Rust interoperability
  • Manifest file
  • Ability to import files from:
    • Local file system
    • HTTP urls
    • By name (this would use some kind of remote registry to translate it to HTTP urls)
  • std library
  • Low-level (networking, file system...) APIs

Project ideas

  • CD integration to release a new version in each commit
  • More unit tests

Example

fn calc(value){
    // If the value is 5 end the function
    if value == 5 {
        return 0
    }
    
    // Add 1 
    value.mut_sum(1)
        
    // Print it's value
    println(format("Value is {}", value))
        
    // Call the function again with the latest value    
    return calc(value)
}

// This will print from `Value is 1` to `Value is 5`
let _ = calc(0)

There are more examples in /examples.

About

ham is a general purpose language. It is heavily inspired by Rust and TypeScript.

Usage

Built-in repl:

ham repl

Run files:

ham run examples/demo.ham

Run a project (This will run 1_project/src/main.ham automatically):

ham run examples/1_project

Contribuding

Compiling:

cargo build --release

Linting:

cargo clippy

Formatting:

cargo fmt

Testing:

cargo test

Install mdbook:

cargo install mdbook

Build the book:

mdbook build

Watch for changes on the book:

mdbook watch

Running directly:

cargo run -- run examples/demo.ham

Made by Marc Espín Sanz

MIT License