Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda lang

Simple programing language that compiles into normal lambda calculus expression. Language uses Lambda lib for creating and evaluating lambda expressions.

About

Lambda lang is created to simplify lambda expression creation and is closely ressebles lambda calculus except for some quality of life and different syntax.

Lambda lib created by me is used for lambda expression creating and evaluation.

Syntax

Language file should consist of any amount of statements.

Resulting expression is main constant.

Tokens

Keywords:
def import

Ids:
_this_is_id_123

Numbers:
123

Strings:
"There is no special characters here though."

Symbols:
, [ ] ( ) { } ;

Statemets

Import statement.
import <string>;
Stops compiling this file and compiles mentioned file first.
Circular imports are forbiten.
Path to the file is relative to file import statement is located in.
If one file is already imported earlier it doesn't need to be imported again and so it will be skiped.
Import doesn't have it's own scope and so it can be affected from file you import from. Example:

# lib.ll 
def libfunc func(x);
# main.ll

def func [x] {1};

import "lib.ll";

def main libfunc; # result 1


Constant definition:
def <id> <expr>;
Constants name must be 2 or more characters or it will be interpreted as variable.

Expression

Function:
[<argument>, ... etc.] {<expr>}
Variables and arguments must only be 1 character, else its interpreted as constant.
Translated to lambda calculus as function chaining.

Variable:
a

Call:
<expr>(<expr>, ... etc.)
Translated to lambda calculus as aplicatiuon chaining.

Constant use:
name
Expression from previously declared constant will be coppied.
!No self referencing, if you don't know how to make recursion in lambda calculus read wikipedia first.

Usage

To read usage run lamlang -h.

More about stdlib and lambda calculus

Here.

License

The license for this project is in LICENSE file.

Credits

Creator:

Contact info

GitHub: UAPROGRAMER
Email: stasyatskiu2008@gmail.com

Releases

Contributors

Languages