mikera / magic

Experimental typed JVM Lisp inspired by Clojure
Eclipse Public License 1.0
32 stars 2 forks source link

Magic

Magic is an experimental language, strongly influenced by Clojure.

Objectives

Examples

;; Obligatory....
(println "Hello World")

;; Typical functional programming operations such as map, reduce etc. are available
(defn add2 [x] (+ x 2))
(map add2 [1 2 3])
;; result: [3 4 5]

;; Compilation is delayed until all symbolic dependencies are available 
(def a [1 b])
(def b 2)
(println a)
;; result: [1 2]

;; The environment is an immutable "context" which can be saved and restored
(def initial-ctx *context*) ;; save the current context 
(def mistake "Whoops")      ;; define something 
mitake
;; => "Whoops"
(context initial-context)   ;; revert back to the initial context
mistake
;; => ERROR: unable to resolve symbol 'mistake'

Intended features

This is an EXPERIMENT in programming language design, combining several big ideas from different programming languages:

Documentation

See [https://github.com/mikera/magic/wiki]

Contributing

Magic is a 100% open source project, licensed under the EPL.

You are encouraged to try it out, get involved and give feedback.

Please do not use Magic for production products or serious applications at present, unless you have an extremely high tolerance for frequent breaking changes.