GithubHelp home page GithubHelp logo

strux's Introduction

Strux

Strux is a language created for COMS W4115 Programming Languages and Translators at Columbia University. It is a general purpose language with a focus on data structure visualization, and compiles into LLVM.

A detailed report on Strux is available here.

Compiling & Running

Strux requires LLVM and its development libraries, the m4 macro preprocessor, opam, and clang. Useful instructions for installing these on your operating system can be found in the MicroC README.

Inside Strux's root folder, type make. This first creates the Strux to LLVM compiler, called strux.native. It then calls a script, linkStrux.sh, that converts the C code to LLVM bytecode.

N.B. As of this writing (December 2017), macOS High Sierra introduces a compatibility problem with the LLVM bitreader. We were unable to run Strux on a machine running High Sierra, but earlier versions of macOS should run perfectly. Strux was also tested on Ubuntu 16.04.

Run Tests

To run Strux's test suite, simply call the test script from the root directory:

$ ./testall.sh

This will iterate through all files in the tests/ directory, indicate whether they passed, and log their output in case of failure. testall.sh is based on the MicroC test script.

Run a new program

The easiest way to run a new program is to call it via the testall.sh script. Although the test script will expect a .out file to compare against, the linking will be handled automatically. You can inspect the <your\_filename>.out file in the root directory to see what was printed.

$ ./testall.sh <your_filename>.strux

A simple Strux program

All basic Strux programs include a main() function that accepts no arguments and returns 0. They are named <filename>.strux. A simple “Hello World” program therefore looks like this:

int main() {
    print("Hello, World!");
    return 0;
}

strux's People

Contributors

millieyang avatar fredrick-tam avatar jcbartlett25 avatar sophstad avatar

Watchers

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