百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

lispe

> 编程语言
开源

一个完整的 Lisp 解释器的实现,具有数据结构、模式编程和高级函数,采用了 Haskell 的懒求值。

604 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个完整的 Lisp 解释器的实现,具有数据结构、模式编程和高级函数,采用了 Haskell 的懒求值。

LispE: Lisp Elémentaire

(To test LispE in your browser click: HERE)

Welcome to Lisp Elémentaire, a version of Lisp that is both compact and offers a large variety of functional and array language features. The code also comes with a small internal editor from another NAVER's project: TAMGU.

The main goal of LispE is to provide a multi-platform language that can harness the power of functional languages with array languages. The real strength of the Lisp language, of which LispE is a dialect, is its very simple but pretty versatile formalism that helps combining all these programming trends together in one single language.

I based a large part of this work on the following article: The Root of Lisp.

  • The description of the language is available here: Introduction to LispE
  • LispE provides a large set of functions, see the index here.
  • A help to the available functions is here: LispE Language Description
  • The wiki index is here: HOME
  • Artificial Intelligence libraries:
    • lispe_torch: encapsulates PyTorch internal libtorch library and SentencePiece
    • lispe_gguf: based on llama.cpp, load and run gguf models
    • lispe_mlx: based on the MLX library to access Mac GPUs
    • lispe_tiktoken: based on the tiktoken library by Open AI for tokenization

TEST LispE in your browser

Since LispE is also a WASM library: you can test LispE HERE.

See also: Predicate-Based Agent in the Browser (PREDIBAG)

CHECK binaries

We have stashed here precompiled versions for Window and Mac OS (including M1)...

A Lisp with all the bells and whistles

LispE is a true Lisp with all the traditional operators that one can expect from such a language:

lisp
(cons 'a '(b c)) ; (a b c)
(cdr '(a b c d e)) ; '(b c d e)
(car '(a b c d e)) ; 'a

(+ 10 20 (* 3 4)) ; 42

(list 'a 'b 'c 'd 'e) ; (a b c d e)

; It also provides some built-in types to handle numbers

(setq l1 (integers 1 2 3))
(setq l2 (integers 4 5 6))

; We can then add these lists together
(+ l1 l2) ; 5 7 9

; or strings

(setq s1 (strings "a" "b" "c"))
(setq s2 (strings "d" "e" "f"))

; We can then add these lists together
(+ s1 s2) ; ("ad" "be" "cf")

; Lists are treated as vectors

(@ s1 1) ; "b"
(@ l1 2) ; 3

; You can loop in a list
(loop i s1 (println i))

You can easily run threads

…

Modern Functional Properties

LispE provides an alternative to parentheses with the composition operator: ".":

lisp
(sum (numbers 1 2 3)) can be written (sum . numbers 1 2 3)

LispE provides a powerfull built-in pattern matching mechanism:

lisp
; You can call a function in the pattern definition of the function
(defun checking (x y) (eq 0 (% y x)))

; the argument should be an integer, whose value is a multiple of 15
; The argument is stored in x
(defpat fizzbuzz ((integer_ (checking 15 x))) 'fizzbuzz)
(defpat fizzbuzz ((integer_ (checking 3 x))) 'fizz)
(defpat fizzbuzz ((integer_ (checking 5 x))) 'buzz)
(defpat fizzbuzz (x) x)
(mapcar 'fizzbuzz (range 1 100 1))

LispE provides also some interesting properties such as: Data Structures

…

LispE provides also some OOP such as: Classes

lisp
; Defines a class named 'truc' with fields x, y, and z
(class@ truc (x y z)

   (defun appel(u)
      (setq x 100)
      (println x y z)
      (+ x y z u)
   )
)

; Defines a class named 'machin' with fields x, y, and z (with a default value of 1).

(class@ machin (x y (z 1))
    ; Defines a method 'appel' that takes one argument 'u'.
    (defun appel(u)
       (println 'machin)(+ x y z u)) 

    ; Defines a method 'configure' that takes one argument 'e'.
    (defun configure(e)
        (setqi x e)
        (setqi v 100))) ; add a new field: `v`

But also array language capabilities

Thanks to an internal structure implemented with arrays, we also provide some array operators.

For instance, here is how Game of life can be solved in one single instruction:

lisp
(defmacro ⊖(l n) (rotate l n true))

(defun lifeinit(x y) (rho x y . random_choice (* x y) (integers 0 1) 17))

(setq r (lifeinit 20 40))
(defun gol8(⍵) ((λ(⍺) (| (& (== ⍺ 4) r) (== ⍺ 3))) (⌿ '+ (⌿  '+ (° (λ (x ⍺) (⊖ ⍺ x)) '(1 0 -1) (↑ (λ (x) (⌽ ⍵ x)) '(1 0 -1)))))))

(println . prettify (gol8 r) 20)

See: Array Operators

Play with it

Finally, LispE can also be used as a Shell: Shell

Come and discover LispE: the Lisp Elémentaire.

We provide a fun little program to discover some of the most interesting aspects of LispE: minizork

Have a look and try it

License

BSD 3-Clause License

…

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Cdata-structuresfunction-compositionhaskell-like-high-level-functioninterpreter

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言