Skip to content

follang/fol

Repository files navigation

logo

License: MIT Travis (.org) Codecov Gitter Contributors

general-purpose and systems programming language


FOL is a general-purpose, systems programming language designed for robustness, efficiency, portability, expressiveness and most importantly elegance. Heavily inspired (and shamelessly copying) from languages: zig, nim, c++, go, rust, julia (in this order), hence the name - FOL (Frankenstein's Objective Language). In Albanian language "fol" means "speak".

** FOL IS STILL JUST AN IDEA **


BUILDING BLOCKS

Everything in FOL is declared like below:

	declaration<options> name: returntype = { body; };
	declaration<options> name: returntype = { body; } | { checker } | { alternative; };

four top-most declarations are:

	use    // imports, includes ...
	def    // macros, bocks, definitions ...

	var    // all variables: ordinal, container, complex, special

	pro    // subporgrams with side effects - procedures
	fun    // subporgrams with no side effects - functions
	log    // subporgrams with logic only - logicals

	typ    // new types: records, entries, blueprints ...
	ali    // aiased types and extensions

a control flow and keywords:

	when(condition){ case (){}; case (){}; * {}; };
	loop(condition){  };

example:

use log: mod[std] = {fmt::log};


def argo: mod[init] = {
    -var const: str = "something here"

    +pro main: int = {
        log.warn("Last warning!...");
        .echo(add(3, 5));
    }

    fun add(a, b: int): int = { a + b }
}