Giter Site home page Giter Site logo

maxbyz / kilo-purelisp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ytaki0801/kilo-purelisp

1.0 0.0 0.0 229 KB

Texteditor with a Pure LISP interpreter including operations of last S-expression evaluating and parenthese matching

C 97.56% Makefile 1.15% Dockerfile 1.29%

kilo-purelisp's Introduction

Kilo with C version of PureLISP.sh

This software is Kilo texteditor with a Pure LISP interpreter, C version of PureLISP.sh, including operations of last S-expression evaluating and parenthese matching.

The source code to compile Kilo is supposed to be from a tutorial site, Build Your Own Text Editor Step 130, which is copied and arranged as kilo-BYOTE130.c and kilo-BYOTE130.h in this repository.

How to Compile and Use

  • Docker image: docker run --rm -it ytaki0801/kplisp

Just type make to compile in this repository, on a standard POSIX system including C compiler and library with Make, as well as cc -DPURE_LISP_LIB -o kplisp kplisp.c kilo-BYOTE130.c PureLISP.c

Type ./kplisp <filename> to use. Parentheses matching is done automatically, Ctrl-e is to eval-last-sexp, Ctrl-s is to save and Ctrl-q is to quit.

demo

For the PureLISP.sh specification, see PureLISP.sh repository and sample.plsh.

PureLISP.c

You can also compile PureLISP.c with PureLISP.h alone to use in a simple one-line-input REPL like the following. It is written in standard C specification only so enable to compile by not only GCC or Clang but also C compiler of Visual Studio Community or Tiny C Compiler.

$ cc PureLISP.c
$ ./a.out
S> (def reduce (lambda (f L i) (cond ((eq L nil) i) (t (f (car L) (reduce f (cdr L) i))))))
reduce
S> (reduce cons '(a b c) '(d e f g))
(a b c d e f g)
S> [Type Ctrl-d or Ctrl-c to exit]

TODO

  • Full implemention of eval error handling in the interpreter.

License

kilo-purelisp's People

Stargazers

Gkoran Stoilkovits avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.