Giter Site home page Giter Site logo

rtrusso / scp Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 690 KB

Bootstrapped compiler platform generating x86 and MIPS assembly

License: MIT License

C 8.62% Scheme 82.33% Makefile 0.11% Batchfile 0.15% Shell 0.16% C# 0.06% Java 8.21% Assembly 0.34%
compiler-design compiler-construction scheme-programming-language scheme-compiler java-programming-language x86-assembly mips-assembly intermediate-representation intermediate-language

scp's Introduction

Quick Start

Use the following steps to bootstrap and validate the compiler.

Windows

  • Ensure GCC, GNU make, NASM, diff in path
  • run src\go.cmd

Linux

  • apt-get install gcc gcc-multilib make nasm diffutils
  • run ./src/go.sh

Since this will take a long time, consider running go.sh under nohup and/or in the background.

Sunnyvale Compiler Platform

This codebase aspires to facilitate the rapid or experimental development of traditional ("ahead-of-time") compilers for a wide range of programming languages.

The codebase consists of these major components:

  • Frontends for a subset of the Scheme and Java programming languages
  • Lexer and parser generator tools
  • an intermediate language: Symbolic Assembly or SASM
  • A backend with code analysis and improvement phases (optimizer)
  • Translation of SASM to practical assembly languages (x86, MIPS)
  • A runtime library with basic memory management and a garbage collector

The idea is that to build a compiler for some programming language, one has to mainly write just a frontend that emits SASM, and runtime library, and take advantage of as many of the existing components as possible to get that working as quickly and/or easily as possible. Ideally, there should also be reuse of the runtime components to the extent possible.

In this way it has similar goals to something like .NET or the JVM without all that mucking about in virtual machines.

scp's People

Contributors

rtrusso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

scp's Issues

Windows build gets stuck with cmd prompt

If the git/usr/bin binaries are in the path, GNU make will launch git/usr/bin/sh.exe to interpret commands in the makefile, instead of using the Windows build in cmd.exe. There appears to be some kind of issue in sh.exe where it won't pass the arguments to cmd.exe correctly, so cmd.exe obediently drops to a prompt and waits for input.

For now the workaround is to (temporarily) remove that from your PATH and try building again.

I'm looking at some ways to reduce dependencies or use a dependency that is better supported on Windows for the Windows build.

Attempting to build on Linux x86-64 machine doesn't work

Currently it's not supported but I've started work on a nasmx64 code generator. Right now that is mostly functional but I have work to do on supporting the x64 coding convention on Linux/Windows, as well as more work to do on the runtime library.

Linux 32-bit build build generated code crashes with updated dependencies

In the documentation I've specified the versions of dependency components that were used to test and develop the Linux build and codegen. Those were the current versions on an older release of debian that I used to dev/test the code.

After upgrading to a more recent version of debian, I found that the generated code crashed early during initializing the runtime library.

I don't have this debugged and fixed yet. Core dumps or any other information is appreciated. I'll eventually get some time to root-cause and fix this.

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.