marteinn / IdeLISP

A LISP written in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IdeLISP

IdeLISP

This is a LISP I put together while reading Build Your Own Lisp. Inspired by Lispy, Clojure and Common Lisp.

Installing

  • Clone MPC and drop mpc.c and mpc.h in the project root
  • make build

(Please note this project is currently not cross-platform, and probably never will be. Will much likely work when compiling on Mac OS/Ubuntu)

Running

Using the REPL

./bin/idelisp
IdeLISP (type exit() to quit)
>> + 1 1
2

Executing a file

./bin/idelisp -f example.ilisp
2

Compiling and running as WebAssembly

Example syntax

(load "standard.ilisp")
(+ 1 2)
(* (+ 2 3.1) (* 2 3))
{:my_key "value"}
(def :x 1)
(+ x 1)
(defn :plus-two '(x) '(+ 2 x))
(plus-two 2)
(defl :combine (fn '(x y) '(+ x y)))
(combine 2 1)
(== 1 1)
(if (== 1 1)
    '(print 1)
    '(print 2)
)
(if (and (== 1 1) (!= 1 0))
    '(print 1)
    '(print 2)
)
(not 0)
; I am a comment
(let '(a b) '(1 2)'
    '(print a))
(zero-arity-fn ())

Language syntax

See the language specification

The name?

Its a pun on the french name for dogmatix in Asterix/Obelix, which is Idéfix.

License

This project is released under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0

About

A LISP written in C

License:Other


Languages

Language:C 86.8%Language:HTML 12.7%Language:Makefile 0.5%