Giter Club home page Giter Club logo

santol's Introduction

Santol is an CIL-to-LLVM compiler. It takes (highly) compliant CIL code and replaces the stack based operations with SSA form equivalents allowing for LLVM IR to be generated. The outputted code is VM free, meaning it is AOT compiled to use a select few helper functions at runtime (for managing memory and exceptions, like the C++ runtime).

Features

  • Most mathematical operations
  • Most conditional operations
  • Branching
  • Static calls
  • Static members (methods, fields, constants)
  • Enums
  • Structs (Sequential only)
  • Direct memory access (pointers)
  • Primitive type conversions

Todo

  • Exceptions
  • Objects (+ boxing)
  • Arrays
  • Inheritance (Interfaces + Virtual calls)
  • Advanced structs (non-sequential + interfaces)
  • Memory management (Garbage collection)

The ‘mscorlib’ is not implemented yet, meaning most inbuilt classes do not exist. Therefore, any code that requires them will not compile. A few classes are partly hard coded directly in (such as the base representation of ints and objects) however most methods in these classes are not supported. It is not known at this point whether a custom corlib will be wrote from scratch or whether the mscorlib will be ran through Santol with the native method calls patched.

The produced LLVM code does not aim to follow the CIL standard. Types on the stack are not always expanded to int32s and are reduced wherever possible. However, the input CIL code must strictly follow the CIL standard, especially when it comes to state of the stack. Most importantly, the stack must be empty on a backwards branch if no forward branch exists to that location. Without these assumptions the algorithms would become a lot more complex leading to less efficient output, however if support for non-compliant code is needed, a fallback mode can be added.

santol's People

Contributors

csnewman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.