Skip to content

0x0584/scmin-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Scheme interpreter

About

scmin or minimal Scheme interpreter, is a basic programming environment for the Scheme Programming Language that I had written way back in the summer of 2018. I was trying to learn & make something interesting since I was bored, so I thought that learning some functional programming might be helpful. And It turns out that building your own functional programming language interpreter is an elegant way to do so!

Now, what’s more fascinating, is that previously I had used C, which did many things well. But on the other hand, it’s too primitive and I wasn’t planing to make something that would require such a low level control, ie. doing many things manually equals more code to maintain. So, I have decided to rebuild the interpreter from scratch using C++ — using a modern language provides a whole lot to build something solid and robust, rather than re inventing the wheel.

is it Scheme or Lisp?

Well, they are quite similar! They’re both of the same programming paradigm, that is both belong are functional languages. Yet they differ on an implementation level.

TODOs [2/7]

  • [X] create data types
    • [X] create a conslist type
    • [X] create a token type
    • [X] create symbolic expression type
  • [-] lexing expressions
    • [X] extract tokens from expression
    • [X] detect unbalanced tokens
    • [ ] handle expression over new multiple lines
    • [ ] handle comments
  • [-] parse sexpr
    • [X] parse a basic expression
    • [X] detect parsing errors
    • [ ] recognize escape character \
    • [ ] quansiquote and unquote
    • [ ] improve parsing errors detection
    • [ ] parse syntax-rules
  • [X] eval sexpr
  • [ ] lambdas
    • [ ] accept va_args (rest of arguments)
  • [-] add keywords:
    • [X] define eval
    • [X] car cdr cons
    • [X] set-car! set-cdr! set! unset!
    • [X] type indicators
    • [X] if cond
    • [X] comparison operators > < >= <= == !=
    • [X] logical operators and or not
    • [X] let let* letrec
    • [ ] do and case
  • [ ] sophisticated error management

About

Remake of scmin using C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published