Coder Social home page Coder Social logo

rustiny's Introduction

RusTiny

This is an educational compiler for a Rust-like language that was originally planned to target the fictional Tiny architecture. But due to Tiny's limitations, RusTiny now targets x86-64 machines. The syntax is based on Rust, but there are numerous semantic differences:

  • The only datatype is int. There also are bool and char, but these are actually ints in disguise.
  • No structs/classes, no modules, only functions. This keeps the whole language managable for me.
  • No mut, no borrow checker. Again: keep it simple.

NOTE: This project is currently on hold as the current approach for SSA register allocation doesn't really pan out. I hope I'll find time to revisit project this sometime in the future.

Goal

My goal is to get the compiler so far that I can write a program that approximates Pi.

Architecture

The general data flow looks something like this:

Source File -(front)-> AST -(middle)-> IR -(back)-> Assembler
  • front: Translates the source file into an Abstract Syntax Tree representation
  • middle: Checks the AST for correctness, transforms it to an Intermediate Representation and performs optimizations
  • back: Translates the IR to Tiny Assembly code x86-64 assembly

Helpful Resources

Resources I found helpful:

rustiny's People

Contributors

msiemens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rustiny's Issues

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.