GithubHelp home page GithubHelp logo

crenshaw-compiler-ruby's Introduction

Let's Build a Compiler

This repository is my attempt to follow along the tutorial from 1988 by Jack Crenshaw called Let's Build a Compiler.

I've attempted to port both the Turbo Pascal sources from the tutorial to Ruby and the generated 68k assembler to x86-64 OS X assembler (my target host). See Assembly below for more details.

I've followed the original source and style pretty closely. I imagine at some point it will be fun to rewrite in a style I'm more familiar with, but that comes later.

cradle.rb

This is the cradle program source that Crenshaw uses as a starting point.

I've modified it a bit to include some basic plumbing, primarily around the assembly bits.

Assembly

The assembly produced targets my x86-64 OS X host.

I've attempted to interpret and translate the 68k assembly as best as I can, but I don't have a 68k host to test against and my assembler is very rusty (last time I played with assembly was on an emulated Z80 processor).

My goal is to produce a runnable program, even if some of the steps don't make perfect sense. This includes stubbing out some values because the tutorial isn't precisely clear about the expected outcomes.

Sources

crenshaw-compiler-ruby's People

Contributors

mtodd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ajinkyakulkarni

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.