Skip to content

erenworld/karp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karp

Interpreter for the Karp programming language

Every interpreter is built to interpret a specific programming language. That’s how you “implement” a programming language. Without a compiler or an interpreter a programming language is nothing more than an idea or a specification.

We’re going to parse and evaluate our own language called Karp. It’s a language specifically designed for this book.

  • REPL

Expressed as a list of features, Karp has the following:

  • C-like syntax
  • variable bindings
  • integers and booleans
  • arithmetic expressions
  • built-in functions
  • first-class and higher-order functions
  • closures
  • a string data structure
  • an array data structure
  • a hash data structure

What Karp looks like?

Why is it called “Karp”? Well, because karps are magnificent, elegant, fascinating and funny creatures. Exactly like our interpreter

Interpreter vs compiler

What can be said is that the one fundamental attribute they all share is that they take source code and evaluate it without producing some visible, intermediate result that can later be executed. That’s in contrast to compilers, which take source code and produce output in another language that the underlying system can understand.

The interpreter gives them meaning!

About

Interpreter for the Karp programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages