Giter Site home page Giter Site logo

llvm-sauce's Introduction

llvm-sauce

A yummy source to llvm IR compiler!

Usage

You will want to build the package first.

yarn
yarn build

Following which, you can execute the program with yarn start. For example

yarn start -p tests/source0/test1.js

Testing

We have a very rudimentary test script since there is not much else that we need. To write a test, create a file named test_<description>.js inside /tests/source?/. Tests have this format:

<source_program>
// expected output

Note that only the last line is taken as expected output. For the program to even compile it must also be a proper Source comment. Spaces immediately after // does not matter. To test multiple things at the same time, it may be useful to know that display() is varag and you can do display(a,b,c) for example. It is most helpful to look at existing tests and copy/paste them.

There might be some quirks that one must keep in mind to write tests. These occur because there is no effort put into sanitizing things because it is not needed right now.

  • All numbers are double. Printed numbers go to 6 decimal places, even for example display(3)
  • Booleans are int1. Therefore display(true) gives 1, and display(false) gives 0.
  • Display spaces out its arguments with a single space.

llvm-sauce's People

Contributors

jiachen247 avatar podocarp avatar

Watchers

James Cloos 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.