mihama 0.0.1

A Modern Functional and Dependent Type Programming Language Base on Rust
Documentation
  • Coverage
  • 0%
    0 out of 278 items documented0 out of 43 items with examples
  • Size
  • Source code size: 1.27 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.95 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • biyuehu/sena-lang
    4 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • biyuehu

Mihama Language

LICENSE wakatime

Developing...

A Modern Functional and Dependent Type Programming Language Base on Rust.

Features

  • Modern Syntax
  • Functional Programming
  • Dependent Types
  • The First-Class Type
  • Parsing and Type Checking
  • Many targets
  • Simple, safe and Fast

Demo

let foo = 1
foo = 2 // Error
let foo = "Hello, FP!"
let foo: Char = 'X'
let foo: Bool = False
let foo: Float = 3.1415926

type Bool = True | False
type List: Kind -> Kind = <T> Cons(T, List<T>) | Nil
type String = List<Char>
type String = [Char]

let fruits: List<String> = Cons("Apple", Cons("Banana", Cons("Pear", Nil)))
let fruits: [String] = ["Apple", "Banana", "Pear"]

let add: Int -> Int -> Int = x => y => x + y
let add: Int -> Int -> Int = (x, y) => x + y
let add = (x: Int, y: Int) -> Int => x + y

let fibonacii: Int -> Int =
 | 1 => 1
 | 2 => 1
 | x => fibonacii(x - 1) + fibonacii(x - 2)
let fibonacii: Int -> Int = x => match x {
    | 1 => 1
    | 2 => 1
    | x => fibonacii(x - 1) + fibonacii(x - 2)
}

let handle_score = (x: Int) =>
    if x > 100 || x < 0 then "Fake"
    else if x == 100 then "Best"
    else if x > 90 then "Excellent"
    else if x > 70 then "Good"
    else if x > 60 then "Not bad"
    else if x > 40 then "Bad"
    else "Shit"

let bar = (
    let x = 20, y = 30
    in x + y ** 2 * 2 / 5 - 5 % 1
)
let bar = {
    let x = 20, y = 30
    x + y ** 2 * 2 / 5 - 5 % 1
}