Giter Club home page Giter Club logo

durian's Introduction

๐Ÿ durian

Build Status codecov

Anatomy of a Durian

durian

Dependencies

git submodule update --init --recursive

Building

If you use CLion IDE, the project should "just work" if you import it as a new project (since CMake is integrated into CLion), and you should be able to click the build/run button, which will put build artifacts into the cmake-build-debug/ directory by default.

If you are using a Unix-based system (i.e. Linux or macOS) and you would like to build from the command line, you can do so with the following set of commands in the repo's main directory:

mkdir build
cd build/
cmake ..
make

To briefly explain, this:

  • Creates a new directory named build/ and enters it.
  • Calls CMake to create the build system in the current directory (i.e. build/), telling it that the CMakeLists.txt config file is in the parent directory (i.e. ..).
  • Calls make (i.e. the generated build system) in the build/ directory to compile the code.

Durian Sample Code

$ durian example.dur shit
         88                        88
         88                        ""
         88
 ,adPPYb,88 88       88 8b,dPPYba, 88 ,adPPYYba, 8b,dPPYba,
a8"    `Y88 88       88 88P'   "Y8 88 ""     `Y8 88P'   `"8a
8b       88 88       88 88         88 ,adPPPPP88 88       88
"8a,   ,d88 "8a,   ,a88 88         88 88,    ,88 88       88
 `"8bbdP"Y8  `"YbbdP'Y8 88         88 `"8bbdP"Y8 88       88

@ UBC Launch Pad 2018!

thiabaud is eaten!
Delicious!
Yikes!

durian's People

Contributors

bobheadxi avatar bwdmonkey avatar coffeetableespresso avatar rwblickhan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rwblickhan

durian's Issues

Implement string literal compiling

String literals still need to be compiled. In particular, we would like to have (immutable) shared string literals in the static data section of the bytecode. To do so, the compiler will store a dictionary of string literals/static data indices, and when compiling of an entire source file is finished, the string literals will be written as appropriate to the static data section. The actual string literal nodes, then, will simply determine the appropriate index, push this onto the stack, and then output the NEWSTR8 opcode.

Implement lexer

Implement the actual lexer, taking a string and producing a list of tokens (as defined in #13).

Create MVP Project

Write a small command-line game or utility in our new programming language.

EBNF

Write EBNF for Durian, in file grammar.ebnf.

Create token definition

Create a class to represent different types of tokens, storing the token type, value (if an identifier), literal (if a literal), and line number (at least).

Setup build system and Travis

Set up a build system (possibly CMakeLists?) and hook it up to Travis for continuous integration.

It would also be good to have a basic main file and maybe a sample unit test (GTest?).

Design

finish design of Durian.

Implement bytecode file loading for VM

The VM currently takes a pointer to bytecode, but doesn't include the metadata or static data described on the wiki. Now that we have at least some bytecode being written to a file, we need to write the metadata at the top of every bytecode file, load the file after writing and pass it to the VM, and change the VM to take into account the metadata.

Compiler

Write source to bytecode compiler.

Implement functions in VM

Implement RET and CALL opcodes as described in the calling conventions section of the implementation decisions wiki page, as well as a DurianObject to represent functions.

VM

write bytecode VM

Do more parser testing

We should add more unit tests of the parser, as well as stress-testing it with complex inputs.

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.