https://github.com/fergusq/licp
Small functional language that compiles to C
https://github.com/fergusq/licp
compiler programming-language
Last synced: about 1 month ago
JSON representation
Small functional language that compiles to C
- Host: GitHub
- URL: https://github.com/fergusq/licp
- Owner: fergusq
- Created: 2019-04-08T21:44:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-10T21:39:29.000Z (almost 7 years ago)
- Last Synced: 2025-01-18T08:32:23.477Z (about 1 year ago)
- Topics: compiler, programming-language
- Language: Perl 6
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
LICP
====
LICP (Lambda calculus Intermediate language Compiler Program) is a compiler that compiles a simple low-level functional
programming language to C. Its purpose is to be an intermediate language for higher-level functional languages.
Available functions::
Integer commands
+/1+ - Addition
-/1+ - Subtraction
*/1+ - Multiplication
//1+ - Division
=/2+ - Equality
≠/2+ - Inequality
2+ - Less than
≤/2+ - Less than or equal
>/2+ - Greater than
≥/2+ - Greater than or equal
List commands
list/0+ - Creates a list object: (list values...)
get/2 - Subscript: (get list index)
len/1 - Length: (len list)
Lambda commands
λ/2 - Lambda abstraction: (λ parameter-list body)
call/2+ - Evaluate a lambda abstraction: (call lambda arguments...)
Other commands
print/1 - Print a number
if/3 - If: (if cond then else)
let/2 - Bind variables to values: (let ((var val)...) expr)
,/1+ - Execute all arguments, evaluates to the last argument