All Projects → carld → Micro Lisp

carld / Micro Lisp

Licence: mit
🎄A very small Lisp programming language 😀that used to be under 200 lines of C🎄

Programming Languages

c
50402 projects - #5 most used programming language
scheme
763 projects
lisp
113 projects

Projects that are alternatives of or similar to Micro Lisp

Bahunya
10KB classless CSS framework with responsive typography, navbar, syntax highlighting, etc.
Stars: ✭ 170 (-75.68%)
Mutual labels:  tiny, small
Minimp3
Minimalistic MP3 decoder single header library
Stars: ✭ 898 (+28.47%)
Mutual labels:  tiny, small
Cash
An absurdly small jQuery alternative for modern browsers.
Stars: ✭ 5,714 (+717.45%)
Mutual labels:  tiny, small
Apkgolf
The smallest Android APK in the world
Stars: ✭ 528 (-24.46%)
Mutual labels:  tiny, small
elk
A low footprint JavaScript engine for embedded systems
Stars: ✭ 1,458 (+108.58%)
Mutual labels:  small, tiny
Webpack Nano
A teensy, squeaky 🐤 clean Webpack CLI
Stars: ✭ 199 (-71.53%)
Mutual labels:  tiny, small
Minimal
A Delightfully Diminutive Lisp. Implemented in < 1 KB of JavaScript with JSON source, macros, tail-calls, JS interop, error-handling, and more.
Stars: ✭ 560 (-19.89%)
Mutual labels:  tiny, small
CalDOM
An agnostic, reactive & minimalist (3kb) JavaScript UI library with direct access to native DOM.
Stars: ✭ 176 (-74.82%)
Mutual labels:  small, tiny
pixie
Tiny template functions.
Stars: ✭ 14 (-98%)
Mutual labels:  small, tiny
Gretchen
Making fetch happen in TypeScript.
Stars: ✭ 301 (-56.94%)
Mutual labels:  tiny, micro
Wsify
Just a tiny, simple and real-time self-hosted pub/sub messaging service
Stars: ✭ 452 (-35.34%)
Mutual labels:  tiny
Next Connect
The TypeScript-ready, minimal router and middleware layer for Next.js, Micro, Vercel, or Node.js http/http2
Stars: ✭ 454 (-35.05%)
Mutual labels:  micro
Lucia
🙋‍♀️ 3kb library for tiny web apps
Stars: ✭ 439 (-37.2%)
Mutual labels:  tiny
Micro
go-micro 微服务实践,更多请关注Micro中国站☞
Stars: ✭ 383 (-45.21%)
Mutual labels:  micro
Micro Router
🚉 A tiny and functional router for Zeit's Micro
Stars: ✭ 621 (-11.16%)
Mutual labels:  micro
Micro Open Graph
A tiny Node.js microservice to scrape open graph data with joy.
Stars: ✭ 371 (-46.92%)
Mutual labels:  micro
Wl Micro Frontends
Micro front end practical project tutorial. 微前端项目实战vue项目。基于vue3.0&qiankun2.0进阶版:https://github.com/wl-ui/wl-mfe
Stars: ✭ 366 (-47.64%)
Mutual labels:  micro
Taggle.js
📝 Form-ready dependency-less tagging.
Stars: ✭ 644 (-7.87%)
Mutual labels:  micro
Learning tools
Go 学习、Go 进阶、Go 实用工具类、Go-kit ,Go-Micro 微服务实践、Go 推送
Stars: ✭ 605 (-13.45%)
Mutual labels:  micro
Lazy importer
library for importing functions from dlls in a hidden, reverse engineer unfriendly way
Stars: ✭ 544 (-22.17%)
Mutual labels:  small

Micro Lisp

Objective: implement a small Lisp/Scheme language in as little C code as possible.

This is a hobby project for educational purposes, it has bugs and may fail without warning. Pull requests and improvements welcome

The interpreter supports lambda, e.g.

  ((lambda (x) (cons x (quote 1))) (quote 7))
  (7 . 1)

Note that lambda does not capture free variables (variables that are not passed as arguments and refer to an outer scope). Free variables will resolve to their assigned values in the environment when the body of the lambda is evaluated.

The special forms if and quote behave in a typical way:

  (if (quote t) (quote 7) (quote 0))
  7

The only types are symbols and pairs.

Non-quoted symbols are looked up in the environment. If they have no associated value the result is null; in fact, zero. Because there is no numeric type a number e.g. 7 will be treated like any other symbol and looked up in the environment. Note in the examples above how numbers are quoted to prevent that.

The built-in primitives in the environment are: car, cdr, cons, eq?, pair?, read, write.

Also provided is apply which takes a function and a single list argument:

  (apply write (quote ((hello world))))
  (hello world)
  (quote t)

Lists can be built up by consing:

  (apply write (cons (cons (quote hello) (cons (quote world) null)) null))
  (hello world)
  (quote t)

Read Eval Print Loop

A REPL is implemented in micro-lisp itself. To try it out in a terminal:

  cat repl.lisp - | ./micro-lisp

To exit, press 'control c' to terminate the process.

Note the - argument to cat to pipe stdin through, otherwise micro-lisp will receive end-of-file.

The source code for the REPL is in repl.lisp. It implements eval and provides an environment which resolves symbols to the primitive functions in the underlying micro-lisp interpreter.

Debugging with GDB

A .gdbinit file sets the target, breakpoints and runs the executable. Simply run gdb.

Pull requests welcome.

asciicast

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].