Code Monkey home page Code Monkey logo

monkey-cpp's Introduction

Monkey: Writing An Interpreter/Compiler In C++

Reference the book Writing An Interpreter In Go and Writing A Compiler In Go.

But re-write the Monkey interpreter/compiler with C++.

  • src/01: token and lexer
  • src/02: parser
  • src/03: evaluation
  • src/04: builtin funcs, string, array, hashmap
  • src/05: bytecode and virutal machine, OpConstant and OpAdd only
  • src/06: expression and condition statement
  • src/07: symbol table, string, array, hashmap and index expression
  • src/08: function
  • src/09: butiltin functions
  • src/10: function closures and benchmark fibonacci

Also see the MinYiLife Blogs

Run

For example:

$ cd src/10/
$ mkdir build/
$ cd build/
$ cmake ..
$ make

$ ./test_monkey

$ ./monkey

Hello lesliezhu! This is the Monkey-CPP programming language!
Feel free to type in commands
>> let add = fn(x,y){ return x + y; }
>> add(3,4)
7
>>

Requires

monkey-cpp's People

Contributors

lesliezhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

monkey-cpp's Issues

环境配置问题

你好,非常感谢你的工作。最近我也在学习这本自制编译器的书籍,也想用cpp重写,于是搜索到了你的仓库,但是在环境配置那里有点问题,请问Requires下的GoogleTest和[gflags具体要怎么操作配置呢? 请问能麻烦你详细写一下配置环境这个部分吗或者录制一个视频?或者在你的博客里面专门创作一份文章?
希望我的要求不会太过分,祝工作顺利。

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.