Minimal Lisp-like programming language written in C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
include
lib
src
LICENSE
Makefile
README.md
lispy

README.md

Lispy

Project from the website Build your own Lisp.

What is Lispy ?

Lispy is a small Lisp-like programming language written in C, using mpc library to parse the input easily.

What are Lispy's features ?

Lispy supports all the basic features that you would expect from a programming language, like :

  • Variables
  • Functions
  • Conditionals
  • Error handling
  • Standard library
  • etc.

But, there is more to it :

  • S-Expression : symbolic-expression is a list of one or more expressions (number, string, symbol, etc.).
  • Q-Expression : quoted-expression is a list of one or more expressions that are not evaluated during process but instead left exactly as they were typed in.

Examples of programs written in Lispy

Hello World! :

("Hello World!")

Fibonacci function :

(fun {fib n} {
  select
    { (== n 0) 0 }
    { (== n 1) 1 }
    { otherwise (+ (fib (- n 1)) (fib (- n 2))) }
})

Factorial function :

(fun {fac n} {
   select
      { (== n 0) 1 }
      { otherwise (* (n) (fac(- n 1)))}
})