Facilis - A Low Level Functional Language
h
CSharpIsGud (643)

Facilis is a strongly typed functional language that aims to be low level. Facilis uses a hand-written recursive descent parser made with love.

Factorial Example

impure foreign putchar(c of u8) -> void
impure foreign tostr(num of void*) -> string

impure write(str of string, start of i32) -> void {
	putchar(str[start])

	if start != str.length() {
		write(str, start + 1)
	}
}

pure fact(i of i32) -> i32 {
	if i == 1 {
		return i
	}

	return i * fact(i - 1)
}

impure main() -> i32 {
    write(tostr(fact(6)), 0)
}

Demo: https://repl.it/@Facilislang/FacilisDemo#README.md
^ Has a user/password login program loaded by default. Read the README!

Source: https://repl.it/@Facilislang/Facilis
^ 2072 lines of C++!

@CSharpIsGud @Subarashi @xxpertHacker

You are viewing a single comment. View All
Jakman (458)

@xxpertHacker I have created a paradigm that allows OOP and FP. When you call a method on an object it returns a new object with some modification. This technically follows Fp guidelines and allows you to still use OOP efficiently. for example Instead of

struct Car {tire_count:u32}
impl Car {
   fn lose_tire(&mut self) {
       self.tire_count -= 1;
   }

You could have this

struct Car {tire_count:u32}
impl Car {
    fn lose_tire(&self) -> Self {
        return Car{tire_count:self.tire_count-1};
    }
}