Meridian
Meridian is a custom lisp dialect written in C, it's uses s-expressions for its syntax.
Todo List
✓
Initial implementation in C
Indentation based s-expressions inspired by this scheme proposal.
Pattern based macros
Add support for vector and object types
Add Bidirectional type checking
Compile to LLVM bytecode
GitHub Link
Examples
Fibonacci Sequence
(import "lib/std/comparison.mr")
(defn dec (x) (- x 1))
(defn inc (x) (+ x 1))
(defn fib (n)
(if (<= n 2)
1
(+ (fib (dec n)) (fib (- n 2)))))
(println (fib 20))
Factorial
;; implemented using recursion
(defn factorial (n)
(if (= n 0)
1
(* n (factorial (- n 1)))))
Square
;; implement using a lambda
(def square
(fn (x) (* x x)))
;; or can be implemented using "defn" syntatic sugar
(defn square (x) (* x x))
Square using indentations
;; implement using a lambda
def square
fn (x) (* x x)
;; or can be implemented using "defn" syntatic sugar
defn square (x)
* x x