All Projects → mkirchner → stutter

mkirchner / stutter

Licence: MIT license
Implement a Lisp, in C, from scratch, no libs

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to stutter

Swiftpascalinterpreter
Simple Swift interpreter for the Pascal language inspired by the Let’s Build A Simple Interpreter article series.
Stars: ✭ 270 (+315.38%)
Mutual labels:  ast, lexer
Csstree
A tool set for CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations
Stars: ✭ 1,121 (+1624.62%)
Mutual labels:  ast, lexer
Exprtk
C++ Mathematical Expression Parsing And Evaluation Library
Stars: ✭ 301 (+363.08%)
Mutual labels:  ast, lexer
bredon
A modern CSS value compiler in JavaScript
Stars: ✭ 39 (-40%)
Mutual labels:  ast, lexer
Parser
A lexer and parser for GraphQL in .NET
Stars: ✭ 163 (+150.77%)
Mutual labels:  ast, lexer
Cub
The Cub Programming Language
Stars: ✭ 198 (+204.62%)
Mutual labels:  ast, lexer
Tiny Compiler
A tiny compiler for a language featuring LL(2) with Lexer, Parser, ASM-like codegen and VM. Complex enough to give you a flavour of how the "real" thing works whilst not being a mere toy example
Stars: ✭ 425 (+553.85%)
Mutual labels:  ast, lexer
pascal-interpreter
A simple interpreter for a large subset of Pascal language written for educational purposes
Stars: ✭ 21 (-67.69%)
Mutual labels:  ast, lexer
Lioness
The Lioness Programming Language
Stars: ✭ 155 (+138.46%)
Mutual labels:  ast, lexer
Graphql Go Tools
Tools to write high performance GraphQL applications using Go/Golang.
Stars: ✭ 96 (+47.69%)
Mutual labels:  ast, lexer
ocean
Programming language that compiles into a x86 ELF executable.
Stars: ✭ 164 (+152.31%)
Mutual labels:  ast, lexer
Participle
A parser library for Go
Stars: ✭ 2,302 (+3441.54%)
Mutual labels:  ast, lexer
Php Parser
🌿 NodeJS PHP Parser - extract AST or tokens (PHP5 and PHP7)
Stars: ✭ 400 (+515.38%)
Mutual labels:  ast, lexer
Charly Vm
Fibers, Closures, C-Module System | NaN-boxing, bytecode-VM written in C++
Stars: ✭ 66 (+1.54%)
Mutual labels:  ast, lexer
Libpypa
libpypa is a Python parser implemented in pure C++
Stars: ✭ 172 (+164.62%)
Mutual labels:  ast, lexer
Snapdragon
snapdragon is an extremely pluggable, powerful and easy-to-use parser-renderer factory.
Stars: ✭ 180 (+176.92%)
Mutual labels:  ast, lexer
Hexraystoolbox
Hexrays Toolbox - Find code patterns within the Hexrays AST
Stars: ✭ 202 (+210.77%)
Mutual labels:  ast
Tsutils
utility functions for working with typescript's AST
Stars: ✭ 240 (+269.23%)
Mutual labels:  ast
Tatsu
竜 TatSu generates Python parsers from grammars in a variation of EBNF
Stars: ✭ 198 (+204.62%)
Mutual labels:  ast
go-uci
Native Go bindings for OpenWrt's UCI.
Stars: ✭ 69 (+6.15%)
Mutual labels:  lexer

Build Status

Stutter - Lisp, from scratch, in C

screenshot

stutter is an educational Lisp interpreter implementation in C, written entirely from scratch, not using any libraries (with the notable exception of editline to maintain my sanity).

In other words, stutter is a practical exercise in a broad set of CS topics including

  • formal languages (lexing, parsing, abstract syntax trees)
  • metalinguistic evaluation (eval/apply, macros)
  • data structures (lists, trees, maps, arrays)
  • automatic memory management (mark & sweep garbage collection)

All of it is implemented in one of the most bare-bones, down-to-earth (and unforgiving) languages out there: C99.

stutter is a work in progress (and will be, for the forseeable future). See the tests to get an idea of what the language is already capable of.

The Rules

Obviously, in modern our modern times, writing a Lisp interpreter is not as challenging as it used to be since there are a lot of libraries that can help us to achieve that goal. Hence, two rules:

  1. Write everything from scratch.
  2. Do not question the rules.

Getting started

Clone the repo and its submodules (submodules because the garbarge collector is in a separate repo).

$ git clone --recursive [email protected]:mkirchner/stutter.git
$ cd stutter
$ make && make test

This should work on a Mac with a recent clang. No efforts to make it portable (yet).

Next steps

  • Add a VM and support to compile to bytecode
  • Document core language
  • Better error reporting
    • Surface lexer token line/col info in the reader
  • Core capabilities
    • keyword support
    • vector support (Array C type is implemented but not surfaced)
    • hash-map support (Map C type is available but not surfaced)
  • Add a type system
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].