GithubHelp home page GithubHelp logo

gutpuncher / ttc-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timmyjose-compilers/ttc-rs

0.0 0.0 0.0 20 KB

An implementation of the Teeny Tiny Compiler in Rust. Check the README for more details.

License: The Unlicense

Rust 99.33% Makefile 0.67%

ttc-rs's Introduction

ttc-rs

Working through the teenytinycompiler compiler tutorial, in Rust.

Grammar: See docs/grammar.md

Build

A Makefile is provided for compiling the generated C file. The default executable name is ttc, but this can be changed in the Makefile.

$ cargo clean && cargo build --release && make && ./ttc

Demo

~/dev/projects/incubator/ttc-rs:master$ cargo clean && cargo build --release
   Compiling ttc-rs v0.1.0 (/Users/z0ltan/dev/projects/incubator/ttc-rs)
    Finished release [optimized] target(s) in 1.97s

~/dev/projects/incubator/ttc-rs:master$ cargo run samples/fib.teeny
   Compiling ttc-rs v0.1.0 (/Users/z0ltan/dev/projects/incubator/ttc-rs)
    Finished dev [unoptimized + debuginfo] target(s) in 1.07s
     Running `target/debug/ttc-rs samples/fib.teeny`
Program compiled successfully

~/dev/projects/incubator/ttc-rs:master$ make && ./ttc
gcc -Wall -std=c99 -flto -O3 -o ttc out.c
How many fibonacci numbers do you want?
10

0.00
1.00
1.00
2.00
3.00
5.00
8.00
13.00
21.00
34.00

~/dev/projects/incubator/ttc-rs:master$ make clean
   rm -f out.c ttc

LICENCE

See LICENSE.md.

ttc-rs's People

Contributors

timmyjose 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.