https://github.com/dantecatalfamo/sillylisp
A sort-of-a-lisp extracted from a previous project.
https://github.com/dantecatalfamo/sillylisp
config configuration-language lisp zig
Last synced: 20 days ago
JSON representation
A sort-of-a-lisp extracted from a previous project.
- Host: GitHub
- URL: https://github.com/dantecatalfamo/sillylisp
- Owner: dantecatalfamo
- License: mit
- Created: 2023-09-24T20:25:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-24T20:42:44.000Z (over 1 year ago)
- Last Synced: 2025-04-10T06:59:38.356Z (21 days ago)
- Topics: config, configuration-language, lisp, zig
- Language: Zig
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sillylisp
A sort-of-a-lisp extracted from a previous project.
Originally intended to be used as a configuration language.
Designed to be easy to grok and fast.
It doesn't have a garbage collector but instead frees everything when the environment is destroyed.
Uses lists instead of cons cells internally.Supports lambdas, special forms, recursion, debugging, tracing, defining functions and variables, etc.
## Building
```zig
zig build
```## Running
```zig
zig build run
```This will open an interactive REPL.
## Usage
```zig
const std = @import("std");
const environment = @import("environment.zig");pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{ .enable_memory_limit = true }){};
var allocator = gpa.allocator();
const stdin = std.io.getStdIn().reader();
const stdout = std.io.getStdOut().writer();
var env = try environment.Environment.init(allocator);
defer env.deinit();var expression = "(+ 1 2 3)"
const result = try env.load(expression);
try result.toString(stdout);
try stdout.print("\n", .{});
}
```